/* ============================================================
 * 猿人学 · 爬虫逆向简历评测
 * 品牌橙 #ff6b00 管品牌与引导；红黄绿管评价语义
 *
 * 字体：全站单一字体族。数字靠 tabular-nums 取得对齐效果，
 * 不再切换等宽字体族——等宽字体没有中文字形，一旦混排就会
 * 在同一行里出现两种字体，是「字体不一致」的主要来源。
 * 字号只用 --fs-* 六档，字重只用 400 / 700
 * （微软雅黑没有 500/600/800，浏览器会合成伪粗体，发虚）。
 * ============================================================ */
:root {
  --orange: #ff6b00;
  --orange-deep: #e85f00;
  --orange-light: #fff3e9;
  --green: #16a34a;
  --green-bg: #e8f7ee;
  --yellow: #d97706;
  --yellow-bg: #fdf3e3;
  --red: #dc2626;
  --red-bg: #fdecec;
  --ink: #1f2329;
  --sub: #646a73;
  --mute: #a6abb3;
  --line: #e8eaed;
  --bg: #f7f8fa;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-hero: 28px;
  --fs-score: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#e7eaee 1px, transparent 1px);
  background-size: 24px 24px;
}
button, input, textarea { font-family: inherit; font-variant-numeric: inherit; }

.container { max-width: 1240px; margin: 0 auto; padding: 32px 24px 60px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
/* .brand 是 <a>，去掉链接默认样式，让它看起来和原来一样、但可点击回首页 */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; object-fit: cover;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-size: var(--fs-lg); font-weight: 700; color: var(--orange); letter-spacing: 1px; }
.brand-sub { font-size: var(--fs-xs); color: var(--sub); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-badge {
  font-size: var(--fs-xs); color: var(--orange);
  background: var(--orange-light);
  border: 1px solid rgba(255, 107, 0, 0.25);
  padding: 4px 12px; border-radius: 999px;
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.chip-user { color: var(--ink); font-weight: 700; }
.chip-quota { color: var(--sub); }
.chip-quota b { color: var(--orange); }
.chip-login {
  font-size: var(--fs-sm); font-weight: 700; color: #fff;
  background: #07c160; border: none; cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
}
.chip-login:hover { filter: brightness(1.05); }
.chip-logout {
  font-size: var(--fs-xs); color: var(--sub); background: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; cursor: pointer;
}
.chip-logout:hover { color: var(--red); border-color: var(--red); }
.chip-history {
  font-size: var(--fs-sm); font-weight: 700; color: var(--sub);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
}
.chip-history:hover { color: var(--orange); border-color: var(--orange); }

/* ---------------- 视图切换动画 ---------------- */
.view { animation: fadeUp 0.45s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- 输入态 ---------------- */
.hero { text-align: center; padding: 36px 0 6px; }
.hero h1 { font-size: var(--fs-hero); font-weight: 700; line-height: 1.3; margin: 0 0 12px; letter-spacing: 0.5px; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero p { color: var(--sub); font-size: var(--fs-md); margin: 0; }
.hero-note { color: var(--orange) !important; font-size: var(--fs-sm) !important; margin-top: 8px !important; }

.sample-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px; margin: 26px 0 20px;
}
.sample-label { font-size: var(--fs-sm); color: var(--sub); }
.sample-chip {
  font-size: var(--fs-sm); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; transition: all 0.18s ease;
}
.sample-chip:hover {
  color: var(--orange); border-color: var(--orange);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15);
}

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 26px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card-title {
  font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-sub { font-size: var(--fs-xs); color: var(--mute); margin: -12px 0 12px; }

.input-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.input-card textarea {
  width: 100%; height: 250px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: var(--fs-md); line-height: 1.7;
  color: var(--ink); resize: vertical; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input-card textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}
.input-card textarea.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.upload-card {
  position: relative; border: 1.5px dashed #d9dce1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; cursor: pointer; transition: all 0.2s ease;
}
.upload-card:hover { border-color: var(--orange); background: #fffaf5; }
.upload-tag {
  position: absolute; top: 12px; right: 12px;
  font-size: var(--fs-xs); color: var(--orange); background: var(--orange-light);
  padding: 3px 9px; border-radius: 999px;
}
.upload-icon { font-size: 36px; }
.upload-title { font-size: var(--fs-lg); font-weight: 700; }
.upload-sub { font-size: var(--fs-xs); color: var(--sub); }
.upload-hint { color: var(--orange); }

.btn-primary {
  display: block; margin: 26px auto 0;
  padding: 14px 52px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #ff8a33, var(--orange));
  color: #fff; font-size: var(--fs-lg); font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255, 107, 0, 0.42); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 26px; font-size: var(--fs-md); color: var(--sub); cursor: pointer;
  transition: all 0.18s ease;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 6px 16px !important; font-size: var(--fs-sm) !important; }

.error-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 16px auto 0; max-width: 680px;
  background: var(--red-bg); color: var(--red);
  border: 2px solid rgba(220, 38, 38, 0.55);
  border-radius: 12px; padding: 14px 20px;
  font-size: var(--fs-lg); font-weight: 700; line-height: 1.5;
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.16);
}
/* ⚠ 图标：让「过短」这类提示一眼就是个警告，而不是一行不起眼的红字。
   有用户反馈原来的报错条看不见，故加大字号 + 描边 + 图标 + 入场脉冲。 */
.error-bar::before {
  content: "⚠"; flex: none; font-size: 1.3em; line-height: 1;
}
.error-bar.flash { animation: err-flash 0.9s ease; }
@keyframes err-flash {
  0%   { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  40%  { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1);    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.16); }
}
.quota-line { text-align: center; font-size: var(--fs-sm); color: var(--sub); margin-top: 10px; }

/* 全站余量。满格时只是一行灰字，低于 20% 才变橙——
   稀缺提示在不稀缺的时候强调，只会变成噪声。 */
.site-line { text-align: center; font-size: var(--fs-xs); color: var(--mute); margin-top: 4px; }
.site-line.low { color: var(--orange); font-weight: 600; }

/* ---------------- 隐私声明 ----------------
   放在输入框正下方而不是页脚：用户是在「要不要把简历粘进去」这一刻
   需要这条信息的，翻到页脚才看见等于没有。 */
.privacy-note {
  display: flex; gap: 10px; align-items: flex-start;
  max-width: 900px; margin: 14px auto 0; padding: 12px 16px;
  background: var(--green-bg);
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 10px;
  font-size: var(--fs-sm); color: var(--ink); line-height: 1.7;
}
.privacy-ico { flex: none; font-size: var(--fs-lg); line-height: 1.5; }
.privacy-body b { color: var(--green); }
.privacy-sub {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed rgba(22, 163, 74, 0.25);
  font-size: var(--fs-xs); color: var(--sub);
}

/* ---------------- 分析态 ---------------- */
.analyze-card { max-width: 560px; margin: 56px auto 0; padding: 28px 30px; }
.analyze-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px dashed var(--line);
}
.analyze-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.analyze-title { font-size: var(--fs-lg); font-weight: 700; }
.dots::after {
  display: inline-block; width: 18px; text-align: left;
  content: ''; animation: dots 1.2s steps(1, end) infinite;
}
@keyframes dots {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
.analyze-sub { font-size: var(--fs-sm); color: var(--sub); margin-top: 4px; }
.step-list { list-style: none; margin: 8px 0 0; padding: 0; }
.step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; font-size: var(--fs-md); color: #b3b8bf;
  border-bottom: 1px dashed #f3f4f6;
}
.step:last-child { border-bottom: none; }
.step.active, .step.done { color: var(--ink); }
.step-icon {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); border: 2px solid #e3e5e9;
}
.step.active .step-icon {
  border-color: rgba(255, 107, 0, 0.2);
  border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}
.step.done .step-icon {
  border: none; background: var(--green-bg);
  color: var(--green); font-weight: 700;
}
@keyframes spin { to { transform: rotate(360deg); } }
.step-note { margin-left: auto; font-size: var(--fs-xs); color: var(--sub); }
.analyze-bar {
  height: 6px; background: #f0f1f3; border-radius: 999px;
  overflow: hidden; margin-top: 22px;
}
.analyze-bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #ff8a33, var(--orange));
  transition: width 0.5s ease;
}

/* ================= 结果态 ================= */
/* 语义色：红黄绿。阈值对齐段位线（65 = A 资深，40 略高于 C 初级） */
.band-green  { color: var(--green); }
.band-yellow { color: var(--yellow); }
.band-red    { color: var(--red); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.fill-green  { background: linear-gradient(90deg, #34d399, #16a34a); }
.fill-yellow { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.fill-red    { background: linear-gradient(90deg, #f87171, #dc2626); }

/* ---- 综合评分条：上排分数/段位/标尺横向铺开，下排总评独占整行 ---- */
.score-bar { padding: 28px 32px; margin-bottom: 20px; }
.score-top { display: flex; align-items: center; gap: 48px; }
.score-main { text-align: center; }
/* 区间比单个整数宽一倍，字号相应下调，否则在窄屏上会把段位挤下去 */
.score-num { font-size: 40px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.score-note { font-size: var(--fs-xs); color: var(--mute); margin-top: 4px; max-width: 190px; }
.score-label { font-size: var(--fs-xs); color: var(--sub); letter-spacing: 2px; margin-top: 4px; }
.score-grade {
  text-align: center; padding: 0 40px;
  border-left: 1px dashed var(--line); border-right: 1px dashed var(--line);
}
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  font-size: 36px; font-weight: 800; line-height: 1;
}
.grade-label { font-size: var(--fs-sm); color: var(--sub); margin-top: 10px; }
.score-scale { margin-left: auto; text-align: right; }

/* 段位标尺：D—C—B—[A]—S，高亮当前档，替代一切文字解释 */
.grade-scale { display: flex; align-items: center; justify-content: flex-end; }
.gs-item {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-md); color: #b9bec5; background: #f4f5f7;
  transition: all 0.3s ease;
}
.gs-on { color: #fff; font-weight: 700; transform: scale(1.18); }
.gs-green  { background: var(--green); }
.gs-yellow { background: var(--yellow); }
.gs-red    { background: var(--red); }
/* 压线时相邻档的弱高亮：只上色不放大，表示「够得着但没到」 */
.gs-near { font-weight: 700; }
.gsn-green  { color: var(--green);  background: var(--green-bg); }
.gsn-yellow { color: var(--yellow); background: var(--yellow-bg); }
.gsn-red    { color: var(--red);    background: var(--red-bg); }
.gs-line { width: 20px; height: 2px; background: var(--line); }

.grade-edge { margin-top: 10px; font-size: var(--fs-xs); color: var(--sub); }

.primary-track {
  display: inline-block; margin-top: 12px;
  font-size: var(--fs-xs); color: var(--orange);
  background: var(--orange-light); border: 1px solid rgba(255, 107, 0, 0.25);
  padding: 3px 14px; border-radius: 999px;
}
.primary-track b { font-weight: 700; }

/* 打败百分比：填「评分」与「段位」之间的空隙，做成与两侧并列的一列战绩。
   竖排居中——大号橙色百分比是主角，下面一行小字说明，读起来像第三个统计量。 */
.score-beat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; white-space: nowrap;
}
.score-beat-num b { font-size: 34px; font-weight: 700; color: var(--orange); line-height: 1.1; }
.score-beat-label { font-size: var(--fs-xs); color: var(--sub); }
.score-summary {
  font-size: var(--fs-md); color: var(--sub); margin: 22px 0 0;
  padding-top: 20px; border-top: 1px dashed var(--line);
}

.penalty-bar {
  margin-bottom: 20px; padding: 13px 20px;
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-left: 4px solid var(--red);
  border-radius: 10px; font-size: var(--fs-md);
}

/* ---- 双雷达：图形本就紧凑，并排 ---- */
.radar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.radar-box { width: 100%; height: 360px; }
.group-score { font-size: var(--fs-xl); font-weight: 700; }
.radar-fallback { color: var(--sub); font-size: var(--fs-sm); text-align: center; padding: 150px 0; }

/* ---- 双明细：文字要宽度，各自独占整行 ---- */
.detail-stack { display: grid; gap: 20px; margin-bottom: 20px; }
/* 主信息一行铺满（进度条能占到 ~700px），原文依据折到第二行 */
.dim-row {
  display: grid; grid-template-columns: 116px 216px 1fr 44px;
  align-items: center; gap: 18px;
  padding: 13px 0; border-bottom: 1px dashed #f3f4f6;
}
.dim-row:last-child { border-bottom: none; }
.dim-name { font-size: var(--fs-md); font-weight: 700; }
.dim-desc { font-size: var(--fs-xs); color: var(--mute); }
.dim-level { font-size: var(--fs-sm); font-weight: 700; text-align: right; white-space: nowrap; }
.dim-bar-track { height: 10px; background: #f0f1f3; border-radius: 999px; overflow: hidden; }
.dim-bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* 简历原文依据：引文样式，与说明区分 */
.dim-ev {
  grid-column: 2 / -1; margin-top: -4px;
  font-size: var(--fs-sm); color: var(--sub); line-height: 1.65;
  padding-left: 10px; border-left: 2px solid #eceef1;
}

/* ---- 技能标签墙 ---- */
.tags-card { margin-bottom: 20px; }
.tag-legend { font-size: var(--fs-xs); font-weight: 400; color: var(--sub); }
.lg {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 3px; margin: 0 4px 0 12px; vertical-align: -1px;
}
.lg-green  { background: var(--green); }
.lg-yellow { background: #f59e0b; }
.lg-red    { background: var(--red); }
.tag {
  display: inline-block; padding: 6px 13px; border-radius: 999px;
  font-size: var(--fs-sm); margin: 0 8px 10px 0;
  animation: popIn 0.35s ease both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.tag-hit     { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(22, 163, 74, 0.25); }
.tag-weak    { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(217, 119, 6, 0.25); }
.tag-missing { background: var(--red-bg);    color: var(--red);    border: 1px dashed rgba(220, 38, 38, 0.35); }

/* ---- 亮点 / 风险点 / 面试题 ---- */
.hl-risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.green-title { color: var(--green); }
.red-title   { color: var(--red); }
.mark-list { list-style: none; margin: 0; padding: 0; }
.mark-list li {
  display: flex; gap: 10px; padding: 8px 0;
  font-size: var(--fs-md); border-bottom: 1px dashed #f0f1f3;
}
.mark-list li:last-child { border-bottom: none; }
.hl-card .li-mark   { color: var(--green); }
.risk-card .li-mark { color: var(--red); }

/* ---- 简历硬伤 ---- */
.flag-card { margin-bottom: 20px; }
.flag-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px dashed #f0f1f3;
}
.flag-item:last-child { border-bottom: none; }
/* 严重度徽标定宽：三档文字都是两个汉字，对齐后一列扫下来就能看出轻重 */
.flag-sev {
  flex: none; width: 40px; text-align: center;
  font-size: var(--fs-xs); font-weight: 700;
  padding: 3px 0; border-radius: 6px; margin-top: 2px;
}
.sev-high { background: var(--red-bg);    color: var(--red); }
.sev-mid  { background: var(--yellow-bg); color: var(--yellow); }
.sev-low  { background: #f1f3f5;          color: var(--sub); }
.flag-body { flex: 1; min-width: 0; }
.flag-title  { font-size: var(--fs-md); font-weight: 700; }
.flag-detail { font-size: var(--fs-sm); color: var(--sub); line-height: 1.65; margin-top: 2px; }
/* 改法用左边框拎出来：这是整块里唯一可执行的部分，不该和描述混在一起 */
.flag-fix {
  margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--green);
  font-size: var(--fs-sm); color: var(--green); line-height: 1.6;
}

/* ---- 静态自查清单（这三项服务端看不到） ---- */
.selfcheck-card { margin-bottom: 20px; background: #fbfcfd; }
.selfcheck { list-style: none; margin: 0; padding: 0; }
.selfcheck li {
  padding: 8px 0 8px 22px; position: relative;
  font-size: var(--fs-md); line-height: 1.7; border-bottom: 1px dashed #f0f1f3;
}
.selfcheck li:last-child { border-bottom: none; }
.selfcheck li::before {
  content: '☐'; position: absolute; left: 0; top: 8px; color: var(--mute);
}
.selfcheck-note {
  margin: 12px 0 0; font-size: var(--fs-xs); color: var(--mute); line-height: 1.7;
}

.iv-card { margin-bottom: 20px; }
.iv-card ol { list-style: none; margin: 0; padding: 0; counter-reset: iv; }
.iv-card li {
  counter-increment: iv;
  display: flex; gap: 12px; padding: 9px 0;
  font-size: var(--fs-md); border-bottom: 1px dashed #f0f1f3;
}
.iv-card li:last-child { border-bottom: none; }
.iv-card li::before {
  content: counter(iv, decimal-leading-zero);
  color: var(--orange); font-weight: 700;
}

/* ---- 加群二维码 ---- */
.qr-card { margin-bottom: 20px; }
.qr-join { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.qr-join-img {
  width: 180px; height: auto; flex: none;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.qr-join-text { flex: 1; min-width: 200px; }
.qr-join-lead { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.qr-join-note { margin: 0; font-size: var(--fs-md); color: var(--sub); line-height: 1.8; }
.qr-join-note b { color: var(--orange); }

/* ---- 分享链接 ---- */
/* 新标签 ?run=1 自动评测：首帧就藏输入态、露加载态（app.js 拿到控制权后移除 .run-pending） */
.run-pending #view-input { display: none !important; }
.run-pending #view-loading { display: block !important; }

/* 分享页加载态：与二维码转圈复用同一套 @keyframes qr-spin */
.loading-card { text-align: center; padding: 64px 24px; }
.loading-spin {
  width: 42px; height: 42px; margin: 0 auto 16px;
  border: 4px solid var(--line); border-top-color: var(--orange);
  border-radius: 50%; animation: qr-spin 0.8s linear infinite;
}
.loading-text { color: var(--sub); font-size: var(--fs-md); }

.share-card { margin-bottom: 20px; }
.share-lead { margin: 4px 0 16px; font-size: var(--fs-md); color: var(--sub); line-height: 1.6; }
/* 明显的主分享按钮：撑满卡片、取代原来的小 ghost 按钮；下面的输入框留作手动复制的兜底 */
.btn-share { width: 100%; margin: 0 0 14px; padding: 15px 24px; }
/* 分享页里给访客的「也给自己打分」按钮：裂变回路的入口，做成主按钮 */
.btn-own-cta { text-decoration: none; min-width: 260px; }
.share-row { display: flex; gap: 12px; align-items: center; }
.share-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: var(--fs-sm); color: var(--sub);
  background: var(--bg); outline: none;
}
.share-input:focus { border-color: var(--orange); color: var(--ink); }
.share-note { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--mute); }
.result-actions .btn-ghost { text-decoration: none; display: inline-block; }

.result-actions { text-align: center; margin-top: 26px; }

/* ---------------- 登录弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 35, 41, 0.45);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative; width: 340px;
  background: #fff; border-radius: 16px;
  padding: 28px 28px 24px; text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  font-size: 22px; line-height: 1; color: var(--sub);
  background: none; border: none; cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.modal-sub { font-size: var(--fs-sm); color: var(--sub); margin: 8px 0 16px; }
.modal-sub b { color: var(--orange); }
.qr-box {
  position: relative; width: 200px; height: 200px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg);
}
.qr-box img { width: 100%; height: 100%; object-fit: cover; }
/* 加载转圈：不透明背景盖住空 img，二维码 onload 后由 JS 隐藏 */
.qr-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.qr-spinner::before {
  content: ''; width: 34px; height: 34px;
  border: 3px solid var(--line); border-top-color: var(--orange);
  border-radius: 50%; animation: qr-spin 0.8s linear infinite;
}
@keyframes qr-spin { to { transform: rotate(360deg); } }
.qr-mask {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92);
}
.modal-status { margin-top: 14px; font-size: var(--fs-sm); color: var(--sub); }

/* ---------------- 我的评测记录弹窗 ---------------- */
.history-card { width: 420px; max-width: 92vw; text-align: left; }
.history-list { margin-top: 16px; max-height: 60vh; overflow-y: auto; }
.history-empty { text-align: center; color: var(--mute); padding: 32px 0; font-size: var(--fs-sm); }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; border-bottom: 1px solid var(--line);
  text-decoration: none; transition: background 0.15s ease;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--bg); }
.hist-grade {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-md);
}
.hist-date { flex: 1; color: var(--ink); font-size: var(--fs-sm); }
.hist-open { color: var(--orange); font-size: var(--fs-sm); font-weight: 700; }

/* ---------------- 右下角悬浮加群卡片 ---------------- */
.join-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 208px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 14px 14px 12px; text-align: center;
  animation: join-float-in 0.35s ease both;
}
@keyframes join-float-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.join-float-close {
  position: absolute; top: 4px; right: 9px;
  font-size: 18px; line-height: 1; color: var(--mute);
  background: none; border: none; cursor: pointer;
}
.join-float-close:hover { color: var(--ink); }
.join-float-qr {
  width: 150px; height: auto; display: block; margin: 2px auto 8px;
  border-radius: 8px;
}
.join-float-text strong { display: block; font-size: var(--fs-sm); color: var(--ink); margin-bottom: 3px; }
.join-float-text p { margin: 0; font-size: var(--fs-xs); color: var(--sub); line-height: 1.6; }
.join-float-text em { font-style: normal; color: var(--orange); font-weight: 700; }

/* ---------------- 其他 ---------------- */
.footer { text-align: center; color: #9ca3af; font-size: var(--fs-xs); padding: 26px 16px 40px; }
.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%);
  background: #1f2329; color: #fff;
  padding: 11px 22px; border-radius: 999px;
  font-size: var(--fs-sm); z-index: 99;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.25s ease;
}

/* ---------------- 平板 / 小窗（≤900） ---------------- */
@media (max-width: 900px) {
  .container { padding: 24px 16px 48px; }
  .topbar-inner { padding: 10px 16px; }
  .hero { padding: 24px 0 4px; }
  .hero h1 { font-size: 22px; }
  .topbar-badge { display: none; }
  /* 悬浮卡在窄屏会压住内容与底部按钮，移动端不显示（报告内那份二维码仍在） */
  .join-float { display: none; }
  .card { padding: 20px; }
  .input-grid, .radar-grid, .hl-risk-grid { grid-template-columns: 1fr; }
  .upload-card { padding: 26px 20px; }
  .radar-box { height: 300px; }

  .score-bar { padding: 22px 20px; }
  .score-top { flex-wrap: wrap; gap: 24px; }
  .score-grade { border-right: none; padding: 0 0 0 24px; }
  .score-scale { margin-left: 0; text-align: left; flex-basis: 100%; }
  .grade-scale { justify-content: flex-start; }

  /* 明细收成两行：名称+分数 / 进度条 / 原文依据 */
  .dim-row { grid-template-columns: 1fr 44px; gap: 10px; }
  .dim-desc { display: none; }
  .dim-bar-track, .dim-ev { grid-column: 1 / -1; }
  .dim-ev { margin-top: 2px; padding-left: 0; border-left: none; }
}

/* ---------------- 手机（≤560）：进一步收紧，防拥挤 ----------------
   900 那档是「窄一点的桌面/平板」，到真手机（360–414px）还得再压一档：
   卡片内边距、字号、按钮宽度、综合评分块的竖排，都在这里定。 */
@media (max-width: 560px) {
  .container { padding: 18px 12px 40px; }
  .hero { padding: 20px 0 2px; }
  .hero h1 { font-size: 20px; line-height: 1.35; }
  .hero p { font-size: var(--fs-sm); }

  /* 顶栏：副标题在窄屏挤成两行，收起；logo 与按钮缩小，给标题让位 */
  .brand-sub { display: none; }
  .logo-img { width: 32px; height: 32px; }
  .brand-name { font-size: var(--fs-md); letter-spacing: 0.5px; }
  .topbar-right { gap: 6px; }
  .chip-history, .chip-login { padding: 5px 11px; font-size: var(--fs-xs); }

  .card { padding: 16px 14px; border-radius: 12px; }
  .card-title { font-size: var(--fs-md); flex-wrap: wrap; gap: 4px 10px; }
  .tag-legend { flex-basis: 100%; }
  .card-sub { margin: -8px 0 12px; }

  /* 主按钮整宽——手机上大拇指够得着、不会误触旁边 */
  .btn-primary { width: 100%; padding: 14px 20px; letter-spacing: 0.5px; }
  .input-card textarea { height: 200px; }

  /* 示例行：标签独占一行居中，chip 再换行 */
  .sample-row { gap: 8px; margin: 18px 0 14px; }
  .sample-label { flex-basis: 100%; text-align: center; }

  /* 综合评分块：三块横排在手机上必挤，改成竖排居中、去分隔线 */
  .score-bar { padding: 20px 16px; }
  .score-top { flex-direction: column; align-items: center; gap: 18px; text-align: center; }
  .score-main { text-align: center; }
  .score-note { max-width: none; }
  .score-num { font-size: 32px; }
  .score-grade { border-left: none; border-right: none; padding: 0; }
  .score-scale { margin-left: 0; text-align: center; flex-basis: auto; }
  .grade-scale { justify-content: center; }
  .grade-badge { width: 60px; height: 60px; font-size: 30px; }
  .score-summary { margin-top: 18px; padding-top: 16px; }

  .radar-box { height: 260px; }
  .group-score { font-size: var(--fs-lg); }

  /* 加群二维码：图与文竖排居中，不再左右挤 */
  .qr-join { justify-content: center; text-align: center; gap: 14px; }
  .qr-join-img { width: 160px; }
  .qr-join-text { min-width: 0; flex-basis: 100%; }

  /* 结果操作按钮竖排整宽，避免并排溢出 */
  .result-actions { margin-top: 20px; }
  .result-actions .btn-ghost,
  .result-actions .btn-own-cta { display: block; width: 100%; min-width: 0; margin: 10px auto 0; }

  /* 弹窗宽度自适应，别在 360 屏上贴边溢出 */
  .modal-card { width: auto; max-width: 92vw; margin: 0 12px; padding: 24px 20px 20px; }

  .footer { padding: 22px 12px 36px; }
}
