/*
 * 妙想成片 · 视觉精修层（2026-10-18）
 * ============================================================================
 * 只管"质感"，不管布局契约：字体、表面、投影、圆角、控件状态与外壳。
 * 加载在所有页面样式之后、motion.css 之前，靠源序和略高的选择器权重统一
 * 各页面散落的视觉细节。
 *
 * 不可动的契约（对应验收测试）：
 *   - 卡片图标 36px、悬停上浮 -2px、手机两列（rebirth-tokens.css 第五、六节）
 *   - 控件最小 44px 触控高度
 *   - 类名一律不改
 * 新增的只有本层私有变量（--elev-*、--surface-*），组件仍引用原有主题变量。
 */

:root {
  --elev-0: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent);
  --elev-1: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent), 0 8px 24px -12px color-mix(in srgb, var(--ink) 14%, transparent);
  --elev-2: 0 2px 4px color-mix(in srgb, var(--ink) 5%, transparent), 0 20px 44px -18px color-mix(in srgb, var(--ink) 24%, transparent);
  --surface-line: color-mix(in srgb, var(--line) 82%, transparent);
  --surface-radius: 16px;
  --focus-ring: 0 0 0 4px color-mix(in srgb, var(--navigation-accent) 16%, transparent);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
[data-theme="dark"] {
  --elev-0: 0 1px 2px #00000040;
  --elev-1: 0 1px 2px #00000040, 0 10px 28px -14px #000000a0;
  --elev-2: 0 2px 4px #00000050, 0 24px 48px -20px #000000c0;
  --surface-line: var(--line);
}

/* ---------------------------------------------------------------------------
 * 一、字体与底色
 * ------------------------------------------------------------------------- */
html body,
html body .ui-select-menu {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html { background: var(--bg); }
html body {
  background:
    radial-gradient(1100px 520px at 8% -8%, color-mix(in srgb, var(--gold) 7%, transparent), transparent 62%),
    radial-gradient(900px 460px at 96% -12%, color-mix(in srgb, #8b5cf6 6%, transparent), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 8% -8%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 62%),
    radial-gradient(900px 460px at 96% -12%, color-mix(in srgb, #8b5cf6 8%, transparent), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
}
::selection { background: color-mix(in srgb, var(--navigation-accent) 22%, transparent); }
#view :is(h1, h2, h3) { letter-spacing: -.01em; }
#view :is(b, strong, .catalog-points, .credit-number) { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
 * 二、外壳：顶栏与侧栏
 * ------------------------------------------------------------------------- */
html body .topbar {
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 0;
  box-shadow: none;
}
html body .topbar::before { content: none; }
html body .topbar .brand b { color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
html body .topbar .brand small { color: var(--muted); }
html body .topbar .top-actions { gap: 6px; align-items: center; }
html body .topbar :is(.icon-button, .notification-bell, .appearance-menu > summary) {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  transition: background-color var(--ui-motion) ease, color var(--ui-motion) ease, border-color var(--ui-motion) ease;
}
html body .topbar :is(.icon-button, .notification-bell, .appearance-menu > summary):hover,
html body .topbar .appearance-menu[open] > summary {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
}
html body .topbar .credit-pill {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: baseline;
  gap: 4px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 26%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-accent) 9%, var(--panel));
  box-shadow: inset 0 1px 0 #ffffff40;
}
html body .topbar .credit-pill b { color: var(--opal-credit); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
html body .topbar .credit-pill span { color: color-mix(in srgb, var(--opal-credit) 70%, var(--muted)); font-size: 12px; font-weight: 600; }
html body .topbar .credit-pill:hover { background: color-mix(in srgb, var(--brand-accent) 15%, var(--panel)); }
html body .topbar .profile-button { gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid transparent; border-radius: 999px; }
html body .topbar .profile-button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
html body .topbar .profile-button #profileName { color: var(--ink); font-size: 14px; font-weight: 600; }
html body .topbar .avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold2), #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--panel), 0 4px 10px -4px color-mix(in srgb, var(--gold) 60%, transparent);
}

@media (min-width: 821px) {
  /* 顶栏已有品牌，侧栏不再重复一份 */
  html body .sidebar .side-brand { display: none; }
  html body .sidebar {
    padding: 16px 12px;
    border: 1px solid var(--surface-line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--panel) 80%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--elev-1);
  }
  html body .sidebar::before { content: none; }
  html body .sidebar > .eyebrow {
    margin: 4px 12px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
  }
  html body .sidebar .nav { gap: 4px; }
  html body .sidebar .nav button {
    position: relative;
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 500;
    transition: background-color var(--ui-motion) ease, color var(--ui-motion) ease;
  }
  html body .sidebar .nav button .nav-icon { color: var(--muted); }
  html body .sidebar .nav button:hover { background: color-mix(in srgb, var(--ink) 4.5%, transparent); color: var(--ink); }
  html body .sidebar .nav button.active {
    background: color-mix(in srgb, var(--navigation-accent) 9%, var(--panel));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--navigation-accent) 12%, transparent);
    color: var(--navigation-accent);
    font-weight: 650;
  }
  html body .sidebar .nav button.active .nav-icon { color: var(--navigation-accent); }
  html body .sidebar .nav button.active::after { content: none; }
  html body .sidebar .side-status { margin-top: auto; padding: 12px; border: 0; border-radius: 14px; background: var(--soft); }
  html body .sidebar .side-status b { color: var(--ink); font-size: 13px; }
  html body .sidebar .side-status small { color: var(--muted); font-size: 12px; }
  html body .sidebar .status-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 16%, transparent); }
}

@media (max-width: 820px) {
  html body .sidebar {
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 -8px 24px -16px color-mix(in srgb, var(--ink) 30%, transparent);
  }
  html body .sidebar .nav button { background: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }
  html body .sidebar .nav button.active { background: transparent; color: var(--navigation-accent); font-weight: 650; }
  html body .sidebar .nav button .nav-icon { border-radius: 999px; transition: background-color var(--ui-motion) ease; }
  html body .sidebar .nav button.active .nav-icon { background: color-mix(in srgb, var(--navigation-accent) 12%, transparent); color: var(--navigation-accent); }
  html body .sidebar .nav button.active::after { content: none; }
  html body .topbar .credit-pill { padding: 5px 10px; min-height: 32px; }
}
/* 窄屏把积分胶囊恢复成上下两行：横排更宽，会把品牌名挤成逐字竖排（大字号下尤其明显） */
@media (max-width: 600px) {
  html body .topbar .credit-pill {
    flex-direction: column-reverse;
    align-items: center;
    gap: 0;
    padding: 4px 10px;
    border-radius: 12px;
  }
  html body .topbar .credit-pill b { line-height: 1.2; }
  html body .topbar .credit-pill span { font-size: 11px; line-height: 1.2; }
}

/* ---------------------------------------------------------------------------
 * 三、页面标题
 * ------------------------------------------------------------------------- */
#view .section-heading { margin-bottom: 22px; padding-bottom: 0; border-bottom: 0; }
#view .section-heading h1 { color: var(--page-heading); font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
#view .page-title-group { gap: 14px; }
#view .page-title-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--section-accent) 16%, var(--panel)), color-mix(in srgb, var(--section-accent) 6%, var(--panel)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--section-accent) 18%, transparent), 0 6px 16px -8px color-mix(in srgb, var(--section-accent) 50%, transparent);
}
#view .workflow-heading { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--surface-line); }
#view .workflow-heading h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
#view .workflow-heading .eyebrow { font-weight: 650; letter-spacing: .04em; }
#view :is(.workflow-back, .workflow-heading-icon) {
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--elev-0);
}
#view .workflow-heading-icon {
  width: 44px;
  flex-basis: 44px;
  border: 0;
  background: color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 10%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 16%, transparent);
}
@media (max-width: 600px) {
  #view .section-heading { margin-bottom: 16px; }
  #view .section-heading h1, #view .workflow-heading h1 { font-size: 22px; }
  #view .page-title-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
}

/* ---------------------------------------------------------------------------
 * 四、表面：所有"卡片式"容器共用一套描边、圆角与投影
 * ------------------------------------------------------------------------- */
#view :is(.panel, .table-panel, .tutorial-step, .account-profile-editor, .credit-history, .project-overview,
  .workflow-cost-summary, .settings-card, .home-task, .account-credit-overview, .text-conversation-history:has(> div:not(:empty))) {
  border: 1px solid var(--surface-line);
  border-radius: var(--surface-radius);
  background: var(--panel);
  box-shadow: var(--elev-1);
}
#view[data-workflow] .workspace-form,
#view[data-workflow] .workspace-result:not(.source-active-workspace *) {
  border: 1px solid var(--surface-line);
  border-radius: 18px;
  box-shadow: var(--elev-1);
}
#view[data-workflow] .source-active-workspace .workspace-result { border: 0; box-shadow: none; }
#view .home-task:hover { border-color: color-mix(in srgb, var(--navigation-accent) 30%, var(--line)); box-shadow: var(--elev-2); }

/* ---------------------------------------------------------------------------
 * 五、按钮与表单控件
 * ------------------------------------------------------------------------- */
:is(#view, #auth, #modalRoot, dialog) .button {
  border: 1px solid var(--line2);
  border-color: color-mix(in srgb, var(--line2) 80%, transparent);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--elev-0);
  transition: background-color var(--ui-motion) ease, border-color var(--ui-motion) ease, box-shadow var(--ui-motion) ease, filter var(--ui-motion) ease;
}
:is(#view, #auth, #modalRoot, dialog) .button:hover:not(:disabled) {
  border-color: var(--line2);
  background: var(--soft);
}
html[data-theme] :is(#view, #auth, #modalRoot, dialog) .button.primary {
  --action: var(--workspace-accent, var(--navigation-accent));
  border: 1px solid color-mix(in srgb, var(--action) 82%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--action) 86%, #fff), var(--action)) var(--action);
  color: var(--opal-on-action);
  box-shadow: inset 0 1px 0 #ffffff38, 0 1px 2px color-mix(in srgb, var(--ink) 14%, transparent), 0 6px 14px -8px color-mix(in srgb, var(--action) 60%, transparent);
}
html[data-theme="dark"] :is(#view, #auth, #modalRoot, dialog) .button.primary {
  border-color: color-mix(in srgb, var(--action) 70%, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--action) 88%, #fff), var(--action)) var(--action);
  color: #0d1330;
}
html[data-theme] :is(#view, #auth, #modalRoot, dialog) .button.primary:hover:not(:disabled) { filter: brightness(1.06) saturate(1.05); }
html[data-theme] :is(#view, #auth, #modalRoot, dialog) .button.primary:active:not(:disabled) { filter: brightness(.96); }
:is(#view, #auth, #modalRoot, dialog) .button:disabled { box-shadow: none; }
#view .icon-button { border-color: var(--surface-line); border-radius: 12px; box-shadow: var(--elev-0); }
#view .text-button { border-color: var(--surface-line); border-radius: 12px; }

:is(#view, #auth, #modalRoot, dialog) :is(.input, .textarea, .select, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .project-search input, .project-status-filter select) {
  border: 1px solid color-mix(in srgb, var(--line2) 75%, transparent);
  border-radius: 12px;
  background-color: var(--field-surface);
  color: var(--ink);
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 3%, transparent);
  transition: border-color var(--ui-motion) ease, box-shadow var(--ui-motion) ease, background-color var(--ui-motion) ease;
}
:is(#view, #auth, #modalRoot, dialog) :is(.input, .textarea, .select, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .project-search input, .project-status-filter select):hover {
  border-color: var(--line2);
}
:is(#view, #auth, #modalRoot, dialog) :is(.input, .textarea, .select, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .project-search input, .project-status-filter select):focus {
  outline: none;
  border-color: var(--navigation-accent);
  background-color: var(--panel);
  box-shadow: var(--focus-ring);
}
#view .field > span, #view .field-label, #auth .field > span { color: var(--ink); font-weight: 600; }

/* 工作台里的选中态跟随工具色相，与步骤条、主按钮成为同一套颜色 */
#view[data-workflow] { --control-selected: var(--workspace-accent); }
#view .choice { border-color: color-mix(in srgb, var(--line2) 75%, transparent); border-radius: 12px; color: var(--text); }
#view .choice.selected,
#view .choice[aria-pressed="true"] {
  border-color: var(--control-selected);
  background: color-mix(in srgb, var(--control-selected) 7%, var(--panel));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--control-selected) 12%, transparent);
}
#view .selected .ratio-preview { color: var(--control-selected); }
#view .upload-zone { border-radius: 14px; }

/* ---------------------------------------------------------------------------
 * 六、首页：头图与目录卡片
 * ------------------------------------------------------------------------- */
#view .function-directory .directory-hero {
  border-radius: 22px;
  box-shadow: 0 1px 0 #ffffff14 inset, 0 30px 60px -30px #0f172ab3;
  padding: 32px 34px 24px;
}
#view .function-directory .directory-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #ffffff1a;
  pointer-events: none;
}
#view .function-directory .directory-greeting { color: #ffffffb8; font-size: 13px; font-weight: 500; letter-spacing: .02em; }
#view .function-directory .directory-hero-copy h2 { color: #fff; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
#view .function-directory .directory-hero-copy h2 span {
  background: linear-gradient(90deg, #f8e7b0, #e8b65a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#view .function-directory .directory-hero-meta { gap: 0; }
#view .function-directory .directory-hero-meta span { gap: 6px; padding: 0 18px; border-left: 1px solid #ffffff26; }
#view .function-directory .directory-hero-meta span:first-child { padding-left: 0; border-left: 0; }
#view .function-directory .directory-hero-meta b { color: #fff; font-size: 20px; font-weight: 750; }
#view .function-directory .directory-hero-meta small { color: #ffffffa3; font-size: 12px; }

/* 分类筛选：一枚玻璃分段控件，取代五个独立描边框 */
#view .function-directory .directory-hero-filters {
  width: max-content;
  max-width: 100%;
  gap: 2px;
  padding: 4px !important;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  background: #0b12204d;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
#view .function-directory .directory-hero-filters .filter,
#view .function-directory .directory-hero-filters .filter:first-child {
  width: auto;
  flex: 0 0 auto;
  min-height: 36px;
  padding-inline: 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #ffffffcc !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#view .function-directory .directory-hero-filters .filter:hover { background: #ffffff1f !important; color: #fff !important; }
#view .function-directory .directory-hero-filters .filter.active {
  background: #fff !important;
  color: #101828 !important;
  box-shadow: 0 4px 12px -4px #00000066 !important;
}

#view .function-directory .directory-heading { margin-top: 6px; }
#view .function-directory .catalog-view-switch {
  padding: 3px;
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--elev-0);
}
#view .function-directory .catalog-view-switch button { border-radius: 9px; }

/* 卡片：保留色相身份，降低"彩条"的噪音，提升纸感与层次 */
#view .function-directory .compact-grid .catalog-item {
  border-color: var(--surface-line);
  border-radius: 18px;
  background:
    radial-gradient(240px 120px at 0% 0%, color-mix(in srgb, var(--tool-tone) 7%, transparent), transparent 70%),
    var(--panel);
  box-shadow: var(--elev-1);
}
#view .function-directory .compact-grid .catalog-item::before {
  height: 3px;
  background: linear-gradient(90deg, var(--tool-tone), color-mix(in srgb, var(--tool-tone) 20%, transparent) 70%, transparent);
  opacity: .9;
}
#view .function-directory .compact-grid .catalog-item:hover {
  border-color: color-mix(in srgb, var(--tool-tone) 28%, var(--line));
  box-shadow: var(--elev-2), 0 18px 40px -24px color-mix(in srgb, var(--tool-tone) 55%, transparent);
}
#view .function-directory .compact-grid .catalog-tag { font-weight: 650; letter-spacing: .03em; }
#view .function-directory .compact-grid .catalog-copy b { font-weight: 750; letter-spacing: -.01em; }
#view .function-directory .compact-grid .catalog-outcome {
  border: 1px solid color-mix(in srgb, var(--tool-tone) 12%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--tool-tone) 5%, var(--panel));
  font-weight: 600;
}
#view .function-directory .compact-grid .catalog-foot { border-top-color: var(--surface-line); }
#view .function-directory .compact-grid .catalog-arrow {
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--tool-tone) 30%, var(--line));
  background: color-mix(in srgb, var(--tool-tone) 6%, var(--panel));
}
#view .function-directory .compact-grid .catalog-item:hover .catalog-arrow {
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--tool-tone) 80%, transparent);
}
#view .function-directory .catalog-grid:not(.compact-grid) .catalog-item { border-bottom-color: var(--surface-line); border-radius: 12px; }
#view .function-directory .catalog-grid:not(.compact-grid) .catalog-item:hover { background: color-mix(in srgb, var(--tool-tone) 4%, transparent); }

@media (max-width: 600px) {
  #view .function-directory .directory-hero { padding: 22px 18px 16px; border-radius: 18px; }
  #view .function-directory .directory-hero-copy h2 { font-size: 25px; }
  #view .function-directory .directory-hero-meta span { padding: 0 12px; }
  #view .function-directory .directory-hero-meta b { font-size: 17px; }
  #view .function-directory .directory-hero-meta small { font-size: 11px; }
  #view .function-directory .directory-hero-filters {
    width: 100%;
    border-radius: 14px;
    padding: 3px !important;
  }
  #view .function-directory .directory-hero-filters .filter,
  #view .function-directory .directory-hero-filters .filter:first-child {
    width: 100%;
    min-height: 40px;
    padding-inline: 0 !important;
    border-radius: 11px !important;
    font-size: 13px !important;
  }
  #view .function-directory .compact-grid .catalog-item { border-radius: 16px; }
}

/* ---------------------------------------------------------------------------
 * 七、我的 / 积分：会员卡改为有光泽的深色卡
 * ------------------------------------------------------------------------- */
.v2-account { max-width: 1180px; }
.v2-account .membership-summary,
.v2-account .account-credit-overview > [data-account-summary] {
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff14;
  border-top: 1px solid #ffffff14;
  background:
    radial-gradient(420px 220px at 100% 0%, color-mix(in srgb, var(--account-metal) 22%, transparent), transparent 70%),
    radial-gradient(360px 220px at 0% 100%, #4f63ff2e, transparent 70%),
    linear-gradient(150deg, #1c2130, #0e111a);
  box-shadow: 0 24px 48px -28px #0f172acc;
}
.v2-account .membership-summary { border-radius: 20px; }
.v2-account .membership-summary::after,
.v2-account .account-credit-overview > [data-account-summary]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffffff0f, transparent 38%);
  pointer-events: none;
}
.v2-account .member-credit strong,
.v2-account .credit-balance .credit-number {
  background: linear-gradient(180deg, #fbe7b2, #e2ad52);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 750;
  letter-spacing: -.02em;
}
.v2-account .member-credit strong span { -webkit-text-fill-color: var(--account-muted); }
.v2-account .member-avatar { border-radius: 12px; }
.v2-account .account-credit-overview { border-radius: 20px; }
.v2-account .account-credit-overview > [data-account-summary] { border: 0; border-radius: 0; }
.v2-account .account-menu { gap: 6px; }
.v2-account .account-menu button,
.v2-account .account-menu .account-shortcut {
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--elev-0);
  color: var(--ink);
  font-weight: 550;
  transition: border-color var(--ui-motion) ease, box-shadow var(--ui-motion) ease, transform var(--ui-motion) var(--ui-ease);
}
.v2-account .account-menu button:hover,
.v2-account .account-menu .account-shortcut:hover {
  border-color: color-mix(in srgb, var(--navigation-accent) 24%, var(--line));
  background: var(--panel);
  box-shadow: var(--elev-1);
}
.v2-account .account-menu button:hover .account-chevron { color: var(--navigation-accent); }
.v2-account .account-menu .nav-icon {
  border-radius: 10px;
  background: color-mix(in srgb, var(--navigation-accent) 8%, var(--panel));
}
.v2-account .account-menu [data-route="credits"] .nav-icon { background: color-mix(in srgb, var(--brand-accent) 10%, var(--panel)); }
.v2-account .account-menu [data-logout] { background: transparent; box-shadow: none; border-style: dashed; }
.v2-account .account-menu [data-logout] .nav-icon { background: transparent; }
.v2-account .credit-history h2 small { color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------------------
 * 八、作品与任务、新手教学
 * ------------------------------------------------------------------------- */
#view .project-overview { padding: 6px; gap: 0; }
#view .project-overview > div { padding: 16px 20px; border-radius: 12px; }
#view .project-overview > div b { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
#view .table-panel .empty { padding-block: 44px; }
#view .management-empty-icon {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--navigation-accent) 9%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--navigation-accent) 14%, transparent);
}
#view .text-conversation-history > h2 { font-size: 17px; }

#view .tutorial-page { max-width: 1180px; }
#view .tutorial-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
#view .tutorial-content > :not(.tutorial-step) { grid-column: 1 / -1; }
#view .tutorial-actions { justify-content: flex-start; padding-top: 8px; }
#view .tutorial-step {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  margin: 0;
  padding: 24px;
  overflow: hidden;
}
#view .tutorial-step .tutorial-number {
  grid-row: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--gold2), var(--primary-end));
  color: #fff;
  font-size: 16px;
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--gold) 80%, transparent);
}
#view .tutorial-step h2 { font-size: 18px; font-weight: 700; }
#view .tutorial-step p { line-height: 1.75; }

/* ---------------------------------------------------------------------------
 * 九、工作台：步骤条与费用摘要
 * ------------------------------------------------------------------------- */
#view[data-workflow] .flow-steps {
  padding: 6px;
  border: 1px solid var(--surface-line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--elev-0);
  gap: 4px;
}
#view[data-workflow] .flow-steps > li,
#view[data-workflow] .source-flow-steps > li > button { border-radius: 11px; }
#view[data-workflow] .flow-steps > li.active,
#view .flow-steps li.active {
  border-bottom: 0;
  background: color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 8%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 18%, transparent);
}
#view[data-workflow] .flow-steps > li.active { padding-bottom: 12px; }
#view[data-workflow] .source-flow-steps > li.active { padding-bottom: 0; }
#view .flow-steps li.active b { color: var(--workspace-accent, var(--navigation-accent)); }
#view .flow-steps li.active > span,
#view .flow-steps li.active > button > span { box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 80%, transparent); }

/* 手机：三步以上的流程改成竖向列表，默认只露出"当前"和"下一步"，
 * 底部按钮展开全部。折叠状态与标记由 current-step.js 写入
 * （data-step-disclosure / data-expanded / data-step-near），桌面端不受影响。 */
#view .flow-steps-toggle { display: none; }
@media (max-width: 700px) {
  #view[data-workflow] .flow-steps[data-step-disclosure] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    overflow: visible;
  }
  #view[data-workflow] .flow-steps[data-step-disclosure][data-expanded="false"] > li:not([data-step-near]) { display: none; }
  #view[data-workflow] .flow-steps[data-step-disclosure] > li,
  #view[data-workflow] .flow-steps[data-step-disclosure] > li > button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    justify-content: stretch;
    gap: 0 12px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px;
    text-align: left;
    flex-direction: row;
  }
  #view[data-workflow] .flow-steps[data-step-disclosure] > li:has(> button) { display: block; padding: 0; min-height: 0; }
  #view[data-workflow] .flow-steps[data-step-disclosure] :is(li > span, li > button > span) { grid-row: 1 / 3; }
  #view[data-workflow] .flow-steps[data-step-disclosure] b { display: block; grid-column: 2; justify-self: stretch; width: auto; max-width: none; align-self: center; font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  #view[data-workflow] .flow-steps[data-step-disclosure] b:has(+ small) { align-self: end; }
  #view[data-workflow] .flow-steps[data-step-disclosure] small { grid-column: 2; align-self: start; font-size: 12px; }
  #view[data-workflow] .flow-steps[data-step-disclosure] li[data-step-near] b::after {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    vertical-align: 1px;
  }
  #view[data-workflow] .flow-steps[data-step-disclosure] li[data-step-near="current"] b::after {
    content: "当前";
    background: var(--workspace-accent, var(--navigation-accent));
    color: var(--opal-on-action);
  }
  #view[data-workflow] .flow-steps[data-step-disclosure] li[data-step-near="next"] b::after {
    content: "下一步";
    background: var(--soft);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px var(--surface-line);
  }
  #view[data-workflow] .flow-steps-toggle:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    margin: 0 0 16px;
    padding: 8px 16px;
    border: 1px solid var(--surface-line);
    border-top-color: color-mix(in srgb, var(--line) 60%, transparent);
    border-radius: 0 0 16px 16px;
    background: var(--panel);
    box-shadow: var(--elev-0);
    color: var(--workspace-accent, var(--navigation-accent));
    font-size: 13px;
    font-weight: 600;
  }
  #view .flow-steps-toggle svg { width: 16px; height: 16px; transition: transform var(--ui-motion) var(--ui-ease); }
  #view .flow-steps-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
}

#view[data-workflow] .form-actions .cost b { color: var(--workspace-accent, var(--navigation-accent)); }
#view .workflow-cost-summary { padding: 16px 20px; }
#view .workflow-cost-heading strong { color: var(--ink); font-weight: 750; letter-spacing: -.01em; }
#view .workflow-cost-breakdown dd { color: var(--ink); font-variant-numeric: tabular-nums; }
#view[data-workflow] .workspace-result:has(> .workflow-preview-placeholder) {
  background:
    radial-gradient(420px 220px at 50% 0%, color-mix(in srgb, var(--workspace-accent, var(--navigation-accent)) 8%, transparent), transparent 70%),
    var(--panel);
}
#view .workflow-preview-frame { border-radius: 14px; }
/* 桌面吸底操作栏：原来是贴着表单内容边缘的一条直角色带，费用文字直接顶到边上。
 * 改成悬浮在表单内边距里的圆角条，自带左右内边距，与卡片保持 8px 的呼吸距离。 */
@media (min-width: 901px) {
  #view[data-workflow] .workspace-form > .form-actions {
    margin-inline: calc(8px - var(--ui-card-padding));
    padding: 12px calc(var(--ui-card-padding) - 8px);
    border: 1px solid var(--surface-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--elev-2);
  }
}

/* ---------------------------------------------------------------------------
 * 九（续）、圆角与内边距统一
 * 只用四档圆角：徽标 999px、小控件 10px、控件/内嵌块 12px、卡片 16–18px。
 * 旧样式里散落的 0/4/6/8px 统一收进这四档。
 * ------------------------------------------------------------------------- */
/* 结果页：外层改成和表单一样的卡片，内容不再贴边；海报工作区自带分栏卡片，不再套一层 */
#view[data-workflow] .source-active-workspace .workspace-result:not(:has(> .source-poster-workspace)) {
  padding: 24px;
  border: 1px solid var(--surface-line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--elev-1);
}
#view[data-workflow] .source-active-workspace .workspace-result:has(> .source-poster-workspace) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#view .source-poster-plan-pane,
#view .source-poster-preview { border-color: var(--surface-line); border-radius: 18px; box-shadow: var(--elev-1); }
/* "原始素材"折叠条自己就是带框的控件，外层再画上下分隔线就成了三道线 */
#view .source-active-workspace > .source-input-summary { border: 0; }
#view .source-input-summary > summary { border-radius: 12px; }
#view .workspace-result > .result-toolbar {
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: inset 3px 0 0 var(--workspace-accent, var(--navigation-accent));
  border-left: 0;
}
@media (max-width: 600px) {
  #view[data-workflow] .source-active-workspace .workspace-result:not(:has(> .source-poster-workspace)) { padding: 16px; border-radius: 16px; }
}

#view :is(.task-warning, .task-error, .source-detail-cost, .qr-upload, .source-poster-empty,
  .source-ppt-placeholder, .source-detail-placeholder, .source-cover-original, .source-cover-crop,
  .text-history-row, .notification-status, .workflow-preview-frame) { border-radius: 12px; }
#view :is(.source-slot-visual, .project-thumbnail, .transaction-icon, .home-task > .workflow-logo,
  .source-chat-history-row, .text-reference-add, .text-reference-thumb > button:first-child) { border-radius: 10px; }
#view .source-poster-image,
#view .source-ppt-template img { border-radius: 10px; }
#view :is(.status, .video-reference-number, .asset-preview-label, .text-reference-thumb small) { border-radius: 999px; }
#view .v2-projects .status { padding: 3px 10px; }

/* 分段切换控件：外框 12px，内部按钮 9px，保证内外圆角同心 */
:is(#view, .notification-popover, .appearance-popover) :is(.notification-tabs, .preference-modes, .palette-switch, .theme-switch, .qr-source-tabs, .asset-tabs) {
  border-radius: 12px;
}
:is(#view, .notification-popover, .appearance-popover) :is(.notification-tabs, .preference-modes, .theme-switch, .qr-source-tabs, .asset-tabs) > button {
  border-radius: 9px;
}
.notification-popover { border-radius: 20px; }
#view .managed-text-actions select { border-radius: 10px; }
#view .source-book-mobile-tabs button { border-radius: 10px 10px 0 0; }

/* ---------------------------------------------------------------------------
 * 十、登录页
 * ------------------------------------------------------------------------- */
html body .auth-screen {
  background:
    radial-gradient(800px 480px at 15% 10%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 65%),
    radial-gradient(700px 460px at 90% 90%, color-mix(in srgb, #8b5cf6 14%, transparent), transparent 65%),
    var(--bg);
}
/* #auth 为了矮屏可滚动改成了顶对齐；auto 外边距在有余量时把卡片居中，
 * 内容超高时自动归零，滚动行为不变。 */
html body #auth { padding-top: max(24px, env(safe-area-inset-top)); }
html body #auth .auth-card { margin-block: auto; }
html body .auth-card {
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--elev-2);
}
html body .auth-card .auth-heading h1 { color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
html body .auth-card .auth-heading p { color: var(--muted); line-height: 1.7; }
html body .auth-card .brand b { color: var(--ink); font-weight: 800; letter-spacing: -.02em; }

/* ---------------------------------------------------------------------------
 * 十一、浮层：通知、对话框、提示
 * ------------------------------------------------------------------------- */
:is(.project-dialog, .tool-search, .tutorial-dialog, .appearance-popover) {
  border: 1px solid var(--surface-line);
  border-radius: 20px;
  box-shadow: var(--elev-2);
}
dialog::backdrop { background: #0b0f1a73; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.toast-region .toast { border: 1px solid var(--surface-line); border-radius: 14px; box-shadow: var(--elev-2); }

@media (prefers-reduced-motion: reduce) {
  html body .topbar, html body .sidebar, .auth-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
