/* ==========================================================================
   课评助手 v2 · 设计系统
   基准：design.md 第 1 节「Course Feedback Mobile Web Design System / alpha」
   单列卡片布局 / 44px 触控 / 48px 主按钮 / 无 hover 依赖
   ========================================================================== */

:root {
  /* 颜色令牌 */
  --c-primary: #1677ff;
  --c-primary-weak: #e6f0ff;
  --c-primary-press: #0958d9;
  --c-bg: #f5f5f5;
  --c-surface: #ffffff;
  --c-text: rgba(0, 0, 0, 0.88);
  --c-text-2: rgba(0, 0, 0, 0.65);
  --c-text-3: rgba(0, 0, 0, 0.45);
  --c-border: #d9d9d9;
  --c-border-light: #f0f0f0;
  --c-success: #16a34a;
  --c-warning: #d97706;
  --c-danger: #dc2626;

  /* 尺寸令牌 */
  --nav-h: 44px;
  --tab-h: 56px;
  --gap: 16px;
  --radius-sm: 4px;
  --radius: 8px;
  --touch: 44px;
  --btn-h: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 全局兜底：本文件大量给元素设了 display，作者样式优先级高于浏览器默认的
   [hidden]{display:none}，会出现「JS 里 hidden=true，页面上照旧显示」的假隐藏。
   加 !important 让 hidden 属性永远生效——想显示就去掉属性，别改 display。 */
[hidden] { display: none !important; }

/* ---------- 启动遮罩 ---------- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--c-bg); z-index: 90; }
.boot__spinner { width: 26px; height: 26px; border: 2.5px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.boot__text { margin: 0; font-size: 14px; color: var(--c-text-3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 应用骨架 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  /* 三列固定网格：无论返回/更多按钮显示与否，标题都真正居中 */
  display: grid; grid-template-columns: var(--touch) 1fr var(--touch);
  align-items: center; gap: 4px;
  height: calc(var(--nav-h) + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border-light);
}
.topbar__title { grid-column: 2; margin: 0; font-size: 17px; font-weight: 600; text-align: center; line-height: var(--nav-h); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__icon { width: var(--touch); height: var(--touch); display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--c-text); cursor: pointer; border-radius: var(--radius-sm); }
.topbar__icon:active { background: var(--c-border-light); }
#nav-back { grid-column: 1; }
#nav-action { grid-column: 3; }

.view {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--gap) var(--gap) calc(var(--gap) + 24px);
  outline: none;
}
.view--padded { padding-bottom: calc(84px + var(--safe-bottom)); }

.tabbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border-light);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--c-text-3); font-size: 11px; }
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--c-primary); }

/* ---------- 卡片与文本 ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card__title { margin: 0; font-size: 15px; font-weight: 600; }
.card__extra { font-size: 13px; color: var(--c-primary); background: none; border: 0; padding: 0; cursor: pointer; }
.card__tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.card__tools .card__extra + .card__extra { border-left: 1px solid var(--c-border); padding-left: 12px; }
.card__note { margin: 8px 0 0; font-size: 12.5px; color: var(--c-text-3); line-height: 1.5; }
/* 记录详情里的「在家可以这样练」：和评语正文区分开，但不抢视线 */
.detail-tip { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--c-border); }
.detail-tip__label { display: block; font-size: 12px; color: var(--c-text-3); margin-bottom: 4px; }
.detail-tip__text { margin: 0; font-size: 14px; line-height: 1.7; color: var(--c-text); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 2px 8px; }
.section-title h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-title button { border: 0; background: none; color: var(--c-primary); font-size: 13px; cursor: pointer; padding: 4px 0; }
.section-title:first-child { margin-top: 4px; }

.muted { color: var(--c-text-3); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }

.empty { text-align: center; padding: 40px 16px; color: var(--c-text-3); font-size: 14px; }
.empty__icon { font-size: 30px; margin-bottom: 8px; }

/* 提示条 */
.notice { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.55; margin-bottom: 12px; }
.notice--info { background: var(--c-primary-weak); color: #0b4aa2; }
.notice--warn { background: #fff7e6; color: #91400a; }
.notice--danger { background: #fff1f0; color: #a8071a; }
.notice--ok { background: #f0fff4; color: #0d6b32; }
/* 提示条里要贴命令行时用：等宽、可横向滚动，别把整段挤成一条 */
.code-block {
  margin: 6px 0; padding: 8px 10px;
  background: rgba(0, 0, 0, .05); border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--touch); padding: 0 16px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text);
  font-size: 15px; font-family: inherit; cursor: pointer;
  transition: background-color 0.12s ease;
}
.btn:active { background: #f0f0f0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn--primary:active { background: var(--c-primary-press); border-color: var(--c-primary-press); }
.btn--danger { color: var(--c-danger); border-color: #ffccc7; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--c-primary); }
.btn--block { width: 100%; }
.btn--lg { min-height: var(--btn-h); font-size: 16px; font-weight: 500; }

/* 底部固定操作栏 */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px;
  max-width: 600px; margin: 0 auto;
  padding: 10px var(--gap) calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--c-border-light);
}
.actionbar .btn { flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 13px; color: var(--c-text-2); margin-bottom: 6px; }
.field__hint { font-size: 12px; color: var(--c-text-3); margin-top: 6px; line-height: 1.5; }
.field__error { font-size: 12px; color: var(--c-danger); margin-top: 6px; }

.input, .textarea, .select {
  width: 100%; min-height: var(--touch);
  padding: 10px 12px;
  font-size: 16px; font-family: inherit; line-height: 1.5;
  color: var(--c-text); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-weak); }
.textarea { min-height: 120px; resize: vertical; }
/* 评语框：尽量一屏看全，行距也放宽一点，方便逐句改 */
.textarea--comment { min-height: 340px; line-height: 1.75; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-3) 50%), linear-gradient(135deg, var(--c-text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* 搜索框 */
.search { position: relative; margin-bottom: 12px; }
.search .input { padding-left: 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--c-text-3); }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border-light);
  cursor: pointer;
}
.list__item:last-child { border-bottom: 0; }
.list__item:active { background: #fafafa; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: 12.5px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.list__side { font-size: 12.5px; color: var(--c-text-3); flex-shrink: 0; }

.avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--c-primary-weak); color: var(--c-primary);
  font-size: 15px; font-weight: 600;
}

.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; background: var(--c-border-light); color: var(--c-text-2); }
.tag--primary { background: var(--c-primary-weak); color: var(--c-primary); }

/* ---------- 首页入口卡 ---------- */
.entry { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 18px 16px; border: 1px solid var(--c-border-light); border-radius: var(--radius); background: var(--c-surface); margin-bottom: 12px; cursor: pointer; font-family: inherit; }
.entry:active { background: #fafafa; }
.entry__icon { width: 46px; height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 24px; background: var(--c-primary-weak); }
.entry__icon--art { background: #fff2e8; }
.entry__icon--period { background: #e8fff1; }
.entry__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry__title { font-size: 16px; font-weight: 600; color: var(--c-text); }
.entry__desc { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }
.entry__arrow { color: var(--c-text-3); flex-shrink: 0; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.steps__item { flex: 1; text-align: center; font-size: 12px; color: var(--c-text-3); }
.steps__item.is-active { color: var(--c-primary); font-weight: 600; }
.steps__item.is-done { color: var(--c-success); }
.steps__bar { height: 3px; border-radius: 2px; background: var(--c-border-light); margin-top: 6px; }
.steps__item.is-active .steps__bar, .steps__item.is-done .steps__bar { background: currentColor; }

/* ---------- 评分 ---------- */
.rate { border-bottom: 1px solid var(--c-border-light); padding: 12px 0; }
.rate:last-child { border-bottom: 0; }
.rate__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 3px; }
.rate__name { font-size: 14.5px; font-weight: 500; }
.rate__value { font-size: 12.5px; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.rate__desc { font-size: 12px; color: var(--c-text-3); margin-bottom: 8px; }
.rate__opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rate__opt {
  height: 36px; border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text-2);
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.rate__opt:active { background: #f0f0f0; }
.rate__opt.is-on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ---------- 点评方式切换 ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 76px; padding: 12px; text-align: left;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text);
  font-family: inherit; cursor: pointer;
}
.mode b { font-size: 14.5px; font-weight: 600; }
.mode span { font-size: 12px; color: var(--c-text-3); line-height: 1.45; }
.mode:active { background: #fafafa; }
.mode.is-on { border-color: var(--c-primary); background: var(--c-primary-weak); box-shadow: inset 0 0 0 1px var(--c-primary); }
.mode.is-on b { color: var(--c-primary); }

/* ---------- 评语风格（下拉框 + 下方介绍） ---------- */
.seg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-grid .btn { height: 40px; font-size: 13px; }
/* 方案数量不固定（用户可能在配置里加/减），列数按可用宽度自动排；
   名字长的（DeepSeek 官方）会折成两行，所以高度要放开、行距收紧，别硬裁 40px。 */
.seg-grid--auto { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
.seg-grid--auto .btn { height: auto; min-height: 40px; padding: 6px 8px; line-height: 1.3; }
.style-info {
  margin-top: 8px; padding: 10px 12px;
  background: var(--c-primary-weak); border-radius: var(--radius);
}
.style-info__desc { margin: 0; font-size: 13px; color: var(--c-text); line-height: 1.6; }
.style-info__meta { margin: 4px 0 0; font-size: 12px; color: var(--c-text-3); line-height: 1.5; }

/* ---------- 行为点选 ---------- */
.switch-row { display: flex; align-items: center; gap: 8px; min-height: var(--touch); margin-top: 6px; font-size: 14px; color: var(--c-text-2); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--c-primary); }
.bh-filter { display: flex; gap: 8px; margin-top: 12px; }
.bh-filter .btn { flex: 1; height: 38px; font-size: 13px; }
.bh-group { padding: 14px 0; border-bottom: 1px solid var(--c-border-light); }
.bh-group:last-child { border-bottom: 0; padding-bottom: 0; }
.bh-group__name { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + .chips { margin-top: 8px; }
/* 点选页用两列网格，避免一条一行拉得过长；文案长的自己折成两行 */
.bh-group .chips { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 7px 12px;
  border: 1px solid var(--c-border); border-radius: 10px;
  background: var(--c-surface); color: var(--c-text-2);
  font-size: 12.5px; line-height: 1.4; font-family: inherit; text-align: left; cursor: pointer;
}
.chip:active { transform: scale(0.98); }
.chip--good.is-on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.chip--bad.is-on { background: var(--c-warning); border-color: var(--c-warning); color: #fff; }
.chip.is-static { cursor: default; }
.chip.is-static.chip--good { background: var(--c-primary-weak); border-color: transparent; color: var(--c-primary); }
.chip.is-static.chip--bad { background: #fff7e6; border-color: transparent; color: #b45309; }

/* ---------- 图片上传 ---------- */
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 180px; padding: 20px;
  border: 1.5px dashed var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text-3); font-size: 14px; cursor: pointer;
}
.upload:active { background: #fafafa; }
.upload__icon { font-size: 30px; }
.preview { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border-light); background: #000; }
.preview img { display: block; width: 100%; max-height: 46vh; object-fit: contain; }
.preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--c-surface); font-size: 12.5px; color: var(--c-text-3); }

/* ---------- 结果区 ---------- */
.radar-wrap { display: flex; justify-content: center; padding: 4px 0 8px; }
.radar-wrap canvas { max-width: 100%; height: auto; }

.result-field { padding: 12px 0; border-bottom: 1px solid var(--c-border-light); }
.result-field:last-child { border-bottom: 0; }
.result-field__label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--c-text-2); margin-bottom: 6px; }
.result-field__label span:last-child { color: var(--c-text-3); font-size: 12px; }

.score-badge { display: inline-flex; align-items: baseline; gap: 4px; }
.score-badge b { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-badge i { font-style: normal; font-size: 13px; color: var(--c-text-3); }

/* ---------- 弹层 ---------- */
.layer { position: fixed; inset: 0; z-index: 60; display: none; }
.layer.is-open { display: block; }
.layer__mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 600px; margin: 0 auto;
  max-height: 86vh; display: flex; flex-direction: column;
  background: var(--c-surface);
  border-radius: 14px 14px 0 0;
  padding-bottom: var(--safe-bottom);
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.sheet__head { display: flex; align-items: center; gap: 8px; padding: 14px var(--gap); border-bottom: 1px solid var(--c-border-light); }
.sheet__title { flex: 1; margin: 0; font-size: 16px; font-weight: 600; }
.sheet__body { padding: var(--gap); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot { display: flex; gap: 10px; padding: 12px var(--gap); border-top: 1px solid var(--c-border-light); }
.sheet__foot .btn { flex: 1; }

.dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(84vw, 340px);
  background: var(--c-surface); border-radius: 10px; padding: 20px 18px 14px;
  animation: dialog-in 0.16s ease-out;
}
@keyframes dialog-in { from { transform: translate(-50%, -46%); opacity: 0.5; } to { transform: translate(-50%, -50%); opacity: 1; } }
.dialog__title { margin: 0 0 8px; font-size: 16px; font-weight: 600; text-align: center; }
.dialog__text { margin: 0 0 16px; font-size: 14px; color: var(--c-text-2); text-align: center; line-height: 1.6; }
.dialog__actions { display: flex; gap: 10px; }
.dialog__actions .btn { flex: 1; }

/* ---------- Loading ---------- */
.loading { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(2px); }
.loading.is-open { display: flex; }
.loading__spinner { width: 28px; height: 28px; border: 2.5px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loading__text { font-size: 13.5px; color: var(--c-text-2); }

/* ---------- Toast ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(84px + var(--safe-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 80vw; padding: 9px 16px; border-radius: 20px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 13.5px; line-height: 1.5; text-align: center; animation: toast-in 0.16s ease-out; }
.toast--ok { background: rgba(22, 163, 74, 0.92); }
.toast--err { background: rgba(220, 38, 38, 0.92); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 登录页 ---------- */
.login { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; gap: 6px; max-width: 420px; margin: 0 auto; }
.login__brand { text-align: center; margin-bottom: 22px; }
.login__logo { width: 62px; height: 62px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--c-primary); color: #fff; font-size: 28px; }
.login__name { margin: 0; font-size: 22px; font-weight: 600; }
.login__sub { margin: 4px 0 0; font-size: 13.5px; color: var(--c-text-3); }
.login__form { background: var(--c-surface); border: 1px solid var(--c-border-light); border-radius: var(--radius); padding: 18px 16px; }
.login__foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--c-text-3); }

/* ---------- 设置页 ---------- */
.setting-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--c-border-light); }
.setting-row:last-child { border-bottom: 0; }
.setting-row__label { flex: 1; font-size: 15px; }
.setting-row__value { font-size: 13.5px; color: var(--c-text-3); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 进度条 ---------- */
.progress { height: 4px; border-radius: 2px; background: var(--c-border-light); overflow: hidden; margin-top: 8px; }
.progress__bar { height: 100%; background: var(--c-primary); transition: width 0.2s ease; }

/* ---------- AI 生成状态条 ---------- */
.ai-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 7px 10px; border-radius: 6px;
  font-size: 12.5px; line-height: 1.5;
  background: var(--c-border-light); color: var(--c-text-2);
}
.ai-bar--loading { background: #f0f7ff; color: var(--c-primary); }
.ai-bar--done { background: #eefaf1; color: #15803d; }
.ai-bar--fail { background: #fff7e6; color: #b45309; }
.ai-bar--off { background: #fafafa; color: var(--c-text-3); }
.ai-bar--skip { background: #f5f5f5; color: var(--c-text-2); }
/* 「用 AI 这版」是个正向操作，别跟着灰色文字一起沉下去 */
.ai-bar--skip .ai-bar__btn { color: var(--c-primary); }
.ai-bar--nodeploy { background: #fafafa; color: var(--c-text-3); }
.ai-bar__text { flex: 1; min-width: 0; }
.ai-bar__btn {
  flex-shrink: 0; padding: 2px 9px; border-radius: 12px;
  border: 1px solid currentColor; background: var(--c-surface); color: inherit;
  font-size: 12px; font-family: inherit; cursor: pointer;
}
.ai-dot {
  width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%;
  background: currentColor; animation: ai-pulse 1.1s ease-in-out infinite;
}
@keyframes ai-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 359px) {
  :root { --gap: 12px; }
  .rate__opts { gap: 5px; }
  .rate__opt { font-size: 15px; }
  .entry__icon { width: 40px; height: 40px; font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

@media print { .topbar, .tabbar, .actionbar { display: none; } }
