/* ============================================================
   cloud.css — 账号、排行榜、作文评分的界面样式
   与 tokens.css 的既有变量保持一致，浅色主题、靛蓝主色。
   ============================================================ */

/* ---------------- 导航栏用户区 ---------------- */
.nav__user { margin-left: var(--sp-4); display: flex; align-items: center; }
.nav__me {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 4px 12px 4px 4px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--bg-surface);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.nav__me:hover { border-color: var(--brand-300); background: var(--brand-50); }
.nav__av {
  width: 30px; height: 30px; border-radius: var(--r-full);
  object-fit: cover; display: grid; place-items: center; flex: 0 0 auto;
}
.nav__av--ph { background: var(--brand-100); color: var(--brand-700); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.nav__name {
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-base);
  max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 通用提示条 ---------------- */
.alert {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: var(--lh-snug);
  margin: var(--sp-4) 0; border: 1px solid transparent;
}
.alert--error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert--warn  { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert--ok    { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert--info  { background: var(--info-soft); border-color: #bfdbfe; color: #1e40af; }

/* ---------------- 认证页布局 ---------------- */
.auth-wrap { padding: var(--sp-10) 0 var(--sp-16); }
.auth-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 460px;
  gap: var(--sp-12); align-items: start;
}
.auth-intro__title { font-size: var(--fs-4xl); line-height: var(--lh-tight); margin: var(--sp-4) 0 var(--sp-4); letter-spacing: -0.02em; }
.auth-intro__lead { font-size: var(--fs-md); color: var(--text-muted); line-height: var(--lh-relaxed); max-width: 46ch; }
.auth-intro__list { list-style: none; padding: 0; margin: var(--sp-8) 0 0; display: grid; gap: var(--sp-5); }
.auth-intro__list li { padding-left: var(--sp-5); border-left: 2px solid var(--brand-200); }
.auth-intro__list b { display: block; color: var(--text-strong); margin-bottom: var(--sp-1); font-size: var(--fs-base); }
.auth-intro__list span { display: block; font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-relaxed); }
.auth-note {
  margin-top: var(--sp-8); padding: var(--sp-3) var(--sp-4);
  background: var(--gray-100); border-radius: var(--r-md);
  font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug);
}

.auth-panel {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-8);
  box-shadow: var(--sh-lg); position: sticky; top: calc(var(--nav-h) + var(--sp-4));
}
.auth-seg { width: 100%; margin-bottom: var(--sp-6); }
.auth-seg button { flex: 1; }

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; gap: var(--sp-3); list-style: none; padding: 0; margin: 0 0 var(--sp-6); }
.steps li {
  flex: 1; display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); color: var(--text-faint);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--border);
}
.steps li i {
  width: 20px; height: 20px; border-radius: var(--r-full);
  background: var(--gray-200); color: var(--text-muted);
  display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: var(--fw-semibold);
}
.steps li.is-active { color: var(--brand-700); border-color: var(--brand-600); font-weight: var(--fw-semibold); }
.steps li.is-active i { background: var(--brand-600); color: #fff; }
.steps li.is-done { color: var(--success); border-color: var(--success); }
.steps li.is-done i { background: var(--success); color: #fff; }

/* ---------------- 表单面板 ---------------- */
.pane__title { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.pane__desc { font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-relaxed); margin-bottom: var(--sp-5); }
.pane__actions { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-6); }
.pane__actions--end { justify-content: flex-end; }

.field { display: block; margin-bottom: var(--sp-4); }
.field__label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-base); margin-bottom: var(--sp-2); }
.field__hint { display: block; font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--sp-2); line-height: var(--lh-snug); }
.field__row { display: flex; gap: var(--sp-2); align-items: stretch; }
.field__row .input { flex: 1; min-width: 0; }
.field__row .btn { flex: 0 0 auto; white-space: nowrap; }

.input--code {
  font-family: var(--font-mono); font-size: var(--fs-2xl);
  letter-spacing: 0.32em; text-align: center; font-weight: var(--fw-semibold);
  padding: var(--sp-4); text-transform: uppercase;
}

/* ---------------- 身份卡 ---------------- */
.idcard {
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; margin: var(--sp-4) 0 var(--sp-5); background: var(--bg-subtle);
}
.idcard__row {
  display: flex; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border);
}
.idcard__row:last-child { border-bottom: none; }
.idcard__row span { color: var(--text-muted); flex: 0 0 auto; }
.idcard__row b { color: var(--text-strong); text-align: right; word-break: break-all; }
.mono { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: var(--fw-regular); }

/* ---------------- 头像 ---------------- */
.avatar-picker { display: flex; gap: var(--sp-6); align-items: center; margin: var(--sp-5) 0; }
.avatar-preview {
  width: 116px; height: 116px; flex: 0 0 auto; border-radius: var(--r-full);
  border: 2px dashed var(--border-strong); background: var(--gray-50);
  display: grid; place-items: center; overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-preview span { font-size: var(--fs-3xl); color: var(--text-faint); }
.avatar-preview.is-set { border-style: solid; border-color: var(--brand-200); }
.avatar-preview--sm { width: 56px; height: 56px; }
.avatar-picker__side { display: grid; gap: var(--sp-3); }

/* ---------------- 个人档案 ---------------- */
.profile-card__head { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.profile-card__foot { margin-top: var(--sp-5); }
.auth-split {
  display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-5) 0; color: var(--text-faint); font-size: var(--fs-xs);
}
.auth-split::before, .auth-split::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: flex; justify-content: center; margin-top: var(--sp-5); }
.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brand-600); font-size: var(--fs-sm); text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--brand-700); }

/* ============================================================
   排行榜
   ============================================================ */
.lb-shell { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-md); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lb-tabs { display: flex; gap: var(--sp-1); background: var(--gray-100); padding: 4px; border-radius: var(--r-full); }
.lb-tabs button {
  border: none; background: none; cursor: pointer; padding: 7px 16px;
  border-radius: var(--r-full); font-size: var(--fs-sm); color: var(--text-muted);
  font-family: inherit; transition: var(--t-fast); white-space: nowrap;
}
.lb-tabs button.is-active { background: var(--bg-surface); color: var(--brand-700); font-weight: var(--fw-semibold); box-shadow: var(--sh-sm); }
.lb-cls { display: flex; align-items: center; gap: var(--sp-2); }
.lb-cls select {
  font-family: inherit; font-size: var(--fs-sm); padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-surface); color: var(--text-base); cursor: pointer;
}
.lb-body { padding: var(--sp-2) 0 var(--sp-4); }
.lb-row {
  display: grid; grid-template-columns: 52px 44px minmax(0, 1fr) auto;
  align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-6);
  border-left: 3px solid transparent;
}
.lb-row + .lb-row { border-top: 1px solid var(--gray-150); }
.lb-row.is-me { background: var(--brand-50); border-left-color: var(--brand-600); }
.lb-rank { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-faint); text-align: center; font-variant-numeric: tabular-nums; }
.lb-row--1 .lb-rank { color: #d97706; }
.lb-row--2 .lb-rank { color: #64748b; }
.lb-row--3 .lb-rank { color: #b45309; }
.lb-av { width: 40px; height: 40px; border-radius: var(--r-full); object-fit: cover; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-700); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.lb-name { min-width: 0; }
.lb-name b { display: block; font-size: var(--fs-base); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name span { font-size: var(--fs-xs); color: var(--text-faint); }
.lb-val { text-align: right; font-variant-numeric: tabular-nums; }
.lb-val b { display: block; font-size: var(--fs-lg); color: var(--brand-700); font-weight: var(--fw-bold); }
.lb-val span { font-size: var(--fs-xs); color: var(--text-muted); }
.lb-meter { grid-column: 2 / -1; height: 4px; border-radius: var(--r-full); background: var(--gray-150); overflow: hidden; margin-top: -4px; }
.lb-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: var(--r-full); }
.lb-empty { padding: var(--sp-10) var(--sp-6); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.lb-foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }

/* ============================================================
   作文评分
   ============================================================ */
.ai-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.ai-bar select { font-family: inherit; font-size: var(--fs-sm); padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-surface); color: var(--text-base); max-width: 260px; }
.ai-hint { font-size: var(--fs-xs); color: var(--text-faint); }

.report { margin-top: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-surface); }
.report__head { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-6); background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); color: #fff; }
.report__band { font-size: 3rem; font-weight: var(--fw-bold); line-height: 1; letter-spacing: -0.03em; }
.report__band small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); opacity: .85; letter-spacing: 0; margin-top: var(--sp-2); }
.report__sum { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-relaxed); }

.rubric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.rubric-cell { background: var(--bg-surface); padding: var(--sp-5); }
.rubric-cell__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.rubric-cell__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.rubric-cell__name em { font-style: normal; color: var(--text-faint); font-weight: var(--fw-regular); font-size: var(--fs-xs); margin-left: var(--sp-2); }
.rubric-cell__band { font-size: var(--fs-2xl); font-weight: var(--fw-bold); color: var(--brand-600); font-variant-numeric: tabular-nums; }
.rubric-cell__why { font-size: var(--fs-sm); color: var(--text-base); line-height: var(--lh-relaxed); }
.rubric-cell__fix { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--border); font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.rubric-cell__fix b { color: var(--brand-700); }

.report__sec { padding: var(--sp-6); border-top: 1px solid var(--border); }
.report__sec h4 { font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.fix-row { padding: var(--sp-4) 0; border-bottom: 1px dashed var(--border); }
.fix-row:last-child { border-bottom: none; }
.fix-row__tag { display: inline-block; font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-full); background: var(--warning-soft); color: #92400e; margin-bottom: var(--sp-2); }
.fix-line { display: flex; gap: var(--sp-3); font-size: var(--fs-sm); line-height: var(--lh-relaxed); margin-top: var(--sp-2); }
.fix-line i { font-style: normal; flex: 0 0 20px; font-weight: var(--fw-semibold); }
.fix-line--from { color: #b91c1c; }
.fix-line--to { color: #047857; }
.fix-why { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-2); padding-left: 32px; }
.upg-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.upg-table td { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--gray-150); vertical-align: top; }
.upg-table td:first-child { color: var(--text-muted); width: 34%; }
.upg-table td:nth-child(2) { color: var(--brand-700); font-weight: var(--fw-medium); }
.upg-table td:last-child { color: var(--text-faint); font-size: var(--fs-xs); }
.report__list { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.report__list li { padding-left: var(--sp-6); position: relative; font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.report__list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: var(--fw-bold); }
.report__list--step li::before { content: "→"; color: var(--brand-500); }
.report__foot { padding: var(--sp-4) var(--sp-6); background: var(--bg-subtle); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-faint); }
.ai-stream { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); padding: var(--sp-4); background: var(--gray-50); border-radius: var(--r-md); margin-top: var(--sp-4); max-height: 140px; overflow: auto; white-space: pre-wrap; line-height: var(--lh-snug); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
  .auth-panel { position: static; }
  .auth-intro__title { font-size: var(--fs-3xl); }
  .rubric-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .auth-panel { padding: var(--sp-5); }
  .lb-row { grid-template-columns: 40px 36px minmax(0, 1fr) auto; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .avatar-picker { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .steps li { font-size: 10px; gap: 4px; }
  .report__head { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}
