/* ============================================================
   FlashShare Design System (518.PLUS)
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Colors */
  --bg: #f5f5f7;
  --ink: #0f1419;
  --muted: #536471;
  --soft: #f7f9f9;
  --line: #eff3f4;
  --line-strong: #cfd9de;
  --accent: #ff4d4d;            /* vbazz 主题红 */
  --accent-hover: #ff2442;
  --accent-soft: #fff1f2;
  --accent-deep: #e63b3b;
  --button-ink: #ffffff;
  --danger: #ff3b30;
  --danger-soft: rgba(255,59,48,0.08);
  --info-soft: rgba(59,130,246,0.10);
  --green-12: rgba(22,163,74,0.12);
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --warn: #f59e0b;
  --violet: #8b5cf6;
  --info: #3b82f6;
  --card: #ffffff;
  --neutral-100: #f7f7f7;
  --neutral-300: #e0e0e0;
  --shadow: rgba(15,20,25,0.12);
  --shadow-lift: rgba(15,20,25,0.2);

  /* Spacing — 4px base */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s8: 48px;

  /* Radius */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-full: 9999px;

  /* Typography */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: clamp(28px, 5vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(15,20,25,0.04);
  --sh: 0 2px 8px rgba(15,20,25,0.06);
  --sh-lg: 0 8px 28px var(--shadow);
  --sh-xl: 0 24px 56px var(--shadow-lift);
  --sh-accent: 0 2px 8px rgba(255,77,77,0.25);

  /* Z-index */
  --z-dropdown: 30;
  --z-modal: 50;

  /* Transitions */
  --ease: .2s ease;
  --ease-in: .15s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }

/* ── SVG兜底: 任何未显式定尺寸的svg不得撑满(裸viewBox默认300x150) ── */
svg:not([width]):not([height]) { width: 20px; height: 20px; }
.drop-glyph svg, .brand .mark svg, .tool-overlay-close svg, .modal-close svg,
.controls .field b svg, .section-h svg { width: unset; height: unset; }
.drop-glyph svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand .mark svg { width: 14px; height: 14px; }
.tool-overlay-close svg, .modal-close svg { width: 16px; height: 16px; }
.controls .field b svg { width: 13px; height: 13px; }

body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; touch-action: manipulation; min-height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
/* Keyboard focus ring — consistent across all interactive elements */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Global link reset: no underline by default; in-content contexts opt in explicitly. */
a { color: var(--accent); text-decoration: none; }
h1, h2 { letter-spacing: -0.02em; }

/* ── Layout ───────────────────────────────────────────────── */
.shell { width: min(880px, calc(100vw - var(--s4))); margin: 0 auto; padding: 0 var(--s2); flex: 1; display: flex; flex-direction: column; }

/* ═══ 首页新结构样式 (STEP 2) ═══ */


/* ── Hero mini: 一句点题 ── */
.hero-mini { text-align: center; padding: 4px 0 0; }
.hero-title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 0; color: var(--ink); }
.hero-sub { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 8px auto 0; max-width: 44ch; }
@media (max-width: 640px) { .hero-title { font-size: 23px; } }


/* ── 开放模式条: hero下 ── */
.open-callout { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0;
  padding: 9px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 650; text-decoration: none; transition: background var(--ease), transform var(--ease-in); }
.open-callout svg { width: 15px; height: 15px; stroke: var(--accent); }
.open-callout .arr { width: 13px; height: 13px; }
.open-callout:hover { background: #ffe4e6; }
.open-callout:active { transform: scale(.98); }

/* ── 上传卡: 页面唯一主角 ── */
.upload-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm); }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px 40px; cursor: pointer; text-align: center; }
.drop.dragover { background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; pointer-events: none; }
.drop-glyph { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.drop-glyph svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 16.5px; font-weight: 700; }
.drop-title em, .drop-title em * { font-style: normal; color: var(--accent); }
.drop-formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 7px; width: 100%; max-width: 100%; padding: 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.drop-formats .fmt-chip { display: inline-block; padding: 2px 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; font-weight: 600; letter-spacing: .02em; }
.upload-divider { height: 1px; background: var(--line); }
.controls { display: flex; align-items: stretch; width: 100%; }

/* legacy login/register controls (not home upload-card) */
.controls .field { flex: 1; padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; position: relative; }
.controls .field + .field { border-left: 1px solid var(--line); }
.controls .field span { font-size: 11.5px; font-weight: 650; color: var(--muted); letter-spacing: .03em; }
.controls .field b { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.controls .field b svg { width: 13px; height: 13px; stroke: var(--muted); }
.controls .field select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cta-row { margin: 14px 14px 16px; display: flex; justify-content: center; }
.cta-row button { width: auto; min-width: 0; max-width: 100%; border: 0; border-radius: 10px; background: var(--accent); color: var(--button-ink); font-size: 16px; font-weight: 700; padding: 13px 32px; font-family: inherit; cursor: pointer; transition: background var(--ease), opacity var(--ease); }
.cta-row button:hover { background: var(--accent-hover); }
.cta-row button:disabled { opacity: .55; cursor: default; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 工具区: 标题行 + 双列网格 ── */
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 0; }
.section-h .t { font-size: 15px; font-weight: 700; }
.section-h .n { font-size: 12.5px; color: var(--muted); }
.home-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tool-tab { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 12.5px 13.5px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.tool-tab svg, .tool-tab .tool-tab-icon svg { width: 19px; height: 19px; stroke: var(--body, var(--muted)); fill: none; flex-shrink: 0; }
.tool-tab .tool-tab-icon { display: inline-flex; }
.tool-tab .tool-tab-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.tool-tab .tool-cost { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; flex-shrink: 0; }
.tool-tab.active, .tool-tab.on { border-color: var(--accent); border-width: 1.5px; background: var(--accent-soft); box-shadow: 0 2px 10px rgba(255,77,77,.18); }
.tool-tab.active svg, .tool-tab.on svg { stroke: var(--accent); }
.tool-tab.active .tool-tab-name, .tool-tab.on .tool-tab-name { color: var(--accent); font-weight: 700; }
.tool-desc { position: relative; font-size: 13.5px; font-weight: 500; color: #fff; margin: 12px var(--r-sm) 0; padding: 11px 16px; background: var(--accent); border-radius: var(--r-sm); box-shadow: var(--sh-accent); line-height: 1.5; }
.tool-desc::before { content: ""; position: absolute; top: -5px; left: 26px; width: 10px; height: 10px; background: var(--accent); transform: rotate(45deg); border-radius: 2px; }

@media (max-width: 640px) {
  .drop { padding: 28px 16px 22px; }
  .controls .field { padding: 12px 14px; }
  .home-tools { gap: 8px; }
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 0 max(var(--s2), calc((100vw - 880px) / 2 + var(--s2))); flex-shrink: 0; background: var(--card); z-index: var(--z-dropdown); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 24px; height: 24px; display: block; }
.brand-num { color: var(--accent); }
.brand-dot { color: var(--ink); }
.brand-plus { color: var(--ink); }
.brand-logo { font-size: var(--text-base); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); background: none; -webkit-text-fill-color: var(--ink); }
.brand-verified { display: none; }
.brand strong { font: inherit; }
.top-actions { display: flex; align-items: center; gap: var(--s4); flex: 0 0 auto; margin-left: var(--s3); }

/* Nav icon buttons (history, etc.) */
.nav-icon { width: 32px; height: 32px; min-height: 32px; padding: 0; border: none; background: transparent; color: var(--muted); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--ease), color var(--ease), transform var(--ease-in); -webkit-tap-highlight-color: transparent; }
@media (hover:hover) and (pointer:fine) { .nav-icon:hover { background: var(--soft); color: var(--ink); } }
.nav-icon:active { transform: scale(0.92); }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* Topbar: auth buttons */
.topbar-login, .topbar-register { padding: var(--s2) var(--s4); border-radius: var(--r-full); font-size: var(--text-sm); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; transition: opacity var(--ease-in); }
.topbar-login { color: var(--ink); border: 1px solid var(--line-strong); }
@media (hover:hover) and (pointer:fine) { .topbar-login:hover { background: var(--soft); } }
.topbar-register { background: var(--ink); color: var(--button-ink); }
@media (hover:hover) and (pointer:fine) { .topbar-register:hover { opacity: .85; } }

/* Topbar: avatar (img if bound, same-size initial placeholder otherwise) */
.topbar-profile { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; text-decoration: none; display: inline-flex; align-items: center; }
@media (hover:hover) and (pointer:fine) { .topbar-profile:hover { background: var(--soft); } }
.topbar-profile img, .topbar-profile .avatar-fallback { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); display: block; }
.topbar-profile .avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--button-ink); font-size: var(--text-base); font-weight: 700; flex-shrink: 0; }

/* Topbar: language switch */
.lang-switch { position: relative; display: flex; align-items: center; }
.lang-button { height: 32px; min-width: 72px; border: none; background: transparent; color: var(--muted); padding: 0 var(--s5) 0 var(--s3); font-size: var(--text-sm); font-weight: 600; position: relative; cursor: pointer; transition: color var(--ease); display: inline-flex; align-items: center; white-space: nowrap; }
.lang-button::after { content: ""; position: absolute; right: var(--s3); top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-65%) rotate(45deg); opacity: .55; }
@media (hover:hover) and (pointer:fine) { .lang-button:hover, .lang-button[aria-expanded="true"] { color: var(--ink); } }

/* ── Dropdowns (shared) ───────────────────────────────────── */
.user-menu { position: relative; display: flex; align-items: center; }
.lang-menu, .user-dropdown {
  position: absolute; right: 0; top: calc(100% + var(--s1));
  z-index: var(--z-dropdown);
  padding: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: var(--sh-lg);
}
.lang-menu { width: 144px; }

.user-dropdown.hidden, .lang-menu.hidden { display: none; }
/* Header credit chip (signed-in users) */

.lang-option { width: 100%; min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); background: transparent; color: var(--ink); justify-content: flex-start; font-size: var(--text-sm); font-weight: 600; cursor: pointer; transition: background var(--ease), color var(--ease), transform var(--ease-in); }
.lang-option:active { transform: scale(0.97); }
@media (hover:hover) and (pointer:fine) { .lang-option:hover, .lang-option.active { background: var(--soft); color: var(--accent); } }

.user-info { padding: var(--s2) var(--s2) var(--s2); border-bottom: 1px solid var(--line); margin-bottom: var(--s1); }
.user-name { display: block; font-size: var(--text-base); font-weight: 700; color: var(--ink); }
.user-handle { font-weight: 400; color: var(--muted); }
/* (superseded by sectioned rules above; kept for fallback selectors) */
.user-dropdown a svg, .user-dropdown form button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; }
@media (hover:hover) and (pointer:fine) { .user-dropdown a:hover, .user-dropdown form button:hover { background: var(--soft); } }
.user-dropdown form { margin: 0; padding: 0; }
.logout-link { color: var(--danger) !important; }
@media (hover:hover) and (pointer:fine) { .logout-link:hover { background: var(--danger-soft) !important; } }

/* ── Hero / Intro ─────────────────────────────────────────── */
.workspace { display: flex; flex-direction: column; gap: 18px; max-width: 560px; margin: 0 auto; width: 100%; padding-top: var(--s4); padding-bottom: var(--s5); }
.limit:not(:last-child)::after { content: ""; position: absolute; right: 0; top: var(--s2); bottom: var(--s2); width: 1px; background: var(--line); }
.limit span { color: var(--muted); font-size: var(--text-sm); line-height: 1.2; }

/* ── Buttons ──────────────────────────────────────────────── */
.x-login, button { border: 0; background: var(--accent); color: var(--button-ink); border-radius: var(--r-full); padding: 11px 22px; font-size: var(--text-base); font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; transition: opacity var(--ease), background var(--ease), transform var(--ease-in); -webkit-tap-highlight-color: transparent; }
@media (hover:hover) and (pointer:fine) { button:hover { background: var(--accent-hover); } }
.x-login:active, button:active { transform: scale(0.96); }
.user-dropdown a:active, .user-dropdown button:active { transform: none; } /* menu rows must not wobble */
@media (hover:hover) and (pointer:fine) { .x-login:hover, button:hover { opacity: .85; } }
.x-login.loading { pointer-events: none; opacity: .7; }
button:disabled { opacity: .4; cursor: not-allowed; }
button svg, .button-icon svg { width: 18px; height: 18px; display: block; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.x-glyph { font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1; font-weight: 800; }

/* ── Userbox (legacy compat) ──────────────────────────────── */
.logout { width: 32px; height: 32px; min-height: 32px; border-radius: 50%; background: transparent; color: var(--muted); padding: 0; border: 1px solid transparent; }
@media (hover:hover) and (pointer:fine) { .logout:hover { color: var(--danger); border-color: var(--line); background: var(--soft); opacity: 1; } }

/* ── Upload Zone ──────────────────────────────────────────── */
.upload { display: block; }

/* ── Controls ─────────────────────────────────────────────── */
.auth-form .controls label { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.auth-form .controls label > span { font-size: var(--text-sm); flex-shrink: 0; }
/* ── Form control baseline (single source) ─────────────────────
   16px floor: iOS/Android auto-zoom any focused input <16px;
   font-family: inherit — UA default differs from page font otherwise.
   NOTE: this selector must stay UNPREFIXED. A prior revision glued the
   comment to `.controls`, silently scoping the floor to `.controls
   input` — every input elsewhere kept UA ~13px and iOS zoomed on focus. */
input, select, textarea {
  font-family: inherit;
  font-size: 16px;
}

select { width: auto; margin-top: 0; }
.auth-form .controls .primary { flex: 0 0 auto; min-height: 42px; padding: 0 var(--s5); background: var(--accent); border-radius: var(--r); font-size: var(--text-sm); font-weight: 700; white-space: nowrap; box-shadow: var(--sh-accent); transition: background var(--ease), box-shadow var(--ease), transform var(--ease); }
@media (hover:hover) and (pointer:fine) { .auth-form .controls .primary:hover { background: var(--accent-hover); transform: translateY(-1px); } }
.auth-form .controls .primary:active { transform: translateY(0); }
.auth-form label { color: var(--muted); font-size: var(--text-sm); font-weight: 500; display: block; }
.auth-form select {
  width: 100%; margin-top: 7px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: var(--s2) 32px var(--s2) var(--s3);
  font-weight: 600; color: var(--ink);
  background: var(--soft);
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371767b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer; transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
@media (hover:hover) and (pointer:fine) { .auth-form select:hover { border-color: var(--accent); background: var(--bg); } }
.auth-form select::-ms-expand { display: none; }
.auth-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Upload Progress ──────────────────────────────────────── */
.upload-progress { margin: var(--s5) 0; }
.upload-progress-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0; transition: width var(--ease); }
.upload-progress-text { text-align: center; font-size: var(--text-sm); color: var(--muted); margin-top: var(--s2); font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes brand-shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.upload-spinner { width: 28px; height: 28px; margin: var(--s4) auto; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
.btn-spinner { width: 18px; height: 18px; margin: 0 auto; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--card); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Result ───────────────────────────────────────────────── */
.urlrow { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); min-width: 0; }
.urlrow input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 11px var(--s3); background: var(--bg); overflow: hidden; text-overflow: ellipsis; }
.urlrow input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.urlrow button, .share { background: var(--ink); white-space: nowrap; flex: 0 0 auto; }

/* ── History (now in modal) ──────────────────────────────── */
.history-panel { width: min(540px,100%); min-height: 280px; max-height: 70vh; overflow-y: auto; }
.history-panel h2 { display: inline; margin: 0; font-size: var(--text-lg); font-weight: 800; }
.history-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; font-size: var(--text-xs); font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: var(--r-full); margin-left: var(--s2); vertical-align: middle; }
.history-list { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.history-list:empty::after { content: attr(data-empty); display: block; text-align: center; padding: var(--s6) 0; color: var(--muted); font-size: var(--sm); }
.history-list.loading { flex: 1; justify-content: center; align-items: center; margin-top: 0; }
.item { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s2) var(--s3); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--s3); align-items: center; background: var(--bg); transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease-in); }
.item:active { transform: scale(0.99); }
@media (hover:hover) and (pointer:fine) { .item:hover { border-color: var(--line-strong); box-shadow: var(--sh-sm); } }
.item-link { min-height: 48px; padding: var(--s1) 0; color: inherit; display: block; text-align: left; text-decoration: none; min-width: 0; }
@media (hover:hover) and (pointer:fine) { .item-link:hover .item-name { color: var(--accent); } }
.item-main { min-width: 0; display: block; }
.item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: var(--text-sm); font-weight: 700; color: var(--ink); transition: color var(--ease); }
.item-title { display: flex; align-items: center; gap: var(--s2); overflow: hidden; }
.item-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: flex; align-items: center; gap: 2px; }
.item-tool { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background var(--ease), color var(--ease); }
@media (hover:hover) and (pointer:fine) { .item-tool:hover { background: var(--soft); color: var(--ink); } }
.item-tool:disabled { opacity: .48; cursor: not-allowed; }
.item-tool svg { width: 16px; height: 16px; display: block; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.item-tool.accent-action { color: var(--accent); }
@media (hover:hover) and (pointer:fine) { .item-tool.accent-action:hover { background: var(--accent-soft); color: var(--accent-hover); } }
.item-tool.danger-action { color: var(--danger); }
@media (hover:hover) and (pointer:fine) { .item-tool.danger-action:hover { background: var(--danger-soft); color: var(--danger); } }

/* ── Format Badges ────────────────────────────────────────── */
.fmt-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--line); flex: 0 0 auto; }
.fmt-badge svg { width: var(--text-sm); height: var(--text-sm); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.fmt-badge.fmt-image { background: var(--accent-soft); border-color: var(--line); } .fmt-badge.fmt-image svg { stroke: var(--accent); }
.fmt-badge.fmt-pdf { background: var(--danger-soft); border-color: var(--danger-soft); } .fmt-badge.fmt-pdf svg { stroke: var(--danger); }
.fmt-badge.fmt-doc { background: var(--accent-soft); border-color: var(--line); } .fmt-badge.fmt-doc svg { stroke: var(--info); }
.fmt-badge.fmt-sheet { background: var(--green-soft); border-color: var(--green-soft); } .fmt-badge.fmt-sheet svg { stroke: var(--green); }
.fmt-badge.fmt-slides { background: var(--accent-soft); border-color: var(--line); } .fmt-badge.fmt-slides svg { stroke: var(--warn); }
.fmt-badge.fmt-text { background: var(--neutral-100); border-color: var(--neutral-300); } .fmt-badge.fmt-text svg { stroke: var(--muted); }
.fmt-badge.fmt-archive { background: var(--accent-soft); border-color: var(--line); } .fmt-badge.fmt-archive svg { stroke: var(--violet); }

/* ── Modal ────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--s4); background: rgba(15,20,25,.4); backdrop-filter: blur(4px); overscroll-behavior: contain; }
.modal.hidden { display: none; }
.modal:not(.hidden) .modal-panel { animation: modalIn var(--ease); }
.modal-panel { width: min(540px,100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4) var(--s4); padding-bottom: max(var(--s4), env(safe-area-inset-bottom)); position: relative; box-shadow: var(--sh-xl); max-height: calc(100dvh - var(--s4) * 2); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-close { position: absolute; right: var(--s3); top: var(--s3); width: 34px; height: 34px; min-height: 34px; padding: 0; background: transparent; color: var(--muted); border: 0; border-radius: 50%; }

@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-panel { width: min(540px,100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4) var(--s4); padding-bottom: max(var(--s4), env(safe-area-inset-bottom)); position: relative; box-shadow: var(--sh-xl); max-height: calc(100dvh - var(--s4) * 2); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* tall forms must never lock the page: the panel itself scrolls
   (page scrolls natively; .modal-panel caps at viewport) */
.modal-close { position: absolute; right: var(--s3); top: var(--s3); width: 34px; height: 34px; min-height: 34px; padding: 0; background: transparent; color: var(--muted); border: 0; border-radius: 50%; }
@media (hover:hover) and (pointer:fine) { .modal-close:hover { background: var(--soft); color: var(--ink); opacity: 1; } }
.modal-panel h2 { margin: 0; padding-right: 42px; font-size: var(--text-xl); line-height: 1.25; overflow-wrap: anywhere; font-weight: 800; }
.modal-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: var(--s3) 0 0; color: var(--muted); font-size: var(--text-sm); }
.modal-meta span { display: inline-flex; align-items: baseline; gap: var(--s1); padding: 0; }
.modal-meta span:not(:last-child)::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); margin-left: var(--s2); }
.modal-meta strong { color: var(--ink); font-size: var(--text-sm); font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--s1); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.modal-action { width: 38px; height: 38px; min-width: 38px; min-height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background var(--ease), color var(--ease); }
@media (hover:hover) and (pointer:fine) { .modal-action:hover { background: var(--soft); color: var(--ink); } }
.modal-action svg { width: 19px; height: 19px; display: block; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.modal-action .x-glyph { font-size: var(--text-base); }
.modal-action .action-mark { display: inline-flex; align-items: center; justify-content: center; color: inherit; flex: 0 0 auto; }
.modal-action .action-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modal-action.accent-action { color: var(--accent); }
@media (hover:hover) and (pointer:fine) { .modal-action.accent-action:hover { background: var(--accent-soft); color: var(--accent-hover); } }
.danger-button { color: var(--danger); }
@media (hover:hover) and (pointer:fine) { .danger-button:hover { background: var(--danger-soft); color: var(--danger); opacity: 1; } }

/* ── File Detail Page ─────────────────────────────────────── */
.file-shell { min-height: auto; }
.file-page { width: min(560px,100%); margin: auto; padding: var(--s4) var(--s2); text-align: center; }
.file-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); background: var(--bg); box-shadow: var(--sh-sm); }
.file-preview { margin: var(--s4) 0; border-radius: var(--r); overflow: hidden; max-height: 480px; display: flex; justify-content: center; background: var(--soft); }
.file-preview img { max-width: 100%; max-height: 480px; object-fit: contain; border-radius: var(--r); -webkit-user-select: none; user-select: none; -webkit-touch-callout: default; }
.file-card-head { display: flex; align-items: center; gap: var(--s3); text-align: left; margin-bottom: 0; }
.file-card-info { flex: 1; min-width: 0; }
.file-mark { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 48px; height: 48px; border-radius: var(--r); border: 1px solid var(--line); background: var(--soft); flex: 0 0 auto; overflow: hidden; }
.file-mark svg { width: var(--text-xl); height: var(--text-xl); stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.file-mark span { font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.3px; color: var(--muted); line-height: 1; }
.file-mark.fmt-image { background: var(--accent-soft); border-color: var(--line); } .file-mark.fmt-image svg, .file-mark.fmt-image span { stroke: var(--accent); color: var(--accent); }
.file-mark.fmt-pdf { background: var(--danger-soft); border-color: var(--danger-soft); } .file-mark.fmt-pdf svg, .file-mark.fmt-pdf span { stroke: var(--danger); color: var(--danger); }
.file-mark.fmt-doc { background: var(--accent-soft); border-color: var(--line); } .file-mark.fmt-doc svg, .file-mark.fmt-doc span { stroke: var(--info); color: var(--info); }
.file-mark.fmt-sheet { background: var(--green-soft); border-color: var(--green-soft); } .file-mark.fmt-sheet svg, .file-mark.fmt-sheet span { stroke: var(--green); color: var(--green); }
.file-mark.fmt-slides { background: var(--accent-soft); border-color: var(--line); } .file-mark.fmt-slides svg, .file-mark.fmt-slides span { stroke: var(--warn); color: var(--warn); }
.file-mark.fmt-text { background: var(--neutral-100); border-color: var(--neutral-300); } .file-mark.fmt-text svg, .file-mark.fmt-text span { stroke: var(--muted); color: var(--muted); }
.file-mark.fmt-arch, .file-mark.fmt-archive { background: var(--accent-soft); border-color: var(--line); } .file-mark.fmt-arch svg, .file-mark.fmt-arch span, .file-mark.fmt-archive svg, .file-mark.fmt-archive span { stroke: var(--violet); color: var(--violet); }
.file-mark.fmt-default { background: var(--soft); } .file-mark.fmt-default svg, .file-mark.fmt-default span { stroke: var(--muted); color: var(--muted); }
.file-page h1 { margin: 0 0 var(--s2); font-size: clamp(17px,3vw,22px); line-height: 1.25; overflow-wrap: anywhere; font-weight: 800; }
.file-facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0; }
.file-facts div { display: inline-flex; align-items: center; gap: var(--s1); padding: 0; position: relative; }
.file-facts div:not(:last-child)::after { content: "·"; color: var(--line-strong); margin: 0 var(--s1); }
.file-facts dt { display: none; }
.file-facts svg { width: var(--text-sm); height: var(--text-sm); stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: 0 0 auto; opacity: .7; }
.file-facts dd { margin: 0; font-weight: 500; font-size: var(--text-sm); color: var(--muted); }
.file-actions { display: flex; gap: var(--s2); justify-content: center; margin-top: var(--s4); flex-wrap: wrap; }
.action-btn { height: 44px; min-width: 44px; padding: 0 var(--s3); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); cursor: pointer; text-decoration: none; font-size: var(--text-sm); font-weight: 700; transition: border-color var(--ease-in), background var(--ease-in), color var(--ease-in), transform var(--ease-in); white-space: nowrap; }
.action-btn:active { transform: scale(0.95); }
.action-btn svg { width: var(--text-xl); height: var(--text-xl); stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
@media (hover:hover) and (pointer:fine) { .action-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } }
.action-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--button-ink); padding: 0 var(--s4); white-space: nowrap; flex-shrink: 0; }
@media (hover:hover) and (pointer:fine) { .action-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); } }
.action-btn .x-glyph { font-size: 18px; font-weight: 800; }
.qr-modal-panel { width: fit-content; padding: var(--s5); text-align: center; position: relative; }
.qr-modal-panel img { border-radius: var(--r); border: 1px solid var(--line); }
.qr-modal-panel .modal-close { width: 28px; height: 28px; min-height: 28px; top: var(--s2); right: var(--s2); }
.qr-modal-panel .modal-close svg { width: 16px; height: 16px; }
.file-note { color: var(--muted); font-size: var(--text-sm); margin: var(--s2) 0 0; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page { max-width: 380px; margin: auto; padding: var(--s5) var(--s4) var(--s6); display: flex; flex-direction: column; gap: var(--s4); justify-content: center; }
.auth-page h1 { font-size: var(--text-xl); text-align: center; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: var(--s3); }
.auth-form label { display: flex; flex-direction: column; gap: var(--s1); }
.auth-form label > span { font-size: var(--text-sm); color: var(--muted); }
.auth-form input, .auth-form textarea { border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: var(--s2) var(--s3); background: var(--bg); color: var(--ink); transition: border-color var(--ease-in); box-sizing: border-box; width: 100%; }
.auth-form input:focus, .auth-form textarea:focus { outline: none; border-color: var(--accent); }
.auth-form textarea { resize: vertical; font-family: inherit; }
.auth-form .primary { width: 100%; }
.auth-x-wrap { display: flex; justify-content: center; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: var(--s2) var(--s3); border-radius: var(--r-sm); font-size: var(--text-sm); margin-bottom: var(--s2); }
.auth-divider { text-align: center; position: relative; }
.auth-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.auth-divider span { position: relative; background: var(--bg); padding: 0 var(--s3); font-size: var(--text-sm); color: var(--muted); }
.auth-hint { text-align: center; font-size: var(--text-sm); color: var(--muted); }
.auth-hint a { color: var(--accent); }

/* ── Profile Page ─────────────────────────────────────────── */
.profile-note { color: var(--ink-soft, var(--muted)); font-size: var(--text-sm); margin-bottom: var(--s3); }
.token-create-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.token-create-row input { flex: 1 1 220px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); }

.token-list { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.token-item { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) 0; border-bottom: 1px dashed var(--line); }
.token-item:last-child { border-bottom: none; }
.token-name { flex: 1 1 200px; font-size: var(--text-base); word-break: break-all; }
.token-active { color: var(--green); font-size: var(--text-sm); }
.btn-token-revoke { padding: var(--s1) var(--s3); font-size: var(--text-sm); }
.profile-bound { color: var(--green); font-size: var(--text-base); }
.profile-bound a { color: var(--accent); }
.profile-unbound { color: var(--muted); font-size: var(--text-base); }
.btn-secondary { display: inline-block; padding: var(--s2) var(--s4); white-space: nowrap; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: var(--text-base); cursor: pointer; text-decoration: none; transition: border-color var(--ease-in); }
@media (hover:hover) and (pointer:fine) { .btn-secondary:hover { border-color: var(--accent); } }
.btn-danger { padding: var(--s2) var(--s4); border-radius: var(--r-sm); border: 1px solid var(--danger); background: transparent; color: var(--danger); font-size: var(--text-base); cursor: pointer; transition: background var(--ease-in), color var(--ease-in); }
@media (hover:hover) and (pointer:fine) { .btn-danger:hover { background: var(--danger); color: var(--button-ink); } }
.form-hint { color: var(--danger); font-size: var(--text-sm); margin: calc(-1 * var(--s1)) 0 var(--s1); }

/* ── Tools ────────────────────────────────────────────────── */
.workspace-tools { margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
.workspace-tools:empty { display: none; }
.tools-bar { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.tool-btn { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--soft); color: var(--ink); font-size: var(--text-sm); font-weight: 600; cursor: pointer; transition: border-color var(--ease-in), background var(--ease-in), color var(--ease-in); }
@media (hover:hover) and (pointer:fine) { .tool-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } }
.tool-btn.danger { color: var(--danger); border-color: var(--line-strong); }
@media (hover:hover) and (pointer:fine) { .tool-btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); } }
.tool-btn.locked { opacity: .6; }
@media (hover:hover) and (pointer:fine) { .tool-btn.locked:hover { opacity: 1; } }
.tool-btn svg { width: var(--text-lg); height: var(--text-lg); stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tool-error { color: var(--danger); font-size: var(--text-sm); }
.tool-loading { color: var(--muted); font-size: var(--text-sm); text-align: center; padding: var(--s5); }
.tool-confirm-text { font-size: var(--text-base); color: var(--muted); margin: 0 0 var(--s4); }
.tool-panel h3 { margin: 0 0 var(--s3); font-size: var(--text-lg); font-weight: 700; }
.tool-panel input { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: var(--s2) var(--s3); color: var(--ink); background: var(--bg); box-sizing: border-box; }
.tool-panel input:focus { outline: none; border-color: var(--accent); }
.tool-panel-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s3); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--bg); padding: var(--s3) var(--s2) max(var(--s3), env(safe-area-inset-bottom)); text-align: center; }
.footer-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
.footer-copy { font-size: var(--text-xs); color: var(--muted); }
.footer-copy .brand-logo { font-size: var(--text-xs); font-weight: 700; }
.footer-links { display: flex; gap: var(--s2); }
.footer-links a { font-size: var(--text-xs); color: var(--muted); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.doc-support { margin-top: 1em; font-size: 0.9em; }
.doc-support a { color: var(--muted); }

/* ── 内容卡 (.panel): 白卡+细边+圆角, 事实/MCP/空态容器 ──
   原型 static/proto/account.html 的 .panel 正式落地 (此前为幽灵类:
   模板六处引用但本表从未定义, 页面裸文本堆砌)。置于 .doc 之前,
   doc/agents 的透明版式靠后置覆盖保持。 */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.panel .t { font-size: 14.5px; font-weight: 700; }
.panel .d { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

/* ── Doc Pages ───────────────────────────────────────────── */
.doc { line-height: 1.7; width: 100%; max-width: 760px; margin: 0 auto; background: transparent; border: 0; border-radius: 0; padding: var(--s4) var(--s2) var(--s5); }
.doc h1 { font-size: var(--text-xl); }

/* ── /agents (agent support surface) ─────────────────────── */

/* ── Misc ─────────────────────────────────────────────────── */
.hidden { display: none; }

/* ── Tool Overlay (shared by all tools) ───────────────────── */
.tool-overlay { position: fixed; inset: 0; background: rgba(15,20,25,0.5); backdrop-filter: blur(2px); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.tool-overlay.hidden { display: none; }
.tool-overlay-panel { width: min(380px,100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5) var(--s4) var(--s4); position: relative; box-shadow: var(--sh-xl); }
.tool-overlay-close { position: absolute; top: var(--s2); right: var(--s2); background: none; border: none; cursor: pointer; color: var(--muted); padding: var(--s2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
@media (hover:hover) and (pointer:fine) { .tool-overlay-close:hover { background: var(--soft); color: var(--ink); } }
.tool-overlay-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tool-overlay-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.tool-overlay-head svg { width: var(--text-xl); height: var(--text-xl); stroke: var(--accent); stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tool-overlay-head h3 { margin: 0; font-size: var(--text-lg); font-weight: 700; }
.tool-overlay-desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.5; margin: 0 0 var(--s4); }
.tool-overlay-section { margin-bottom: var(--s4); }
.tool-overlay-section-label { font-size: var(--text-sm); color: var(--muted); font-weight: 600; margin-bottom: var(--s2); }
.tool-overlay-presets { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tool-overlay-preset { display: inline-flex; align-items: center; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--bg); font-size: var(--text-sm); font-weight: 600; cursor: pointer; color: var(--muted); transition: all var(--ease-in); }
/* 模式选择 = 纯文字 pill (radio 圆点视觉废弃: 非激活态常驻灰点突兀, 选中态以边框+文字色区分) */
.tool-overlay-preset.active { color: var(--accent); border-color: var(--accent); }
@media (hover:hover) and (pointer:fine) { .tool-overlay-preset:hover { border-color: var(--accent); color: var(--accent); } }
/* 模式控件区 (tool modes v3) */
.tool-overlay-params { display: flex; flex-direction: column; gap: var(--s4); }
.tool-overlay-param { display: flex; flex-direction: column; gap: var(--s2); }
.tool-param-label { font-size: var(--text-sm); color: var(--ink); font-weight: 600; }
.tool-param-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s2); }
.tool-param-row .tool-param-label { flex: 1; }
.tool-param-row input[type="text"], .tool-param-row input[type="number"] {
  width: 140px; border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 8px var(--s2); font-size: var(--text-sm); font-family: inherit; background: var(--bg); color: var(--ink);
}
.tool-param-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* 会员订阅区 (credits 页并列卡区) + PLUS 徽标 */
.sub-status { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); flex-wrap: wrap; }
.sub-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid var(--line-strong); font-size: var(--text-xs); font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.sub-badge.on { border-color: var(--accent); color: var(--accent); }
.sub-meta { font-size: var(--text-sm); color: var(--ink); }
.sub-warn { font-size: var(--text-xs); color: var(--muted); }
.sub-period { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }
.topup-price .sub-per { font-size: var(--text-xs); color: var(--muted); font-weight: 400; }
.plus-badge { display: inline-flex; padding: 1px 7px; margin-left: 5px; border-radius: var(--r-full); border: 1px solid var(--accent); color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .05em; vertical-align: middle; }
/* 发布表单高级项折叠 */
.usertools-adv { margin: 2px 0 0; }
.usertools-adv summary { font-size: var(--text-sm); color: var(--muted); cursor: pointer; padding: 6px 0; user-select: none; }
.usertools-adv[open] summary { margin-bottom: 4px; }
.usertools-adv label { display: grid; gap: 4px; margin-bottom: 8px; }

/* ── 发布页 (/account/tools/publish): 分节卡单列 ── */
.pub-page h1 { margin-bottom: 10px; }
.pub-form { display: flex; flex-direction: column; gap: 16px; }
.pub-card { display: flex; flex-direction: column; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s2) var(--s3); }
.pub-grid label, .pub-grid .pub-wide { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--ink-soft); }
.pub-grid input, .pub-grid select { padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; }
.pub-grid input:focus, .pub-grid select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pub-grid .pub-wide { grid-column: 1 / -1; }
.pub-err { font-size: 12px; color: var(--danger); min-height: 0; font-style: normal; }
.pub-err:empty { display: none; }
.pub-submit-row { display: flex; justify-content: flex-end; gap: 10px; }

/* 参数行编辑器 */
.param-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.param-row-head { display: grid; grid-template-columns: 1fr 130px 1fr auto auto; gap: 8px; align-items: center; }
.param-row-head input, .param-row-head select { padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font-family: inherit; font-size: 13.5px; min-width: 0; }
.param-row-head .pr-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pr-req { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.pr-del, .pr-opt-del { border: 0; background: var(--soft); color: var(--muted); border-radius: 8px; cursor: pointer; padding: 6px 10px; font-size: 13px; }
@media (hover:hover) and (pointer:fine) { .pr-del:hover, .pr-opt-del:hover { color: var(--danger); } }
.param-row-body { margin-top: 10px; }
.pr-opt { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.pr-opt input { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font-family: inherit; font-size: 13px; min-width: 0; }
.pr-opt .pr-opt-del { padding: 7px 10px; }
@media (max-width: 640px) {
  .pr-opt { grid-template-columns: 1fr auto; }
  .pr-opt .pr-opt-label { grid-column: 1; }
  .pr-opt .pr-opt-del { grid-column: 2; grid-row: 1; }
  .pr-opt .pr-opt-val { grid-column: 1; grid-row: 1; }
}
.pr-enum-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pr-default-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pr-default-wrap select, .pr-inline select { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font-family: inherit; }
.pr-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-inline label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pr-inline input { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font-family: inherit; font-size: 13px; max-width: 9em; }
.pr-ph-wrap input { max-width: 16em; }
@media (max-width: 640px) {
  .param-row-head { grid-template-columns: 1fr 1fr; }
  .param-row-head .pr-label { grid-column: 1 / -1; }
  .pr-opt { grid-template-columns: 1fr auto; }
  .pr-opt .pr-opt-label { grid-column: 1 / -1; }
}
/* 族勾选器: chip 网格, 不勾=全部格式 */
.fam-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fam-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft); background: var(--card); transition: border-color var(--ease), color var(--ease), background var(--ease); }
.fam-chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.fam-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.fam-hint { flex-basis: 100%; font-size: 12px; color: var(--muted); line-height: 1.5; letter-spacing: .01em; }
/* 4C-2: exact formats 行与族行留间距; multi 标准声明控件全宽 */
.ext-grid { margin-top: 8px; }
.pub-multi-wrap { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
/* 多语言行: 全宽 grid = 语言(原生名) | 名称 | 简介 | 删除 */
.lang-row { display: grid; grid-template-columns: 108px 1fr 2fr 34px; gap: 8px; margin-bottom: 8px; }
.lang-row .lang-pick, .lang-row input { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; font-family: inherit; font-size: var(--text-sm); }
.lang-row .lang-del { border: 0; background: var(--soft); color: var(--muted); border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
@media (hover:hover) and (pointer:fine) { .lang-row .lang-del:hover { color: var(--danger); } }
@media (max-width: 640px) { .lang-row { grid-template-columns: 96px 1fr 34px; } .lang-row .lang-desc { grid-column: 1 / 3; grid-row: 2; } .lang-row .lang-del { grid-row: 1; grid-column: 3; } }
/* 模式徽标 (工具 tab 内 "· Aurora"): 附属信息, 主从层级低于工具名 (14px) */
.tool-preset-badge { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.tool-tab.active .tool-preset-badge { color: var(--accent); opacity: .75; }
.tool-overlay-actions { display: flex; gap: var(--s2); margin-top: var(--s5); }
.overlay-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: 40px; padding: 0 var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); font-size: var(--text-sm); font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color var(--ease-in), background var(--ease-in), color var(--ease-in); text-decoration: none; }
@media (hover:hover) and (pointer:fine) { .overlay-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } }
.overlay-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--button-ink); }
@media (hover:hover) and (pointer:fine) { .overlay-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); } }
.overlay-btn.muted { color: var(--muted); }
.tool-overlay-actions .overlay-btn + .overlay-btn { margin-left: auto; }

/* ── Home Tools (legacy chips removed in STEP2; hidden helper kept) ── */
.home-tools.hidden { display: none; }
/* ── Tool Processing ──────────────────────────────────────── */
.tool-processing { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s5); }
.tool-processing .upload-spinner { margin: 0; }
.tool-processing span { font-size: var(--text-sm); color: var(--muted); font-weight: 600; }

/* ── Result (upload complete) ─────────────────────────────── */
.result { margin-top: 14px; padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); line-height: 1.5; }
.result:not(.hidden) { animation: fadeIn var(--ease); }
.result.error { color: var(--danger); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.result-card { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s5) var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--soft); }
.result-check { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: var(--card); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.result-check svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.result-card-title { font-size: var(--text-lg); font-weight: 800; text-align: center; }
.result-meta { font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.result-preview { margin: 0; max-height: 320px; overflow: hidden; border-radius: var(--r); display: flex; justify-content: center; background: var(--soft); }
.result-preview img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--r); -webkit-user-select: none; user-select: none; -webkit-touch-callout: default; }
.result-buttons { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; width: 100%; }
.action-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px var(--s1); flex-shrink: 0; }
.result-error { color: var(--danger); font-size: var(--text-sm); margin-bottom: var(--s2); }
.primary.full { width: fit-content; max-width: 200px; margin: var(--s5) auto 0; display: inline-flex; background: var(--accent); color: var(--card); padding: 0 var(--s6); min-height: 46px; font-size: var(--text-base); border-radius: var(--r); box-shadow: var(--sh-accent); transition: background var(--ease), box-shadow var(--ease), transform .15s ease; border: none; cursor: pointer; font-weight: 700; }
.auth-form .primary.full { width: 100%; max-width: none; margin: 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s1); margin-top: var(--s2); }
.share.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .shell { width: calc(100vw - 24px); padding: var(--s2) var(--s2) 0; }
  .topbar { padding: 0 calc(12px + var(--s2)); gap: var(--s2); }
  .top-actions { gap: var(--s2); min-width: 0; flex-wrap: nowrap; }
  .brand { font-size: var(--text-sm); gap: var(--s1); min-width: 0; }
  /* 390px 窄屏: 顶栏四件套 (brand+MCP+auth+lang) 总宽溢出 → space-between
     失效, MCP 胶囊叠上 brand 文字 (gap -11px 实测)。收窄动作区并允许
     brand-word 截断省略, 需求宽降到 390 内。 */
  .topbar-agents { padding: 5px 7px; max-width: 52px; }
  .topbar-login, .topbar-register { padding: 6px 9px; }
  .lang-button { min-width: 0; padding: 0 30px 0 var(--s2); font-size: var(--text-xs); }
  .lang-button::after { right: 12px; }
  .brand { flex-shrink: 0; }
  .brand-logo { font-size: var(--text-sm); }
  .lang-menu { width: 128px; }
  .workspace { max-width: 100%; }
  h1 { font-size: clamp(30px, 10vw, 40px); }
      .limit:not(:last-child)::after { display: none; }
  
  .auth-form .controls label { font-size: var(--text-sm); }
  .auth-form .controls .primary { min-height: 40px; padding: 0 var(--s4); font-size: var(--text-sm); }
  select { padding-left: var(--s2); padding-right: 28px; font-size: var(--text-sm); }
  .primary.full { width: fit-content; max-width: 100%; padding: 0 var(--s5); }
  .tool { padding: var(--s3) var(--s4) var(--s4); }
  .drop { min-height: 150px; padding: var(--s5) var(--s4); }
  .drop-formats { gap: var(--s1); margin-top: var(--s2); }
  .drop-formats span { font-size: var(--text-sm); padding: 2px 7px; }
  .history { margin-top: var(--s6); }
  .urlrow { gap: var(--s1); }
  .urlrow button { width: 38px; min-width: 38px; padding: 0; }
  .urlrow button .action-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .item { grid-template-columns: minmax(0,1fr); gap: var(--s2); padding: var(--s2) var(--s3); }
  .item-link { min-height: 44px; padding: 0; }
  .item-actions { justify-content: flex-end; }
  .modal-meta span:not(:last-child)::after { display: none; }
  .file-card { padding: var(--s4); }
  .file-card-head { gap: var(--s3); }
  .file-mark { width: 42px; height: 42px; border-radius: var(--r-sm); }
  .file-page h1 { font-size: var(--text-lg); }
  .auth-page { padding: var(--s4) var(--s2) var(--s6); }

}

/* ── ZIP preview modal ────────────────────────────────────── */
.zip-preview-panel { width: min(480px,100%); display: flex; flex-direction: column; max-height: min(80vh, 640px); }
.zip-preview-title { padding-right: 42px; overflow-wrap: anywhere; }
.zip-preview-meta { margin: var(--s2) 0 var(--s3); color: var(--muted); font-size: var(--text-sm); flex-shrink: 0; }
.zip-preview-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); flex: 1 1 auto; min-height: 0; }
.zip-item { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.zip-item:last-child { border-bottom: 0; }
.zip-item-icon { color: var(--muted); flex-shrink: 0; font-size: 12px; line-height: 1; }
.zip-item.dir .zip-item-icon { color: var(--accent); }
.zip-item-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.zip-item.dir .zip-item-name { color: var(--muted); }
.zip-item-size { flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.zip-preview-trigger { margin-top: var(--s2); width: 100%; justify-content: center; }

/* ── RTL: Arabic ──────────────────────────────────────────── */
html[dir="rtl"] body { font-family: -apple-system, "Segoe UI", Tahoma, Roboto, Arial, sans-serif; }
html[dir="rtl"] .topbar { direction: rtl; }
html[dir="rtl"] .top-actions { flex-direction: row-reverse; }
html[dir="rtl"] .lang-button { padding: 0 0 0 var(--s4); }
html[dir="rtl"] .lang-button::after { right: auto; left: var(--s1); }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .user-dropdown { right: auto; left: 0; }
html[dir="rtl"] .user-dropdown a, html[dir="rtl"] .user-dropdown form button { text-align: right; }
html[dir="rtl"] .file-card-head { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .file-facts div { direction: rtl; }
html[dir="rtl"] .auth-form label > span { text-align: right; }
html[dir="rtl"] .modal-panel { direction: rtl; }
html[dir="rtl"] .modal-close { right: auto; left: var(--s3); }
html[dir="rtl"] .tool-panel input { text-align: right; }
html[dir="rtl"] .tool-panel-actions { justify-content: flex-start; }
html[dir="rtl"] .tool-overlay-panel { direction: rtl; }
html[dir="rtl"] .tool-overlay-close { right: auto; left: var(--s3); }
html[dir="rtl"] .tool-overlay-actions { justify-content: flex-start; }

/* ── Account pages (/account/*) ── */
/* ═══ STEP 3: 账户页 6 页新视觉 (对齐 proto/account.html) ═══ */

/* ── 页骨架: 560px 居中(对齐首页 workspace), 16px 节奏 ── */
.acct-page { width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.acct-page h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.acct-page h1 + .acct-nav { margin-top: 0; }

/* ── 分区 tabs: 单行分段控件(proto .tabs), 当前项红底白字 ── */
.acct-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.acct-nav::-webkit-scrollbar { display: none; }
.acct-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background var(--ease), color var(--ease); min-width: 0; }
.acct-tab svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; }
@media (hover:hover) and (pointer:fine) { .acct-tab:hover { background: var(--soft); color: var(--ink); } }
.acct-tab.active { background: var(--accent); color: var(--button-ink); font-weight: 700; }
.acct-tab-sep { display: none; }

/* ── 余额主角卡(proto .balance-card): 大数字 + 右侧签到态 ── */
.acct-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 0; }
.acct-balance { min-width: 0; }
.acct-bal-label { font-size: 12.5px; font-weight: 650; color: var(--muted); letter-spacing: .03em; }
.acct-bal-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.acct-daily { flex-shrink: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 16px; color: var(--ink); cursor: default; }
.acct-daily.done { color: var(--green); border-color: transparent; background: var(--green-soft); }
.acct-daily:not(.done) { border-color: var(--accent); color: var(--accent); }
.acct-daily:not(.done) .acct-daily-claim button { background: var(--accent); color: var(--button-ink); border: 0; border-radius: 9px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.acct-daily svg { width: 18px; height: 18px; flex-shrink: 0; }
.acct-daily strong { display: block; font-size: 13.5px; }
.acct-daily-sub { font-size: 12px; color: var(--muted); }
.acct-daily-claim { margin: 0; }

/* ── 内容卡(proto .panel): 白卡+细边, 统一 16/18px 内距 ── */
.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg, 16px); padding: 16px 18px; margin: 0; }
.acct-card h2 { font-size: 14.5px; font-weight: 700; margin: 0 0 10px; }
.acct-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.acct-card-sub { font-size: 12px; color: var(--muted); margin-top: 10px; }
.acct-card + .acct-card { margin-top: 0; }

/* ── 流水: 表格保持(数据密集), 行式美化: 斑马+hover+类型章 ── */
.acct-tablewrap { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-table thead th { background: var(--soft); padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; border-bottom: 1px solid var(--line); }
.acct-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.acct-table tbody tr:last-child td { border-bottom: 0; }
.acct-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--soft) 45%, transparent); }
@media (hover:hover) and (pointer:fine) { .acct-table tbody tr:hover { background: var(--accent-soft); } }
.acct-table .pos { color: var(--green); font-weight: 700; }
.acct-table .neg { color: var(--danger); font-weight: 700; }
.acct-empty { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ── 收益四格(proto .earn-grid 风格): 2×2 ── */
.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.earn-cell { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.earn-cell strong { font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.earn-cell span { font-size: 12px; color: var(--muted); }

/* ── 表单卡片化(auth-form 已有基础, 对齐新卡) ── */
.acct-card .auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.acct-card .auth-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.acct-card .auth-form input, .acct-card .auth-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px; font-size: 15px; color: var(--ink); background: var(--card); font-family: inherit; }
.acct-card .auth-form input:focus, .acct-card .auth-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.acct-card .auth-form input[disabled] { background: var(--soft); color: var(--muted); }
.acct-card .auth-form button[type=submit].primary { align-self: flex-start; background: var(--accent); color: var(--button-ink); border: 0; border-radius: 10px; padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background var(--ease); }
@media (hover:hover) and (pointer:fine) { .acct-card .auth-form button[type=submit].primary:hover { background: var(--accent-hover); } }

@media (max-width: 640px) {
  .acct-page { padding: 14px 14px 28px; }
  .acct-hero { padding: 16px; }
  .acct-bal-num { font-size: 28px; }
  .acct-daily { padding: 9px 12px; }
  .acct-tab { padding: 9px 10px; font-size: 12.5px; }
  .acct-table { font-size: 12.5px; }
  .acct-table thead th, .acct-table tbody td { padding: 8px 9px; }
}

.acct-table .mono { font-variant-numeric: tabular-nums; }
.acct-table .ta-r { text-align: right; }
/* 明细表防碎版式: 时间/数字格禁折行, 类型徽章禁折行 */
.acct-table td.mono, .acct-table td.ta-r { white-space: nowrap; }
.ledger-kind { display: inline-block; font-size: var(--text-xs); padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); white-space: nowrap; }
.ledger-kind.ledger-grant_signup, .ledger-kind.ledger-grant_daily, .ledger-kind.ledger-grant_plan, .ledger-kind.ledger-grant_package, .ledger-kind.ledger-grant_referral { background: var(--green-12); color: var(--green); }
.ledger-kind.ledger-consume { background: rgba(220,38,38,.10); color: var(--danger); }
.ledger-kind.ledger-refund { background: var(--info-soft); color: var(--info); }
.ledger-kind.ledger-adjust { background: rgba(107,114,128,.15); color: var(--body); }
.acct-pager { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); font-size: var(--text-sm); }
.acct-pager a { color: var(--accent); text-decoration: none; }
.acct-pager .off { color: var(--muted); opacity: .5; }
.acct-pager .grow { flex: 1; text-align: center; color: var(--muted); font-size: var(--text-xs); }
.acct-empty { text-align: center; color: var(--muted); padding: var(--s4) 0; }

@media (max-width: 640px) {
  .topbar-agents { padding: 5px 7px; font-size: var(--text-xs); max-width: 52px; }
  .topbar-login, .topbar-register { padding: 6px 9px; font-size: var(--text-xs); }
  .top-actions { gap: var(--s1); margin-left: 0; }
  .brand { max-width: 128px; }
  .brand-word { overflow: hidden; text-overflow: ellipsis; }
  .topbar { gap: var(--s2); }

  .acct-hero { flex-direction: column; }
  .acct-balance, .acct-daily { flex-basis: auto; }
}

/* ── /agents page ── */
.agents-page h2 { font-size: var(--text-lg); margin: var(--s4) 0 var(--s2); }
.agents-intro { color: var(--muted); margin-bottom: var(--s4); }
.agents-quickstart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); margin: var(--s3) 0; }
.agents-quickstart h2 { font-size: var(--text-base); margin: 0 0 var(--s2); }
.agents-quickstart ol { margin: 0 0 var(--s2) var(--s3); color: var(--muted); font-size: var(--text-sm); }
.agents-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin: var(--s2) 0; }
.agents-table th { text-align: left; font-size: var(--text-xs); color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.agents-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.agents-table .mono { font-family: var(--mono, monospace); font-size: var(--text-xs); }
.ep-get { display: inline-block; font-size: var(--text-xs); font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--info-soft); color: var(--info); }
.ep-post { display: inline-block; font-size: var(--text-xs); font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--green-12); color: var(--green); }
.agents-copy { display: flex; align-items: center; gap: var(--s2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; margin: var(--s2) 0; flex-wrap: wrap; }
.agents-copy code { flex: 1; min-width: 200px; font-size: var(--text-sm); word-break: break-all; }
.agents-copy .btn-secondary { flex-shrink: 0; }
.agents-mcp-config { margin: var(--s2) 0; }
.agents-mcp-config h3 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--s1); }
.agents-pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2) var(--s3); overflow-x: auto; font-size: var(--text-xs); margin: 0 0 var(--s1); }
.agents-pre code { font-family: var(--mono, monospace); }

/* ── Tool cost badges (pricing surfaced in UI) ── */
.tool-cost { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 6px; margin-left: auto; border-radius: 99px; font-size: var(--text-xs, 12px); font-weight: 700; background: var(--info-soft); color: var(--info); font-variant-numeric: tabular-nums; }
.tool-tab .tool-cost { flex-shrink: 0; }
.tool-overlay-cost { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: var(--text-sm); color: var(--muted); }
.tool-overlay-cost .tool-cost { margin-left: 0; }

/* ── Inline button variant: no margin inside flex rows (tokens page etc.) ── */
.token-reveal-row .btn-secondary { margin: 0; }
.token-reveal-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: var(--s2) 0; }
.token-reveal-row code { flex: 1 1 240px; padding: var(--s2) var(--s3); background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm); word-break: break-all; }

.acct-daily-claim { margin-left: auto; }
.acct-daily-claim .primary { white-space: nowrap; }

/* ── QR modal image ── */
.qr-code { display: block; width: 200px; height: 200px; margin: 0 auto; padding: var(--s2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ── Layout hooks that carry meaning, not just JS anchors ── */
.acct-daily-info { min-width: 0; }
.acct-daily-info strong { display: block; }
.acct-daily-info .acct-daily-sub { display: block; }
.agents-endpoints { display: grid; gap: var(--s2); }
.credit-note-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── /account/tools v2: modal submit + icon grid + card list ── */
.acct-page .usertools-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s2) var(--s3); margin: var(--s3) 0 var(--s2); }
.acct-page .usertools-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--ink-soft); }
.acct-page .usertools-form .usertools-wide { grid-column: 1 / -1; }
.acct-page .usertools-form input, .acct-page .usertools-form select { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; }
.acct-page .usertools-submit-row { display: flex; justify-content: flex-end; gap: var(--s2); }
.acct-page .usertools-item { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px dashed var(--line); }
.acct-page .usertools-item:last-child { border-bottom: none; }
.acct-page .usertools-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.acct-page .usertools-ico { display: inline-flex; color: var(--accent); flex-shrink: 0; }
.acct-page .usertools-ico svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.acct-page .usertools-key { font-size: var(--text-xs); color: var(--muted); font-family: var(--mono, monospace); overflow: hidden; text-overflow: ellipsis; }
.acct-page .usertools-vis { font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--r-full); border: 1px solid var(--line-strong); white-space: nowrap; }
.acct-page .usertools-meta { font-size: var(--text-sm); color: var(--ink-soft); }
.acct-page .usertools-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.acct-page .btn-secondary.danger { border-color: var(--danger); color: var(--danger); }

/* ── earnings page: stat cells + ledger rows (were unstyled) ── */
.earn-actions { display: flex; align-items: center; gap: var(--s2); }
.earn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.earn-cell { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-md); }
.earn-cell strong { font-size: var(--text-xl); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.earn-cell span { font-size: var(--text-xs); color: var(--muted); }
.wd-list { display: flex; flex-direction: column; margin-bottom: var(--s3); }
.wd-row .wd-st { font-size: var(--text-xs); padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.wd-row .wd-st.st-approved, .wd-row .wd-st.st-paid { background: var(--green-soft); color: var(--ok, var(--green)); }
.wd-row .wd-st.st-pending { background: var(--accent-soft); color: var(--warn); }
.wd-row .wd-st.st-rejected { background: var(--danger-soft); color: var(--danger, var(--danger)); }
.wd-row .wd-amt { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.wd-row strong:last-child { font-variant-numeric: tabular-nums; }
.account h3 { font-size: var(--text-base); font-weight: 600; margin: var(--s3) 0 var(--s1); color: var(--ink); }

/* ── Home capability panel: stats bar + tool search ── */
.tool-search { position: relative; width: min(560px, 100%); margin: 0 auto var(--s3); }
.tool-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; pointer-events: none; }
.tool-search input { width: 100%; box-sizing: border-box; padding: 10px 14px 10px 38px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--bg); color: var(--ink); }
.tool-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tool-search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-lg, 0 8px 24px rgba(0,0,0,.12)); max-height: 320px; overflow-y: auto; padding: 4px; }
.tool-search-item { display: flex; align-items: center; gap: var(--s2); width: 100%; padding: 8px 10px; border: none; background: transparent; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; text-align: left; }
.tool-search-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.tool-search-item.active, .tool-search-item:hover { background: var(--soft); }
.tool-search-empty { padding: 12px; text-align: center; color: var(--muted); font-size: var(--text-sm); }
.tool-tab-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ── topbar MCP entry (primary service surface) ── */
.topbar-agents { font-size: var(--text-sm); font-weight: 600; color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: var(--r-full); border: 1px solid var(--line-strong); white-space: nowrap; transition: background var(--ease), border-color var(--ease); }
.topbar-agents:hover { background: var(--soft); border-color: var(--accent); }

/* ── earnings panel (/account/tools — money view) ── */
.acct-page .earn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s2); margin: var(--s3) 0; }

/* ── category picker (icon = derived from category mapping) ── */

/* ── user dropdown: sectioned nav, unified rows ── */
.user-dropdown { z-index: var(--z-modal); min-width: 220px; }
/* 1px divider lives inside the 16px row gap: adjacent rows shrink 0.5px each side of the border */
.menu-sec + .menu-sec { border-top: 1px solid var(--line); margin-top: -1px; padding-top: 0.5px; }
.menu-sec + .menu-sec > a:first-child { padding-top: 7.5px; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; justify-content: flex-start; gap: var(--s2); width: 100%; min-height: 0; padding: 8px var(--s3); border: none; background: none; text-align: left; font-size: var(--text-sm); font-weight: 500; color: var(--ink); text-decoration: none; cursor: pointer; border-radius: var(--r-sm); }
.user-dropdown a svg, .user-dropdown button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; opacity: .75; }
@media (hover:hover) and (pointer:fine) { .user-dropdown a:hover, .user-dropdown button:hover { background: var(--soft); } }
.user-dropdown .menu-val { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── token reveal: name line visually distinct from the key line ── */
.token-new-name { margin: 0 0 var(--s1); font-weight: 600; color: var(--ink); } .token-new-name:empty { display: none; }

/* ── copy-button feedback state ── */
.btn-secondary.copied { border-color: var(--accent); color: var(--accent); background: var(--soft); }

/* ── /account/earnings: by-tool breakdown rows ── */
.acct-page .bytool-list { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s3); }
.acct-page .wd-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px dashed var(--line); font-size: var(--text-sm); }
.acct-page .wd-row:last-child { border-bottom: none; }
.acct-page .wd-amt { color: var(--accent); margin-left: auto; font-variant-numeric: tabular-nums; }
.acct-page .wd-st { font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--r-full); background: var(--soft); color: var(--muted); }
.acct-page .wd-st.st-approved, .acct-page .wd-st.st-paid { color: var(--accent); }
.acct-page .wd-st.st-rejected { color: var(--danger); }

/* ── register bonus banner (activities-driven) ── */

/* ── top-up packs (packages data-driven) ── */
.topup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); margin: var(--s2) 0; }
.topup-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s3); background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-md); }
.topup-credits { font-size: var(--text-lg); font-weight: 700; color: var(--accent); }
.topup-price { font-size: var(--text-sm); color: var(--ink); font-weight: 600; }
.topup-status { font-size: var(--text-xs); color: var(--muted); }

/* ── provider call-log drawer ── */
.calls-drawer { margin-top: var(--s2); padding: var(--s2) var(--s3); background: var(--soft); border: 1px dashed var(--line); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 2px; }
.calls-drawer .wd-row { border-bottom: 1px dashed var(--line); }
.calls-drawer .wd-row:last-child { border-bottom: none; }
.calls-drawer .wd-row strong:last-child { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ── provider contract doc (collapsed) ── */
.contract-doc { margin: var(--s2) 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.contract-doc summary { padding: 10px 14px; cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.contract-doc[open] summary { border-bottom: 1px solid var(--line); color: var(--ink); }
.contract-body { padding: var(--s2) var(--s3); font-size: var(--text-sm); }
.contract-body h4 { margin: var(--s2) 0 var(--s1); font-size: var(--text-sm); }
.contract-body pre { background: var(--soft); padding: 10px 12px; border-radius: var(--r-sm); overflow-x: auto; font-size: var(--text-xs); line-height: 1.6; }
.contract-body p { color: var(--muted); }

/* ═══ STEP 9: 工具市场 + 工具主页 ═══ */

/* ── 市场页 ── */
.market-page { gap: 14px; }
.market-official-row { display: flex; gap: 9px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.market-official-row::-webkit-scrollbar { display: none; }
/* ── Tool card identity contract (tcard): market + user page 同一组件。
   工具符号轻量中性, 不做 app-icon tile。─ */
.tcard { display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); transition: border-color var(--ease), box-shadow var(--ease); }
@media (hover:hover) and (pointer:fine) { .tcard:hover { border-color: var(--accent); box-shadow: var(--sh-sm); } }
.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tcard-icon { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.tcard-icon svg { width: 20px; height: 20px; stroke: var(--body, var(--muted)); fill: none; }
.tcard-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tcard-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mkt-author { font-size: 12px; color: var(--muted); }
.tcard-desc { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tcard-author { font-weight: 600; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tcard-origin { padding: 1px 6px; border-radius: 5px; background: var(--soft); border: 1px solid var(--line); font-size: 10.5px; font-weight: 700; color: var(--muted); }
.tcard-free { font-weight: 700; }
.tcard-calls { font-variant-numeric: tabular-nums; }
.mkt-tags { display: inline-flex; gap: 5px; }
.mkt-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
a.mkt-tag:hover { border-color: var(--accent); color: var(--accent); }
.mkt-tag.on { background: var(--accent); border-color: var(--accent); color: var(--button-ink); }
.market-empty { text-align: left; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.market-empty .open-callout { margin-top: 8px; }

/* ── 工具主页（独占式） ── */
.toolpage-by { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.toolpage-handle { font-weight: 700; color: var(--ink); }
.toolpage .drop-glyph { background: var(--accent-soft); }
.toolpage-call { width: 100%; border: 0; border-radius: 10px; background: var(--accent); color: var(--button-ink); font-size: 16px; font-weight: 700; padding: 14px; font-family: inherit; cursor: pointer; transition: background var(--ease); }
.toolpage-call:hover { background: var(--accent-hover); }
.toolpage-call:disabled { opacity: .6; }
.toolpage-call:disabled:hover { background: var(--accent); }
.toolpage .controls .field b { justify-content: center; }
.toolpage .panel .code-block { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 10px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.toolpage .panel .d a { color: var(--accent); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 640px) {
  .market-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* 双胶囊并排(发布+市场) */
.hero-callouts { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.hero-callouts .open-callout { margin: 0; }
.open-callout-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.open-callout-ghost svg { stroke: var(--muted); }
@media (hover:hover) and (pointer:fine) { .open-callout-ghost:hover { border-color: var(--accent); color: var(--accent); } }
.agents-market-link { display: flex; justify-content: center; margin: var(--s5) 0; }

/* ── 市场页视觉精修 ── */
.market-page .hero-sub { max-width: 34em; }

/* 工具主页精修 */
.toolpage .panel .d { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.toolpage .panel .d .mono { font-size: 13px; }
.toolpage .cta-row { margin: 0; }
.mkt-calls { font-weight: 600; color: var(--body); }

/* ── 工具页改版 (能力叙事 + 一控件即执行, 0905 机制) ── */
a.toolpage-handle { text-decoration: none; }
a.toolpage-handle:hover { color: var(--accent); }
.toolpage-desc { text-align: center; max-width: 40em; margin: 0 auto 4px; color: var(--body); font-size: 15px; line-height: 1.6; }
.toolpage-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; padding: 12px 16px; margin: 12px 0 16px; }
.toolpage-fact { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.toolpage-fact .k { color: var(--muted); font-weight: 500; }
.toolpage-fact .v { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.toolpage-fact .fmt-chips { gap: 4px; }
.toolpage-run { display: flex; flex-direction: column; gap: 12px; }
.toolpage-params { display: flex; flex-direction: column; gap: 12px; }
.toolpage-param-group { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toolpage-params-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 30em; margin: 0 auto; }
.toolpage-param { display: flex; flex-direction: column; gap: 6px; }
.toolpage-param.tool-param-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.tool-param-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.toolpage-param input[type="number"], .toolpage-param input[type="text"] {
  min-width: 0; flex: 1; max-width: 12em; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  font-size: 14px; font-family: inherit;
}
.toolpage-submit-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 2px; }
.toolpage-file-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 18px; font-size: 15px; font-weight: 600; font-family: inherit;
  transition: border-color var(--ease), color var(--ease);
}
.toolpage-file-btn svg { width: 18px; height: 18px; stroke: var(--accent); }
.toolpage-file-btn:hover, .toolpage-file-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.toolpage-file-btn.busy { opacity: .6; pointer-events: none; }
.toolpage-file-name { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.toolpage-mcp-panel { margin-top: 16px; }
.toolpage-mcp-panel .d { font-size: 13.5px; }

/* ── 用户页 (开发者公开面, 0905 机制; 0930 结构化) ── */
.userpage-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.userpage-avatar {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 24px; font-weight: 800; letter-spacing: 0;
}
.userpage-id { flex: 1; min-width: 0; }
.userpage-id .hero-title { font-size: 22px; margin: 0; }
.userpage-tagline { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.userpage-nums { display: flex; gap: 22px; }
.userpage-num { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.userpage-num strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.userpage-num span { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .userpage-hero { display: grid; grid-template-columns: 56px 1fr; gap: 12px; }
  .userpage-nums { grid-column: 1 / -1; justify-content: flex-start; padding-top: 2px; }
}
.userpage-handle { letter-spacing: .2px; }
.userpage-stats { display: inline-flex; gap: 8px; align-items: center; }
.userpage-stats .dot { color: var(--muted); }
.userpage-grid { align-items: stretch; }
.userpage-card { display: flex; flex-direction: column; gap: 6px; cursor: default; }
.userpage-card { align-items: flex-start; }
.userpage-empty { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 8px; padding: 40px 18px; }
.userpage-empty .t { font-size: 15.5px; font-weight: 700; }
.userpage-empty .d { font-size: 13px; color: var(--muted); max-width: 34em; }
.userpage-empty-ico { width: 34px; height: 34px; color: var(--muted); opacity: .8; }
.userpage-empty .open-callout { margin-top: 10px; }

/* ── 市场页: 搜索 + 分页列表 ── */
.market-toolbar { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.market-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 18px 0 4px; }
.pager-btn, .pager-num { border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; font-family: inherit; text-decoration: none; }
.pager-btn:hover, .pager-num:hover { border-color: var(--accent); color: var(--accent); }
.pager-num.active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak, rgba(53,122,232,.08)); }
.pager-btn.disabled { opacity: .45; pointer-events: none; }
.pager-ellipsis { color: var(--muted); padding: 0 2px; font-size: 13px; user-select: none; }
.market-search { display: flex; align-items: center; gap: 8px; max-width: 26em; width: 100%; margin: 0 auto;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); padding: 8px 12px; }
.market-search svg { width: 16px; height: 16px; stroke: var(--muted); flex: none; }
.market-search input { border: 0; background: none; color: var(--ink); font-size: 14px; font-family: inherit; width: 100%; outline: none; }
.market-none { text-align: center; color: var(--muted); font-size: 14px; padding: 22px 0; }

/* ── 收益USD换算 + 提现浮层单列 ── */
.earn-usd { display: block; font-style: normal; font-size: var(--text-xs); color: var(--muted); margin-top: -4px; }
.wd-modal-form { grid-template-columns: 1fr !important; }
