/* 全局样式重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
  --bg-page: #f5f3ff;
  --bg-card: #ffffff;
  --bg-elevated: #f3e8ff;
  --bg-input: #ffffff;
  --bg-input-disabled: #f3e8ff;
  --text-input: #1e1b4b;
  --text-input-muted: #7c6fa8;
  --text-primary: #1e1b4b;
  --text-secondary: #4c1d95;
  --text-muted: #7c6fa8;
  --border: #e9d5ff;
  --border-strong: #d8b4fe;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-soft: #f3e8ff;
  --accent-text: #7c3aed;
  --header-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --search-btn-gradient: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.08);
  --shadow-md: 0 12px 32px rgba(124, 58, 237, 0.12);
  --shadow-dropdown: 0 12px 32px rgba(124, 58, 237, 0.14);
  --score-val: #7c3aed;
  --high-score: #e11d48;
  --low-score: #0284c7;
  --rating: #f59e0b;
  --heat: #f97316;
  --tag-211-bg: #dbeafe;
  --tag-211-text: #1d4ed8;
  --tag-985-bg: #ffedd5;
  --tag-985-text: #c2410c;
  --tag-type-bg: #ede9fe;
  --tag-type-text: #6d28d9;
  --tag-type-zs-bg: #d1fae5;
  --tag-type-zs-text: #047857;
  --tag-shuangfei-bg: #f1f5f9;
  --tag-shuangfei-text: #475569;
  --tag-research-bg: #ede9fe;
  --tag-research-text: #6d28d9;
  --tag-tier-other-bg: #ecfdf5;
  --tag-tier-other-text: #047857;
  --progress-bg: #e9d5ff;
  --rank-gold: #f59e0b;
  --rank-silver: #94a3b8;
  --rank-bronze: #ea580c;
  --rank-badge: #8b5cf6;
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-card: #111827;
  --bg-elevated: #1e293b;
  --bg-input: #ffffff;
  --bg-input-disabled: #1e293b;
  --text-input: #0f172a;
  --text-input-muted: #64748b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-strong: #475569;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --accent-text: #a5b4fc;
  --header-gradient: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
  --search-btn-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.45);
  --score-val: #38bdf8;
  --high-score: #fb7185;
  --low-score: #38bdf8;
  --rating: #facc15;
  --heat: #fb923c;
  --tag-211-bg: rgba(30, 58, 138, 0.55);
  --tag-211-text: #60a5fa;
  --tag-985-bg: rgba(124, 45, 18, 0.55);
  --tag-985-text: #fdba74;
  --tag-type-bg: rgba(88, 28, 135, 0.55);
  --tag-type-text: #c084fc;
  --tag-type-zs-bg: rgba(6, 95, 70, 0.55);
  --tag-type-zs-text: #34d399;
  --tag-shuangfei-bg: rgba(51, 65, 85, 0.55);
  --tag-shuangfei-text: #94a3b8;
  --tag-research-bg: rgba(76, 29, 149, 0.45);
  --tag-research-text: #c4b5fd;
  --tag-tier-other-bg: rgba(6, 95, 70, 0.35);
  --tag-tier-other-text: #6ee7b7;
  --progress-bg: #334155;
  --rank-gold: #f59e0b;
  --rank-silver: #94a3b8;
  --rank-bronze: #ea580c;
  --rank-badge: #818cf8;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  padding: 40px 20px;
  font-size: 18px;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.top-bar-spacer {
  flex: 1;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background-color: var(--accent-soft);
}

.theme-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  color: var(--accent-text);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.admin-link:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.header h1 {
  text-align: center;
  font-size: 28px;
  background: var(--header-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.kaoyan-countdown {
  text-align: center;
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.kaoyan-countdown .countdown-days {
  color: var(--accent-text);
  font-weight: 700;
  font-size: 1.15em;
  font-variant-numeric: tabular-nums;
}

.home-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
  gap: 20px;
  align-items: start;
  margin-bottom: 8px;
}

.home-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-aside {
  min-width: 0;
}

.home-tools {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(72vh, 560px);
  padding: 14px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(165deg, #ede9fe 0%, var(--bg-card) 42%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  overflow: hidden;
}

[data-theme="dark"] .home-tools {
  background: linear-gradient(165deg, #1e293b 0%, var(--bg-card) 50%);
}

.home-tools-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
}

.home-tools-desc {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.home-tools-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.home-tool-card {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-tool-card:hover,
.home-tool-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(76, 29, 149, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.home-tool-media {
  display: block;
  flex: 0 0 auto;
  height: 86px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.home-tool-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-tool-caption {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .home-tool-caption {
  background: var(--bg-card);
}

.home-tool-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.home-tool-desc,
.home-tool-arrow {
  display: none;
}

.home-tool-card.is-placeholder {
  cursor: default;
  pointer-events: none;
  opacity: 0.88;
  box-shadow: none;
}

.home-tool-card.is-placeholder:hover,
.home-tool-card.is-placeholder:focus-visible {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.home-tool-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 86px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(236, 72, 153, 0.1)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(148, 163, 184, 0.12) 6px,
      rgba(148, 163, 184, 0.12) 12px
    );
}

.heat-preview {
  margin: 0 0 20px;
  padding: 16px 16px 16px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.heat-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.heat-preview-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.heat-preview-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 16px;
  flex-shrink: 0;
}

.heat-preview-link {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
}

.heat-preview-link:hover {
  text-decoration: underline;
}

.heat-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.heat-preview-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.heat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 14px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.heat-card:hover,
.heat-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  outline: none;
  transform: translateY(-1px);
}

.heat-card-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--rank-badge);
}

.heat-card-rank.is-gold {
  background: linear-gradient(160deg, #fde68a, var(--rank-gold));
}

.heat-card-rank.is-silver {
  background: linear-gradient(160deg, #e2e8f0, var(--rank-silver));
  color: #1e293b;
}

.heat-card-rank.is-bronze {
  background: linear-gradient(160deg, #fdba74, var(--rank-bronze));
}

.heat-card-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 18px;
  min-width: 0;
}

.heat-card-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
}

.heat-card-avatar.is-compact {
  font-size: 9px;
  letter-spacing: -0.04em;
  padding: 0 2px;
}

.heat-card-avatar.tag-985 {
  background: var(--tag-985-bg);
  color: var(--tag-985-text);
}

.heat-card-avatar.tag-211 {
  background: var(--tag-211-bg);
  color: var(--tag-211-text);
}

.heat-card-avatar.tag-shuangfei {
  background: var(--tag-shuangfei-bg);
  color: var(--tag-shuangfei-text);
}

.heat-card-avatar.tag-research {
  background: var(--tag-research-bg);
  color: var(--tag-research-text);
}

.heat-card-avatar.tag-tier-other {
  background: var(--tag-tier-other-bg);
  color: var(--tag-tier-other-text);
}

[data-theme="dark"] .heat-card-avatar:not([class*="tag-"]) {
  background: linear-gradient(135deg, #60a5fa, #818cf8);
}

.heat-card-meta {
  min-width: 0;
  flex: 1;
}

.heat-card-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 18px;
}

.heat-card-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--heat);
  font-variant-numeric: tabular-nums;
}

.heat-card-tag,
.heat-card-location {
  flex-shrink: 0;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.heat-card-tag {
  color: #fff;
  background: var(--rank-badge);
}

.heat-card-location {
  color: var(--text-muted);
  background: var(--bg-elevated);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .home-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 230px);
    gap: 16px;
  }

  .heat-preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-main .search-filters {
    grid-template-columns: 1.15fr 0.8fr 0.7fr 0.9fr 1.05fr;
    gap: 6px;
  }
}

@media (max-width: 900px) {
  .home-workspace {
    grid-template-columns: 1fr;
  }

  .home-aside {
    order: -1;
  }

  .home-tools {
    max-height: min(52vh, 420px);
  }

  .home-tools-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .home-tool-media {
    height: 96px;
  }

  .heat-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-main .search-box {
    flex-wrap: wrap;
  }

  .home-main .search-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 100%;
    width: 100%;
  }

  .home-main .search-box > button {
    margin-left: auto;
  }
}

@media (max-width: 700px) {
  .heat-preview {
    padding: 14px;
  }

  .heat-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .heat-preview-title {
    font-size: 17px;
  }

  .home-tools-list {
    grid-template-columns: 1fr;
  }

  .home-main .search-filters {
    grid-template-columns: 1fr;
  }

  .home-main .search-box > button {
    width: 100%;
    margin-left: 0;
  }
}

.search-box {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  margin-bottom: 28px;
  box-sizing: border-box;
}

.home-main .search-box {
  flex-wrap: nowrap;
  gap: 8px;
}

.search-filters {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.9fr 1.05fr 1.75fr;
  gap: 12px;
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: none;
  align-items: end;
}

.home-main .search-filters {
  grid-template-columns: 1.2fr 0.85fr 0.75fr 0.95fr 1.15fr;
  gap: 8px;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.home-main .search-field label {
  font-size: 14px;
}

.home-main .search-field select,
.home-main .search-field input,
.home-main .direction-trigger {
  padding: 11px 12px;
  font-size: 15px;
}

.home-main .search-box > button {
  flex-shrink: 0;
  margin-left: 0;
  padding: 11px 18px;
  height: 46px;
  font-size: 16px;
}

.home-main .result-container {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.search-field-directions .direction-select-wrap,
.search-field-disciplines .direction-select-wrap {
  margin-top: 0;
}

.search-field label {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 2px;
}

.search-field select,
.search-field input,
.direction-trigger {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-input);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field input::placeholder {
  color: var(--text-input-muted);
}

.direction-trigger {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.search-field select {
  cursor: pointer;
}

.search-field select:disabled,
.search-field input:disabled,
.direction-trigger.is-locked,
.direction-trigger:disabled.is-locked {
  background-color: var(--bg-input-disabled);
  color: var(--text-input-muted);
  cursor: not-allowed;
  opacity: 1;
}

[data-theme="dark"] .search-field select:disabled,
[data-theme="dark"] .search-field input:disabled,
[data-theme="dark"] .direction-trigger.is-locked,
[data-theme="dark"] .direction-trigger:disabled.is-locked,
[data-theme="dark"] .direction-trigger:disabled:not(.is-idle):not(.is-locked) {
  color: var(--text-muted);
}

.direction-trigger.is-locked .direction-trigger-text,
.direction-trigger.is-locked .direction-trigger-arrow,
.direction-trigger:disabled.is-locked .direction-trigger-text,
.direction-trigger:disabled.is-locked .direction-trigger-arrow {
  color: inherit;
}

.direction-trigger:disabled:not(.is-idle):not(.is-locked) {
  background-color: var(--bg-input-disabled);
  color: var(--text-input-muted);
  cursor: not-allowed;
  opacity: 1;
}

.direction-trigger.is-idle,
.direction-trigger:disabled.is-idle {
  background-color: var(--bg-input);
  color: var(--text-input-muted);
  cursor: not-allowed;
  opacity: 1;
}

.direction-trigger.is-idle .direction-trigger-text,
.direction-trigger.is-idle .direction-trigger-arrow,
.direction-trigger:disabled.is-idle .direction-trigger-text,
.direction-trigger:disabled.is-idle .direction-trigger-arrow {
  color: inherit;
}

.direction-trigger:not(:disabled):not(.is-locked):not(.is-idle) .direction-trigger-text,
.direction-trigger:not(:disabled):not(.is-locked):not(.is-idle) .direction-trigger-arrow {
  color: var(--text-input);
}

.search-field select:focus,
.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.direction-trigger:not(:disabled):not(.is-locked):not(.is-idle):hover,
.direction-trigger.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.direction-label-hint {
  display: none;
}

.direction-select-wrap {
  position: relative;
}

.direction-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-trigger-arrow {
  color: var(--text-input-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.direction-trigger:not(:disabled):not(.is-locked):not(.is-idle) .direction-trigger-arrow {
  color: var(--text-input-muted);
}

.direction-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
  padding: 6px 0;
}

.direction-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.direction-dropdown-item:hover {
  background-color: var(--bg-elevated);
}

.direction-dropdown-item.selected {
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

.direction-dropdown-check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
}

.direction-dropdown-item.selected .direction-dropdown-check {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.direction-dropdown-hint {
  padding: 8px 14px 6px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.search-field-school {
  position: relative;
}

.school-input-wrap {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
  padding: 6px 0;
}

.search-dropdown::-webkit-scrollbar {
  width: 8px;
}

.search-dropdown::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.search-dropdown-item:hover,
.search-dropdown-item.active {
  background-color: var(--bg-elevated);
}

.search-dropdown-item .suggest-name {
  font-weight: 600;
  color: var(--text-primary);
}

.search-dropdown-item .suggest-tier {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
}

.search-dropdown-item .suggest-tier.tag-985 {
  background-color: var(--tag-985-bg);
  color: var(--tag-985-text);
}

.search-dropdown-item .suggest-tier.tag-211 {
  background-color: var(--tag-211-bg);
  color: var(--tag-211-text);
}

.search-dropdown-item .suggest-tier.tag-shuangfei {
  background-color: var(--tag-shuangfei-bg);
  color: var(--tag-shuangfei-text);
}

.search-dropdown-item .suggest-tier.tag-research {
  background-color: var(--tag-research-bg);
  color: var(--tag-research-text);
}

.search-dropdown-item .suggest-tier.tag-tier-other {
  background-color: var(--tag-tier-other-bg);
  color: var(--tag-tier-other-text);
}

.search-box > button {
  flex-shrink: 0;
  padding: 12px 28px;
  background: var(--search-btn-gradient);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  font-weight: bold;
  height: 48px;
  box-shadow: var(--shadow-sm);
}

.search-box > button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .search-filters {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .search-box {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box > button {
    width: 100%;
  }
}

.school-hints {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 8px;
}

.home-main .school-hints {
  text-align: left;
  padding-left: 2px;
}

.year-range {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.result-container.single-program-view .school-title {
  text-align: left;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.result-container.single-program-view .year-range {
  text-align: left;
  padding-left: 14px;
}

.school-title {
  text-align: left;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 10px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.card-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.card-discipline {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.card-direction {
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  padding: 3px 10px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 999px;
}

.tag-211 {
  background-color: var(--tag-211-bg);
  color: var(--tag-211-text);
}

.tag-985 {
  background-color: var(--tag-985-bg);
  color: var(--tag-985-text);
}

.tag-shuangfei {
  background-color: var(--tag-shuangfei-bg);
  color: var(--tag-shuangfei-text);
}

.tag-research {
  background-color: var(--tag-research-bg);
  color: var(--tag-research-text);
}

.tag-tier-other {
  background-color: var(--tag-tier-other-bg);
  color: var(--tag-tier-other-text);
}

.tag-type {
  background-color: var(--tag-type-bg);
  color: var(--tag-type-text);
}

.tag-type.zs {
  background-color: var(--tag-type-zs-bg);
  color: var(--tag-type-zs-text);
}

.rating {
  margin-left: auto;
  font-size: 14px;
  color: var(--rating);
}

.card-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.card-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background-color: var(--accent-soft);
}

.card-toggle-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.card.is-collapsed .card-toggle-icon {
  transform: rotate(-90deg);
}

.card-body {
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  margin-top: 14px;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin-top 0.28s ease;
}

.card.is-collapsed .card-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.score-summary {
  display: flex;
  justify-content: space-between;
  background-color: var(--bg-elevated);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.year-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.score-val {
  font-size: 15px;
  font-weight: bold;
  color: var(--score-val);
}

.card-body-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.card-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  min-height: 188px;
}

.panel-chart .chart-container {
  flex: 1;
  width: 100%;
  min-height: 168px;
  height: 168px;
}

.chart-container {
  width: 100%;
  height: 168px;
}

.panel-stats .details-list {
  width: 100%;
  align-content: center;
}

.details-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.detail-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-row span {
  flex: 1;
  min-width: 0;
}

.detail-row strong {
  color: var(--text-primary);
  font-size: 16px;
  text-align: right;
  flex-shrink: 0;
}

.high-score {
  color: var(--high-score) !important;
}

.low-score {
  color: var(--low-score) !important;
}

.exam-subjects-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.exam-subject-block {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.exam-subject-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.exam-subject-value {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.subject-bars h4 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.bar-group {
  margin-bottom: 8px;
}

.bar-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.progress-bg {
  background-color: var(--progress-bg);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  transition: width 0.6s ease;
}

.bar-pol { background-color: #10b981; }
.bar-eng { background-color: #3b82f6; }
.bar-math { background-color: #f59e0b; }
.bar-proj { background-color: #ef4444; }

@media (max-width: 900px) {
  .card-body-grid {
    grid-template-columns: 1fr;
  }

  .card-panel {
    min-height: auto;
  }

  .panel-chart .chart-container,
  .chart-container {
    min-height: 160px;
    height: 160px;
  }

  .details-list {
    grid-template-columns: 1fr 1fr;
  }

  .exam-subjects-info {
    grid-template-columns: 1fr;
  }

  .score-summary {
    flex-wrap: wrap;
    gap: 10px;
  }

  .score-item {
    min-width: calc(50% - 8px);
  }
}

@media (max-width: 520px) {
  .details-list {
    grid-template-columns: 1fr;
  }

  .score-item {
    min-width: 100%;
  }

  .theme-toggle-label {
    display: none;
  }
}
