:root {
  --ai-bg-1: #f8fafc;
  --ai-bg-2: #eef2ff;
  --ai-panel: rgba(255, 255, 255, 0.9);
  --ai-line: #dbe7f3;
  --ai-text: #0f172a;
  --ai-sub: #64748b;
  --ai-brand: #0ea5e9;
  --ai-brand-2: #0284c7;
  --ai-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --ai-radius-xl: 16px;
  --ai-radius-lg: 12px;
}

body.gk-ai-theme {
  color: var(--ai-text);
  background:
    radial-gradient(1200px 420px at 85% -20%, rgba(14, 165, 233, 0.2), transparent 66%),
    linear-gradient(145deg, var(--ai-bg-1) 0%, var(--ai-bg-2) 100%) !important;
}

.gk-ai-theme::before {
  opacity: 0.22;
}

.gk-ai-theme a {
  color: #0369a1;
}

.gk-ai-theme .max-w-4xl,
.gk-ai-theme .max-w-3xl {
  max-width: 1040px !important;
}

.gk-ai-theme .gk-home-back {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ai-line);
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  transition: all .2s ease;
}

.gk-ai-theme .gk-top-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ai-line);
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all .2s ease;
}

.gk-ai-theme .gk-top-icon-btn:hover {
  border-color: #7dd3fc;
  color: #0369a1;
  transform: translateY(-1px);
}

.gk-ai-theme .gk-home-back:hover {
  border-color: #7dd3fc;
  color: #0369a1;
  transform: translateY(-1px);
}

.gk-ai-theme .shell,
.gk-ai-theme .glass-panel,
.gk-ai-theme .card,
.gk-ai-theme .bg-white,
.gk-ai-theme .panel,
.gk-ai-theme .modal-content {
  background: var(--ai-panel) !important;
  border: 1px solid var(--ai-line) !important;
  border-radius: var(--ai-radius-xl) !important;
  box-shadow: var(--ai-shadow) !important;
  backdrop-filter: blur(10px);
}

.gk-ai-theme .topbar,
.gk-ai-theme header.sticky {
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(248, 250, 252, 0.84)) !important;
  border-bottom: 1px solid var(--ai-line) !important;
}

.gk-ai-theme .title-wrap h1,
.gk-ai-theme .brand-title,
.gk-ai-theme h1,
.gk-ai-theme h2,
.gk-ai-theme h3,
.gk-ai-theme h4 {
  color: #0f172a !important;
}

.gk-ai-theme .title-wrap p,
.gk-ai-theme .brand-sub,
.gk-ai-theme .muted,
.gk-ai-theme .text-slate-500,
.gk-ai-theme .text-slate-600,
.gk-ai-theme .text-slate-400 {
  color: var(--ai-sub) !important;
}

.gk-ai-theme .btn,
.gk-ai-theme button,
.gk-ai-theme .nav-btn,
.gk-ai-theme .board-mode-btn {
  border: 1px solid var(--ai-line) !important;
  border-radius: var(--ai-radius-lg) !important;
  background: #fff;
  color: #334155 !important;
  transition: all .2s ease;
}

.gk-ai-theme .btn:hover,
.gk-ai-theme button:hover,
.gk-ai-theme .nav-btn:hover,
.gk-ai-theme .board-mode-btn:hover {
  border-color: #7dd3fc !important;
  color: var(--ai-brand-2) !important;
  transform: translateY(-1px);
}

.gk-ai-theme .btn-primary,
.gk-ai-theme .tab-btn.active,
.gk-ai-theme .nav-btn.active,
.gk-ai-theme .board-mode-btn.active {
  color: #fff !important;
  border-color: #38bdf8 !important;
  background: linear-gradient(135deg, var(--ai-brand), var(--ai-brand-2)) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.gk-ai-theme .tab-btn {
  border: 1px solid var(--ai-line) !important;
  border-radius: 999px !important;
  padding: 9px 16px !important;
  background: rgba(255,255,255,0.75) !important;
}

.gk-ai-theme .tab-btn::after {
  display: none !important;
}

.gk-ai-theme input,
.gk-ai-theme textarea,
.gk-ai-theme select,
.gk-ai-theme .input,
.gk-ai-theme .select,
.gk-ai-theme .textarea,
.gk-ai-theme .search-input {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a !important;
  border: 1px solid var(--ai-line) !important;
  border-radius: var(--ai-radius-lg) !important;
  min-height: 40px;
}

.gk-ai-theme input:focus,
.gk-ai-theme textarea:focus,
.gk-ai-theme select:focus,
.gk-ai-theme .search-input:focus {
  outline: none !important;
  border-color: #7dd3fc !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16) !important;
}

.gk-ai-theme .table-wrap,
.gk-ai-theme .question-table-wrap,
.gk-ai-theme .kanban-card,
.gk-ai-theme .paper-card,
.gk-ai-theme .question-card,
.gk-ai-theme .idiom-card,
.gk-ai-theme .wrong-card,
.gk-ai-theme .day-card,
.gk-ai-theme .news-item,
.gk-ai-theme #tab-news article,
.gk-ai-theme #tab-shenlun article {
  border: 1px solid var(--ai-line) !important;
  border-radius: var(--ai-radius-xl) !important;
  background: rgba(255,255,255,0.86) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.gk-ai-theme table th {
  background: rgba(241, 245, 249, 0.85) !important;
  color: #334155 !important;
}

.gk-ai-theme table td {
  color: #475569 !important;
}

.gk-ai-theme .metric-value,
.gk-ai-theme .text-3xl,
.gk-ai-theme .text-2xl {
  color: #0f172a !important;
}

.gk-ai-theme .pill,
.gk-ai-theme .score-pill,
.gk-ai-theme #date-label {
  background: #f8fafc !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
}

/* idiom/news/shenlun shared header polish */
.gk-ai-theme #app-section > header {
  margin-top: 8px !important;
  margin-bottom: 16px !important;
  padding: 16px 18px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--ai-shadow);
}

.gk-ai-theme #app-section > header .absolute.left-0,
.gk-ai-theme #app-section > header .absolute.right-0 {
  top: 14px !important;
}

.gk-ai-theme #upload-section {
  border-radius: var(--ai-radius-xl) !important;
}

/* xingce page specific refinement */
.gk-ai-theme .topbar-inner {
  max-width: 1120px !important;
}

.gk-ai-theme .shell {
  border-radius: 20px !important;
}

.gk-ai-theme .brand img {
  border-color: #bae6fd !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.18);
}

.gk-ai-theme .review-item {
  background: rgba(248, 250, 252, 0.92) !important;
  border-color: #d7e7f7 !important;
}

.gk-ai-theme .bar,
.gk-ai-theme .analysis-item .line {
  background: #eaf1f8 !important;
}

.gk-ai-theme .bar-fill,
.gk-ai-theme .analysis-item .line > span {
  background: linear-gradient(90deg, #38bdf8, #0284c7) !important;
}

.gk-ai-theme .kanban-col {
  background: rgba(248, 250, 252, 0.9) !important;
  border-color: #d7e7f7 !important;
}

.gk-ai-theme .kanban-head {
  color: #475569 !important;
}

.gk-ai-theme .kanban-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #dbeafe !important;
}

.gk-ai-theme .kanban-card.selected {
  background: #f0f9ff !important;
  border-color: #7dd3fc !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16) !important;
}

.gk-ai-theme .empty {
  background: #f8fbff !important;
  border-color: #bfdbfe !important;
  color: #64748b !important;
}

.gk-ai-theme .filters,
.gk-ai-theme .batch-panel,
.gk-ai-theme .board-view-switch,
.gk-ai-theme .selection-count,
.gk-ai-theme .question-table-wrap,
.gk-ai-theme .question-card,
.gk-ai-theme .question-table th,
.gk-ai-theme .question-table tr.selected-row,
.gk-ai-theme .review-pill,
.gk-ai-theme .analysis-item,
.gk-ai-theme .paper-card,
.gk-ai-theme .paper-selector-panel,
.gk-ai-theme .paper-selector-head,
.gk-ai-theme .paper-preview-panel,
.gk-ai-theme .paper-preview-head,
.gk-ai-theme .paper-preview-wrap {
  background: #f8fbff !important;
  border-color: #dbeafe !important;
}

.gk-ai-theme .question-table th {
  color: #334155 !important;
}

.gk-ai-theme .question-table td {
  border-bottom-color: #e2e8f0 !important;
}

.gk-ai-theme .table-title,
.gk-ai-theme .q-title {
  color: #0f172a !important;
}

.gk-ai-theme .table-snippet,
.gk-ai-theme .q-sub,
.gk-ai-theme .q-text,
.gk-ai-theme .batch-msg,
.gk-ai-theme .check-inline {
  color: #64748b !important;
}

.gk-ai-theme .board-mode-btn {
  color: #64748b !important;
}

.gk-ai-theme .board-mode-btn:hover {
  background: #eff6ff !important;
  color: #0369a1 !important;
}

.gk-ai-theme .board-mode-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #fff !important;
}

.gk-ai-theme .review-pill {
  color: #0369a1 !important;
}

.gk-ai-theme .paper-card:hover {
  border-color: #7dd3fc !important;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12) !important;
}

.gk-ai-theme .paper-card.active {
  background: #f0f9ff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.16) !important;
}

.gk-ai-theme .paper-cover {
  background: linear-gradient(145deg, #eef7ff 0%, #dbeeff 58%, #cce5ff 100%) !important;
  border-bottom-color: #bfdbfe !important;
  color: #0c4a6e !important;
}

.gk-ai-theme .paper-cover-year {
  color: #0c4a6e !important;
}

.gk-ai-theme .paper-cover-label {
  color: #0369a1 !important;
}

.gk-ai-theme .paper-title {
  color: #0f172a !important;
}

.gk-ai-theme .paper-meta {
  color: #64748b !important;
}

.gk-ai-theme .paper-preview-head strong {
  color: #0f172a !important;
}

.gk-ai-theme .paper-preview-frame {
  background: #f8fbff !important;
}

.gk-ai-theme .modal {
  background: rgba(15, 23, 42, 0.3) !important;
}

.gk-ai-theme .modal-box {
  background: #ffffff !important;
  border-color: #dbeafe !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15) !important;
}

.gk-ai-theme .modal-head {
  background: #f8fbff !important;
  border-bottom-color: #dbeafe !important;
}

.gk-ai-theme .q-detail,
.gk-ai-theme .q-options .opt,
.gk-ai-theme .paper-preview-wrap {
  background: #ffffff !important;
  border-color: #dbeafe !important;
}

/* politics page refinement */
.gk-ai-theme .highlight-text {
  text-decoration-color: rgba(14, 165, 233, 0.3) !important;
}

.gk-ai-theme .dir-item.active {
  border-color: #7dd3fc !important;
  background: #f0f9ff !important;
}

/* study manager dark theme override */
.gk-ai-theme .title-wrap h1,
.gk-ai-theme .metric-value,
.gk-ai-theme .card h2 {
  text-shadow: none !important;
}
