:root {
  --bg-dark: #0b0c10;
  --bg-dark-soft: #111827;
  --bg-light: #f5f6fa;
  --text-light: #f7f7fb;
  --text-muted: #b7bccb;
  --text-dark: #1f2230;
  --accent: #4ad5ff;
  --accent-strong: #1cb5e0;
  --card-dark: rgba(20, 24, 40, 0.85);
  --card-border: rgba(92, 122, 255, 0.25);
  --shadow-soft: 0 20px 50px rgba(8, 12, 22, 0.45);
  --shadow-light: 0 12px 30px rgba(25, 32, 56, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
}

body.home {
  background: radial-gradient(circle at 20% 20%, rgba(48, 60, 130, 0.5), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(9, 126, 193, 0.35), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(68, 94, 169, 0.35), transparent 55%),
    var(--bg-dark);
}

body.light {
  background: var(--bg-light);
  color: var(--text-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 28px 80px;
}

.header-title {
  text-align: center;
  font-size: 42px;
  letter-spacing: 3px;
  font-weight: 600;
  margin-bottom: 14px;
}

.header-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 50px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero-card {
  background: var(--card-dark);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--card-border);
}

.hero-card h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.hero-card p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 15px;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.button-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #0a0f19;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(28, 181, 224, 0.35);
}

.button-primary:disabled,
.button-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-primary:hover {
  transform: translateY(-2px);
}

.button-outline {
  background: transparent;
  color: var(--text-light);
  border: 1px dashed var(--accent);
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
}

body.light .button-outline {
  color: #1f2230;
  border-color: #1f2230;
}

.topbar .button-outline {
  color: #1f2230;
  border-color: #1f2230;
  background: rgba(255, 255, 255, 0.8);
}

.article-list {
  display: grid;
  gap: 18px;
}

.article-item {
  background: rgba(13, 18, 34, 0.85);
  border: 1px solid rgba(74, 213, 255, 0.2);
  border-radius: 18px;
  padding: 18px 20px;
}

.article-item h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.article-item p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.topbar {
  background: #0a0b10;
  color: #f1f2f7;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar .back-link {
  color: #f1f2f7;
  font-size: 18px;
}

.topbar-info {
  font-size: 14px;
  color: #b7bccb;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.light-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7ef;
  box-shadow: var(--shadow-light);
  padding: 24px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.upload-card {
  display: flex;
  flex-direction: column;
}

.drop-zone {
  border: 2px dashed #c5c9d9;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: #6a7086;
  transition: border-color 0.2s ease;
  flex: 1;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.drop-zone.active {
  border-color: var(--accent-strong);
}

.drop-zone input {
  display: none;
}

.drop-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(14px, 14px);
  background: rgba(31, 34, 48, 0.92);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 8px 20px rgba(15, 18, 30, 0.2);
  z-index: 2;
}

.drop-tooltip.visible {
  opacity: 1;
}

.file-meta {
  margin-top: 12px;
  color: #1f2230;
  font-weight: 600;
}

.action-row {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-shell {
  margin-top: 16px;
  min-height: 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.progress-shell.is-active {
  opacity: 1;
  pointer-events: auto;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: linear-gradient(90deg, #e6e9f4, #f0f2fa);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d8dcec;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ad5ff, #38ef7d, #4ad5ff);
  background-size: 200% 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.progress-text {
  margin-top: 10px;
  font-size: 13px;
  color: #5a6074;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-text::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.redeem-box {
  margin-top: 22px;
  padding: 16px;
  border-radius: 12px;
  background: #f7f8ff;
  border: 1px solid #e2e6f3;
}

.redeem-box h4 {
  font-size: 16px;
  margin-bottom: 6px;
}

.redeem-box p {
  color: #6a7086;
  font-size: 13px;
}

.redeem-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.redeem-row input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6d8e3;
  font-family: inherit;
  font-size: 14px;
}

.redeem-message {
  margin-top: 10px;
  color: #ff6b6b;
  font-size: 13px;
}

.result-section {
  margin-top: 26px;
}

.result-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-section h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-radius: 2px;
}

.result-output {
  min-height: 120px;
  white-space: normal;
  color: #202436;
  font-size: 15px;
  line-height: 1.7;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border: 1px solid #e2e6f3;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(74, 130, 255, 0.08), inset 0 0 0 1px rgba(74, 213, 255, 0.1);
}

.result-output.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a7086;
}

/* 综合评分卡片 */
.overall-score-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
  animation: slideIn 0.5s ease-out;
}

.overall-score-card.high-score {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 8px 32px rgba(17, 153, 142, 0.3);
}

.overall-score-card.mid-score {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 8px 32px rgba(245, 87, 108, 0.3);
}

.overall-score-card.low-score {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  box-shadow: 0 8px 32px rgba(235, 51, 73, 0.3);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.score-circle .score-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.score-circle .score-label {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}

.overall-score-info {
  flex: 1;
}

.overall-score-info h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.overall-score-info p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

/* 评分维度网格 */
.dimension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

/* 结果行样式 */
.result-line {
  background: #ffffff;
  border-left: 4px solid #a7b3e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.4s ease-out backwards;
}

.result-line:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-line:nth-child(1) { animation-delay: 0.05s; }
.result-line:nth-child(2) { animation-delay: 0.1s; }
.result-line:nth-child(3) { animation-delay: 0.15s; }
.result-line:nth-child(4) { animation-delay: 0.2s; }
.result-line:nth-child(5) { animation-delay: 0.25s; }
.result-line:nth-child(6) { animation-delay: 0.3s; }
.result-line:nth-child(7) { animation-delay: 0.35s; }
.result-line:nth-child(8) { animation-delay: 0.4s; }
.result-line:nth-child(9) { animation-delay: 0.45s; }
.result-line:nth-child(10) { animation-delay: 0.5s; }

.result-line.bullet {
  border-left-color: var(--accent-strong);
  background: linear-gradient(135deg, #eefbff 0%, #e8f7ff 100%);
}

.result-line.header {
  border-left-color: #ffb347;
  background: linear-gradient(135deg, #fff5e6 0%, #fff0d9 100%);
  font-weight: 600;
  font-size: 16px;
}

.result-line.dimension-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 15px;
}

.result-line.dimension-title .dimension-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.result-line.dimension-title .dimension-text {
  flex: 1;
}

.result-line.sub-item {
  margin-left: 20px;
  font-size: 14px;
  padding: 12px 14px;
}

.result-line:last-child {
  margin-bottom: 0;
}

/* 分数徽章 */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.score-badge:hover {
  transform: scale(1.05);
}

.score-badge.high {
  background: linear-gradient(135deg, #d8f7e6 0%, #c3f0d8 100%);
  color: #0d5c2a;
  border: 1px solid #a8e6c3;
}

.score-badge.high::before {
  content: "\2191";
  font-size: 11px;
}

.score-badge.mid {
  background: linear-gradient(135deg, #fff1d6 0%, #ffe9c2 100%);
  color: #8a4d00;
  border: 1px solid #ffd699;
}

.score-badge.mid::before {
  content: "\2192";
  font-size: 11px;
}

.score-badge.low {
  background: linear-gradient(135deg, #ffd9d9 0%, #ffcaca 100%);
  color: #a31b10;
  border: 1px solid #ffb3b3;
}

.score-badge.low::before {
  content: "\2193";
  font-size: 11px;
}

/* 建议卡片 */
.suggestion-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 16px;
}

.suggestion-card h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #0369a1;
  margin-bottom: 10px;
}

.suggestion-card h5::before {
  content: "\1F4A1";
  font-size: 16px;
}

.suggestion-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestion-card li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.suggestion-card li::before {
  content: "\2022";
  position: absolute;
  left: 6px;
  color: #0ea5e9;
  font-weight: bold;
}

.suggestion-card li:last-child {
  margin-bottom: 0;
}

/* 截断提示 */
.summary-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-note::before {
  content: "\26A0";
  font-size: 14px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6a7086;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}

.notice-box {
  border: 2px solid #ff6b6b;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  color: #ff5c5c;
  font-weight: 600;
}

.notice-box small {
  display: block;
  margin-top: 14px;
  font-weight: 500;
  color: #cc3f3f;
}

.qr-grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.qr-item {
  background: #ffffff;
  border-radius: 12px;
  border: 1px dashed #ffb3b3;
  padding: 12px;
  text-align: center;
  color: #5a6074;
  font-size: 13px;
}

.qr-item img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto 8px;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at 20% 20%, rgba(31, 100, 158, 0.2), transparent 45%),
    var(--bg-dark);
}

.login-card {
  background: var(--card-dark);
  padding: 36px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  width: min(420px, 100%);
}

.login-card h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-field label {
  font-size: 14px;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6d8e3;
  font-family: inherit;
  font-size: 14px;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.tab-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tab-row button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #cfd3e2;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.tab-row button.active {
  background: #1f2230;
  color: #ffffff;
  border-color: #1f2230;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #e6e8f0;
}

.table th {
  color: #5a6074;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-result {
  border: 1px dashed #cfd3e2;
  border-radius: 12px;
  padding: 14px 16px;
  background: #ffffff;
}

.batch-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2230;
}

.batch-result pre {
  margin-top: 10px;
  font-family: "Space Grotesk", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #2d3142;
  white-space: pre-wrap;
}

body.article {
  background: radial-gradient(circle at 15% 15%, rgba(86, 125, 216, 0.16), transparent 45%),
    var(--bg-light);
}

.article-shell {
  max-width: 880px;
}

.article-card {
  padding: 34px;
}

.article-header h1 {
  font-size: 32px;
  color: #1f2230;
  margin-bottom: 10px;
}

.article-meta {
  font-size: 13px;
  color: #6a7086;
}

.article-body {
  margin-top: 22px;
  font-size: 16px;
  color: #2d3142;
  line-height: 1.9;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-body h1,
.article-body h2,
.article-body h3 {
  margin: 28px 0 16px;
  color: #1f2230;
  font-weight: 600;
}

.article-body h1 {
  font-size: 28px;
}

.article-body h2 {
  font-size: 24px;
}

.article-body h3 {
  font-size: 20px;
}

.article-body ul,
.article-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: #f7f8ff;
  border-left: 4px solid var(--accent-strong);
  border-radius: 0 12px 12px 0;
  color: #5a6074;
  font-style: italic;
}

.article-body pre {
  margin: 20px 0;
  padding: 16px;
  background: #1f2230;
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #e8e8e8;
  line-height: 1.6;
}

.article-body code {
  background: #f0f2f8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #e53e3e;
}

.article-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.article-body a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--accent);
}

.article-body strong {
  font-weight: 600;
  color: #1f2230;
}

.article-body em {
  font-style: italic;
}

.article-body u {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body s {
  text-decoration: line-through;
  color: #6a7086;
}

@media (max-width: 768px) {
  .header-title {
    font-size: 32px;
  }

  .page {
    padding: 40px 18px 60px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-output {
    min-height: 100px;
  }
}
