/* B1-A 整站外壳样式（对照原型 app/apps/prototype/app-v4/index.html 的 .tabbar/.line-card/.filters/.me-* 移植）。
 * 只管外壳四页（创作 / 作品 / 我的 / 口播剪辑入口）+ 底部 Tab 栏；作业页、上传组件行为一概不碰。
 * 色值对齐原型截图：深底 #0f1115、选中黄 #f5c451（不走产品蓝 --accent，任务包要求视觉贴原型）。
 * 分隔线以上为通用外壳，以下为各页片段。 */

:root {
  --sh-accent: #f5c451;
  --sh-c-clip: #f5c451;
  --sh-c-viral: #ff7b9c;
  --sh-c-drama: #8db4ff;
  --sh-danger: #ff7b6e;
  --sh-tab-h: calc(58px + env(safe-area-inset-bottom, 0px));
}

/* —— 底部 Tab 栏（固定视口底，安全区内衬） —— */
#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--sh-tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#tabbar[hidden] { display: none !important; }
#tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  padding: 6px 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}
#tabbar button .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#tabbar button[aria-selected="true"] { color: var(--sh-accent); font-weight: 700; }
#tabbar .dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 10px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sh-danger);
  box-shadow: 0 0 0 2px var(--panel);
}
#tabbar .dot[hidden] { display: none !important; }

/* Tab 页给底栏留位（三个 Tab 页 + 口播剪辑入口不显示底栏时由 body.tabbed 控制） */
body.tabbed { padding-bottom: var(--sh-tab-h); }
/* 第 2 轮裁决 9：外壳页把署名（SenseVoice）推到内容最末尾——空列表时贴在 Tab 栏上方，不悬在半屏；
   列表长了就自然排在内容后面（margin-top:auto 在内容超过一屏时归 0）。 */
body.tabbed { display: flex; flex-direction: column; min-height: 100vh; }
body.tabbed .foot { margin-top: auto; }

/* —— 创作页 —— */
.shell-hello { font-size: 16px; color: var(--text); opacity: .92; margin: 4px 0 14px; }
.shell-sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 10px;
}
.shell-sec h2 { margin: 0; font-size: 17px; }
.shell-sec .more-link { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; text-decoration: none; }

.line-card {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 108px;
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.line-card .pic { width: 92px; flex: none; position: relative; background: #111 center / cover; }
.line-card .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, var(--panel)); }
.line-card .tx { flex: 1; padding: 14px 14px 14px 10px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.line-card .tx b { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-card .tx span.desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.line-card .go {
  align-self: center;
  margin-right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  font-size: 18px;
  flex: none;
}
.line-card.clip { border-left: 4px solid var(--sh-c-clip); }
.line-card.clip .pic { background: linear-gradient(135deg, #f5c451, #b3771a); }
.line-card.viral { border-left: 4px solid var(--sh-c-viral); }
.line-card.viral .pic { background: linear-gradient(135deg, #ff7b9c, #a33356); }
.line-card.drama { border-left: 4px solid var(--sh-c-drama); }
.line-card.drama .pic { background: linear-gradient(135deg, #8db4ff, #3c5da3); }
.soon-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
/* L2 coming-soon sheet: bottom drawer on small screens, centred panel on large */
.soon-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.soon-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 60vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  color: var(--text);
}
.soon-sheet h3 { margin: 0 40px 12px 0; font-size: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.soon-sheet p { margin: 0; }
.soon-what { font-size: 15px; line-height: 1.6; }
.soon-bright { margin-top: 10px !important; font-size: 14px; line-height: 1.5; color: var(--sh-accent); font-weight: 600; }
.soon-notify { width: 100%; min-height: 48px; margin-top: 20px; font-size: 16px; border-radius: 12px; }
.soon-notify:disabled { opacity: .7; cursor: default; }
.soon-note { min-height: 20px; margin-top: 10px !important; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.soon-note[data-state="done"] { color: #7bd88f; }
.soon-note[data-state="error"], .soon-note[data-state="login"] { color: var(--sh-danger); }
.soon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
@media (min-width: 700px) {
  .soon-sheet-wrap { align-items: center; }
  .soon-sheet { border-radius: 18px; border-bottom: 1px solid var(--line); max-height: 80vh; }
}

/* 最近作品：横排，复用 mine-item 行式标记（v1 E2E 断言就认它） */
.recent-scroll {
  list-style: none;
  margin: 0 -14px;
  padding: 0 14px 4px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-scroll li { flex: 0 0 auto; width: min(76vw, 300px); }
.recent-scroll li:last-child .mine-item { border-top: 0; }

/* —— 作品页 —— */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 10px;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.filters button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}
.ing-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(245, 196, 81, .16);
  color: var(--sh-accent);
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 6px;
}

/* —— 我的页 —— */
.me-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; }
.me-head .av {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5c451, #ff7b9c 60%, #8db4ff);
  color: #1a1300;
  font-size: 26px;
  font-weight: 900;
}
.me-head b { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.me-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

.menu {
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  min-height: 52px;
  font-size: 15px;
}
.menu button:last-child { border-bottom: 0; }
.menu button .t { flex: 1; min-width: 0; }
.menu button .mi {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  flex: none;
  font-weight: 700;
}
.menu button .r { color: var(--muted); font-size: 18px; }
.menu button.danger { color: var(--sh-danger); }
.menu button.danger .mi { color: var(--sh-danger); }

.shell-help {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.shell-help[hidden] { display: none !important; }
.shell-fb { margin-top: 12px; display: grid; gap: 10px; }
.shell-fb textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.shell-fb-done {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(90, 209, 160, .1);
  border: 1px solid var(--ok);
  color: var(--ok);
  font-size: 14.5px;
}
.shell-fb-done[hidden] { display: none !important; }

/* L3b: in-app legal links (purchase consent / account page / home data notice / footer).
   Reuse the site link token --accent (same colour as the credits page's "back to quote" link)
   instead of hard-coded values: on the dark theme --accent = #7aa2ff, which is 7.0:1 against
   --panel and 7.59:1 against --bg. A future light theme only needs to swap --accent
   (the legal pages use #1f5fd0 in light mode, 5.82:1 on white) and these links follow. */
.legal-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-link:hover { color: var(--text); }
.legal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.menu-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 4px 0; }
.menu-links .legal-link { display: inline-flex; align-items: center; min-height: 44px; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin-top: 6px; }
.foot-legal .legal-link { display: inline-flex; align-items: center; min-height: 32px; }

/* I18N-1 language controls */
.login { position: relative; padding-top: 3.2rem; }
.login .language-toggle { position: absolute; top: .5rem; right: .75rem; min-height: 44px; }
.language-current { margin-left: auto; font-size: .85em; color: var(--muted, #9ca3af); }
.top .brand { min-width: 0; overflow-wrap: anywhere; }
.menu [data-testid="me-language"] { gap: .5rem; }

/* ---- L7 feedback sheet (editor help panel / Me page / failed job page) ----
 * Body-level overlay (z-index above the editor's own .ed-sheet at 55) so one component serves all three entries.
 * Small screens: bottom drawer; from 700px: centred panel. Uses the shell card tokens. */
.fb-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.fb-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  color: var(--text);
}
.fb-head { display: flex; align-items: flex-start; gap: 10px; }
.fb-head h2 { flex: 1; margin: 0 0 8px; font-size: 19px; }
.fb-x {
  width: 44px;
  height: 44px;
  margin: -8px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.fb-intro { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.fb-job {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.fb-label { display: block; margin: 12px 0 6px; font-size: 13.5px; font-weight: 600; }
.fb-sheet textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 118px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}
.fb-count { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--muted); }
.fb-file-row { display: flex; align-items: center; }
.fb-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}
.fb-file-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
.fb-file-thumb[hidden] { display: none; }
.fb-file-x {
  min-height: 44px;
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.fb-file-name { margin: 6px 0 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.fb-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.fb-status { min-height: 20px; margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fb-status[data-state="done"] { color: #7bd88f; font-weight: 600; }
.fb-status[data-state="error"], .fb-status[data-state="login"] { color: var(--sh-danger); }
.fb-actions { display: flex; gap: 10px; margin-top: 12px; }
.fb-actions .btn { flex: 1; min-height: 48px; font-size: 16px; }
.fb-faq { margin: 12px 0 0; text-align: center; font-size: 13.5px; }
.fb-faq a { color: var(--accent); }
.fb-done { font-size: 16px; }
@media (min-width: 700px) {
  .fb-wrap { align-items: center; }
  .fb-sheet { border-radius: 18px; border-bottom: 1px solid var(--line); max-height: 84vh; }
}
