@charset "UTF-8";
@import url("fonts.css");

:root {
  --brand: #5b5fef;
  --brand-2: #7c5cff;
  --brand-soft: #eef0ff;
  --bg: #f5f3ff;
  --sidebar: #faf9ff;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --line: #e8e7f2;
  --danger: #ff4d4f;
  --good: #0f9f6e;
  --accent: #5b5fef;
  --ink: #1e1b4b;
  /* 按钮层级：主要 / 次要 / 三级 */
  --btn-primary-bg: linear-gradient(135deg, var(--brand), var(--brand-2));
  --btn-primary-color: #fff;
  --btn-primary-shadow: 0 6px 14px rgba(91, 95, 239, 0.18);
  --btn-secondary-bg: var(--brand-soft);
  --btn-secondary-border: color-mix(in srgb, var(--brand) 38%, var(--line));
  --btn-secondary-color: var(--brand);
  --btn-tertiary-bg: transparent;
  --btn-tertiary-color: var(--muted);
  --control-h: 36px;
  --control-font: var(--fs-md);
  --control-radius: 10px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --space: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --studio-gap: 14px;
  --studio-pad: 20px;
  --shadow: 0 8px 22px rgba(26, 26, 46, 0.06);
  --page-w: 1120px;
  --tool-w: 1080px;
  /* 字号阶梯 */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.875rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --lh-tight: 1.25;
  --lh-body: 1.6;
  --lh-lead: 1.7;
  --font: var(--xjb-font);
  --font-mono: var(--xjb-font-mono);
  --font-num: var(--xjb-font);
  color-scheme: light;
}

html[data-theme="dark"] .brand-tag {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}
html[data-theme="dark"] {
  --brand: #a78bfa;
  --brand-2: #8b5cf6;
  --brand-soft: rgba(139, 92, 246, 0.16);
  --bg: #0f1117;
  --sidebar: #151821;
  --surface: #1a1d27;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --line: #2a2f3a;
  --good: #3dcea0;
  --accent: #818cf8;
  --ink: #e5e7eb;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  --btn-primary-shadow: 0 6px 16px rgba(139, 92, 246, 0.28);
  --btn-secondary-border: color-mix(in srgb, var(--brand) 45%, var(--line));
  --btn-tertiary-color: #9ca3af;
  color-scheme: dark;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.015em;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
}
.site-head {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px 16px;
  min-height: 64px;
  padding: 10px max(20px, calc((100% - var(--page-w)) / 2));
  background: color-mix(in srgb, #fff 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1;
  min-width: 0;
}
.brand img {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
}
.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}
.brand-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #ebe9ff;
  color: #5b5fef;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.market-nav {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  margin-left: 18px;
}
.market-nav a {
  color: #4b5563;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.market-nav a:hover { color: var(--brand); }
.icon-btn {
  width: var(--control-h);
  height: var(--control-h);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--text); }
.head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.auth-btn {
  display: inline-flex;
  align-items: center;
  height: var(--control-h);
  padding: 0 18px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #5b5fef, #7c5cff);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(91, 95, 239, 0.28);
}
.auth-btn:hover {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #4f53e8, #6d4ff5);
  box-shadow: 0 10px 22px rgba(91, 95, 239, 0.34);
}
.user-menu { position: relative; }
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  height: var(--control-h);
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 8px 0 4px;
  border-radius: var(--radius);
}
.user-btn:hover { background: var(--bg); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex-shrink: 0;
}
.user-avatar.lg { width: 44px; height: 44px; }
.user-avatar.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
}
.user-avatar.lg.fallback { font-size: 1.05rem; }
.user-name {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.user-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
  z-index: 40;
}
.user-drop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.user-drop-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-drop-id strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-drop-id span,
.user-drop-dl dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.user-drop-id span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-drop-dl {
  margin: 10px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-drop-dl > div {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: baseline;
}
.user-drop-dl dt,
.user-drop-dl dd { margin: 0; }
.user-drop-dl dd { font-size: 0.84rem; word-break: break-all; }
.user-drop-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 4px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}
.user-drop-link,
.user-drop-logout {
  display: flex;
  align-items: center;
  height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}
.user-drop-logout { justify-content: center; color: var(--muted); }
.user-drop-link:hover,
.user-drop-logout:hover { background: var(--bg); color: var(--text); }
.menu-btn { display: none; }
.tool-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.tool-search {
  position: relative;
  flex: 0 1 250px;
  width: 250px;
  max-width: 250px;
  min-width: 140px;
  margin-left: 8px;
}
.tool-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 14px;
  border: 1px solid #e4e2f0;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.tool-search-field:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, #e4e2f0);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-soft);
  color: var(--text);
}
.tool-search-field svg { flex: none; }
.tool-search-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
}
.tool-search-field input:focus { outline: none; }
.tool-search-field input::placeholder { color: var(--muted); }
.tool-search-field input::-webkit-search-cancel-button { cursor: pointer; }
.tool-search-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: min(420px, calc(100vw - 28px));
  min-width: 100%;
  z-index: 40;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.tool-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text);
}
.tool-search-item strong,
.tool-search-item em {
  display: block;
  font-style: normal;
}
.tool-search-item strong { font-size: 0.875rem; font-weight: 600; }
.tool-search-item em { margin-top: 2px; color: var(--muted); font-size: 0.75rem; }
.tool-search-item mark {
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}
.tool-search-icon {
  display: inline-flex;
  flex: none;
  color: var(--brand);
}
.tool-search-item.is-active,
.tool-search-item:hover { background: var(--brand-soft); }
.tool-search-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.nav-group { position: relative; }
.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-group-btn:hover,
.nav-group-btn[aria-expanded="true"],
.nav-group.is-current .nav-group-btn {
  background: var(--brand-soft);
  color: var(--text);
}
.nav-group-current {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}
.nav-group-current:empty { display: none; }
.nav-caret { flex: none; color: var(--muted); }
.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 280px;
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--text);
}
.nav-link:hover,
.nav-link.active { background: var(--brand-soft); }
.nav-link-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.nav-link-icon svg { width: 18px; height: 18px; }
.nav-link-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link-text strong { font-size: 0.875rem; font-weight: 600; }
.nav-link-text span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.main {
  min-width: 0;
  background: var(--bg);
}
#view {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home {
  padding: 0 0 72px;
  background:
    radial-gradient(ellipse 70% 48% at 50% -8%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #fff) 0%, var(--bg) 100%);
}
.home-inner {
  width: min(var(--page-w), calc(100% - 40px));
  margin: 0 auto;
}
.home-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 6vw, 72px) 0 clamp(28px, 3.5vw, 40px);
  text-align: center;
  animation: home-hero-in 0.55s ease both;
}
.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: min(40rem, 100%);
  margin: 0 auto;
}
.home-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.6vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--ink);
}
.home-title-grad {
  background: linear-gradient(90deg, var(--brand-2) 0%, var(--brand) 48%, #4f7cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-intro {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: var(--fs-lg);
  line-height: var(--lh-lead);
}
.home-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--btn-primary-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.home-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(91, 95, 239, 0.24);
}
.home-hero-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
}
.home-catalog {
  padding: 8px 0 0;
}
.home-catalog-head {
  margin: 0 0 18px;
  text-align: left;
}
.home-catalog-title {
  margin: 0;
  font-size: clamp(1.2rem, 1rem + 0.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-catalog-lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
.home-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 100%;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.home-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  box-shadow: 0 12px 28px rgba(26, 26, 46, 0.08);
}
a.home-card:hover .home-card-cta { color: var(--brand); }
a.home-card:hover .home-card-cta span {
  transform: translateX(3px);
}
.home-card.is-soon {
  opacity: 0.92;
  cursor: default;
}
.home-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.home-card-icon.tone-violet { background: linear-gradient(145deg, #8b5cf6, #5b5fef); }
.home-card-icon.tone-sky { background: linear-gradient(145deg, #38bdf8, #3b82f6); }
.home-card-icon.tone-amber { background: linear-gradient(145deg, #fb923c, #f59e0b); }
.home-card-icon.tone-grape { background: linear-gradient(145deg, #a78bfa, #7c5cff); }
.home-card-icon.tone-mint { background: linear-gradient(145deg, #34d399, #22c55e); }
.home-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--ink);
}
.home-card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.home-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
  flex: 1 1 auto;
}
.home-card-cta {
  margin-top: 2px;
  color: var(--brand);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.home-card-cta span {
  display: inline-block;
  transition: transform 0.18s ease;
}
.home-card.is-soon .home-card-cta { color: #9ca3af; }
html[data-theme="dark"] .home {
  background:
    radial-gradient(ellipse 70% 48% at 50% -8%, rgba(139, 92, 246, 0.16), transparent 60%),
    linear-gradient(180deg, #12141c 0%, var(--bg) 100%);
}
html[data-theme="dark"] .home-cta:hover { color: #fff; }
/* 知识卡片：双栏（截图 | 识别）+ 底部卡片库，非三栏 */
.knowledge-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--studio-gap);
  align-items: stretch;
}
.knowledge-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.knowledge-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.knowledge-drop {
  flex: 0 0 auto;
  min-height: 112px;
  margin: 0;
}
.knowledge-drop.has-file {
  min-height: 88px;
}
.knowledge-preview {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7f7fb, #eef0f7);
  overflow: hidden;
}
.knowledge-preview-empty {
  color: var(--muted);
  font-size: 0.875rem;
}
.knowledge-preview-empty[hidden] { display: none; }
.knowledge-preview img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--control-radius);
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.1);
}
.knowledge-preview img[hidden] { display: none; }
.knowledge-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, #fff);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}
.knowledge-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.knowledge-status.is-pending {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.knowledge-status.is-pending .knowledge-status-dot {
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45);
  animation: knowledge-pulse 1.1s ease-out infinite;
}
.knowledge-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 12%, #fff);
  color: var(--good);
}
.knowledge-status.is-ok .knowledge-status-dot { background: var(--good); }
.knowledge-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
}
.knowledge-status.is-error .knowledge-status-dot { background: var(--danger); }
@keyframes knowledge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(91, 95, 239, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0); }
}
.knowledge-parse .field { margin: 0; flex: 1; display: flex; flex-direction: column; }
.knowledge-ocr {
  flex: 1;
  width: 100%;
  min-height: 180px;
  margin: 0;
  resize: vertical;
}
.knowledge-quota { margin: 0; }
.knowledge-actions {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
}
.knowledge-library {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space);
  padding-top: var(--studio-gap);
  border-top: 1px solid var(--line);
}
.knowledge-search {
  width: 100%;
  margin: 0;
}
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: start;
}
.knowledge-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.knowledge-item-top {
  margin-bottom: 8px;
}
.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.knowledge-points {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.knowledge-item-actions {
  margin: 0;
}
@media (max-width: 860px) {
  .knowledge-workspace {
    grid-template-columns: 1fr;
  }
}
@keyframes home-hero-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 960px) {
  .home-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home-hero { padding-top: 36px; padding-bottom: 24px; }
  .home-card-grid { grid-template-columns: 1fr; }
  .home-catalog-head { margin-bottom: 14px; }
}

.tool-scroll { min-width: 0; padding: var(--space-3) 0 var(--space-4); }
.tool { width: min(var(--page-w), calc(100% - 40px)); margin: 0 auto; }
.tool > .panel + .panel { margin-top: var(--space-3); }
.tool-head {
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--line);
}
.tool-head h1 {
  margin: 0;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  color: var(--text);
}
.tool-head .tool-lead,
.tool-head > p {
  margin: var(--space-2) 0 0;
  width: 100%;
  max-width: none;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: var(--lh-lead);
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}
.tool-grid.is-input-wide {
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
}
.panel {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.out-panel { min-height: 0; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.drop strong { color: var(--text); font-size: var(--fs-md); }
.drop span { font-size: var(--fs-xs); line-height: 1.5; }
.drop:hover,
.drop:focus-within,
.drop.is-drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* —— 工具页统一工作室布局 —— */
.tool-studio,
.tool-studio.wide-tool {
  width: min(var(--tool-w), calc(100% - 40px));
}
.tool-studio .studio-head {
  margin-bottom: var(--space-3);
  padding-bottom: 0;
  border-bottom: none;
}
.tool-studio .studio-head h1 {
  font-size: clamp(1.3rem, 1.15rem + 0.65vw, 1.6rem);
  letter-spacing: -0.025em;
  line-height: var(--lh-tight);
}
.tool-studio .studio-head .tool-lead {
  margin-top: 8px;
  width: 100%;
  max-width: 46rem;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
.studio-panel {
  display: flex;
  flex-direction: column;
  gap: var(--studio-gap);
  padding: var(--studio-pad);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}
.studio-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 88%, var(--surface));
}
.studio-seg-item {
  appearance: none;
  min-height: calc(var(--control-h) - 4px);
  padding: 0 10px;
  border: 0;
  border-radius: calc(var(--control-radius) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.studio-seg-item:hover { color: var(--text); }
.studio-seg-item.is-active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.08);
}
.studio-seg-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.studio-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 12px 0 2px;
  background: linear-gradient(180deg, transparent 0%, var(--surface) 28%);
}
.studio-action-bar .ai-quota,
.studio-action-bar .explain-quota,
.studio-action-bar .table-quota,
.studio-action-bar .knowledge-quota,
.studio-action-bar .idphoto-quota {
  margin: 0;
  order: -1;
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.studio-action-bar .studio-actions {
  margin: 0;
}
.studio-action-bar .privacy-actions,
.studio-action-bar .idphoto-actions,
.studio-action-bar .knowledge-actions,
.studio-action-bar .explain-actions,
.studio-action-bar .table-actions {
  margin-top: 0;
}
.studio-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  margin: 0;
  padding: var(--space-4);
  color: var(--muted);
  font-size: var(--fs-base);
  text-align: center;
  line-height: var(--lh-body);
}
.knowledge-preview .studio-empty,
.explain-ai-body .studio-empty,
.idphoto-preview .studio-empty,
.privacy-stage .studio-empty,
.table-sheet .studio-empty,
.backlink-sheet-wrap .studio-empty {
  min-height: 0;
  flex: 1;
  width: 100%;
  padding: var(--space-3);
}
html[data-theme="dark"] .studio-seg {
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
}
html[data-theme="dark"] .studio-seg-item.is-active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .studio-action-bar {
  background: linear-gradient(180deg, transparent 0%, var(--surface) 32%);
}
html[data-theme="dark"] .explain-preview,
html[data-theme="dark"] .knowledge-preview,
html[data-theme="dark"] .privacy-stage,
html[data-theme="dark"] .idphoto-preview {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #000), color-mix(in srgb, var(--bg) 80%, var(--surface)));
}
.studio-panel .field {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  margin: 0;
}
.studio-panel .field-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.tool-studio .btn-primary,
.tool-studio .btn-ghost,
.tool-studio .btn-export {
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 18px;
  border-radius: var(--control-radius);
  box-sizing: border-box;
  font-weight: 600;
  line-height: 1;
}
.tool-studio .btn-primary.is-block,
.tool-studio .btn-ghost.is-block,
.tool-studio .btn-export.is-block {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  margin: 0;
}
.studio-panel select,
.studio-panel .field input[type="text"],
.studio-panel .field input[type="search"],
.studio-textarea,
.studio-ask-row input,
.tool-studio .knowledge-search {
  width: 100%;
  height: var(--control-h);
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-size: var(--control-font);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.studio-textarea,
.tool-studio .knowledge-ocr.studio-textarea {
  height: auto;
  min-height: 160px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  line-height: 1.55;
  resize: vertical;
}
.studio-panel select:focus,
.studio-panel .field input:focus,
.studio-textarea:focus,
.studio-ask-row input:focus,
.tool-studio .knowledge-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.studio-actions,
.tool-studio .ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}
.studio-primary {
  box-shadow: var(--btn-primary-shadow);
}
.studio-primary:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(91, 95, 239, 0.24);
}
.studio-result {
  margin: 0;
  padding-top: var(--studio-gap);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.studio-ai-body {
  min-height: 120px;
  padding: var(--space-3);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 82%, #fff);
  border: 1px solid var(--line);
}
.studio-ai-body .ai-stream {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.studio-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: var(--studio-gap);
  align-items: stretch;
  margin: 0;
}
.studio-side {
  display: flex;
  flex-direction: column;
  gap: var(--studio-gap);
  min-width: 0;
}
.studio-side .field { margin: 0; }
.studio-side .studio-actions,
.studio-side .btn-primary,
.studio-side .btn-ghost {
  margin: 0;
}
.studio-drop {
  margin: 0;
  min-height: 220px;
  border-style: solid;
  border-width: 1.5px;
  border-color: color-mix(in srgb, var(--line) 85%, var(--brand));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 55%, #fff), var(--bg));
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.studio-drop.is-compact {
  min-height: 112px;
}
.studio-drop:hover,
.studio-drop:focus-within,
.studio-drop.is-drag,
.studio-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-soft) 70%, transparent);
}
.studio-drop-emoji {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 2px;
}
.studio-ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
}
.studio-ask-row .btn-primary,
.studio-ask-row .studio-primary {
  white-space: nowrap;
}
.tool-studio .ai-quota,
.tool-studio .fine-print,
.tool-studio .backlink-notice {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}
.tool-studio .panel-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: var(--lh-tight);
}

/* 解析引擎 / 表格分析：与知识卡片同款双栏风格 */
.explain-workspace,
.table-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--studio-gap);
  align-items: stretch;
}
.explain-col,
.table-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.explain-col-title,
.table-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.explain-field-grow,
.table-field-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.explain-textarea,
.table-paste,
.table-question {
  flex: 1;
  min-height: 180px;
  width: 100%;
  margin: 0;
}
.explain-parse .explain-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7f7fb, #eef0f7);
  overflow: auto;
}
.explain-ai-body {
  flex: 1;
  min-height: 180px;
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.explain-ai-body .ai-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
}
.explain-ai-body .ai-stream {
  margin: 0;
  min-height: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
}
.explain-actions,
.table-actions {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
}
.explain-quota,
.table-quota {
  margin: 0;
  font-size: var(--fs-sm);
}
.explain-status,
.table-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, #fff);
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.4;
}
.explain-status-dot,
.table-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.explain-status.is-pending,
.table-status.is-pending {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.explain-status.is-pending .explain-status-dot,
.table-status.is-pending .table-status-dot {
  background: var(--brand);
  animation: knowledge-pulse 1.1s ease-out infinite;
}
.explain-status.is-ok,
.table-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 12%, #fff);
  color: var(--good);
}
.explain-status.is-ok .explain-status-dot,
.table-status.is-ok .table-status-dot { background: var(--good); }
.explain-status.is-error,
.table-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
}
.explain-status.is-error .explain-status-dot,
.table-status.is-error .table-status-dot { background: var(--danger); }
.table-drop {
  flex: 0 0 auto;
  min-height: 112px;
  margin: 0;
}
.table-drop.has-file { min-height: 88px; }
.table-library {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space);
  padding-top: var(--studio-gap);
  border-top: 1px solid var(--line);
}
.table-sheet {
  min-height: 220px;
  margin: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.table-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--muted);
  font-size: var(--fs-base);
  padding: var(--space-4);
}
.table-empty[hidden] { display: none; }
.table-sheet .sheet {
  width: 100%;
  margin: 0;
}
@media (max-width: 860px) {
  .explain-workspace,
  .table-workspace {
    grid-template-columns: 1fr;
  }
}

/* 隐私清扫：原图 | 操作 | 预览 三栏等宽 */
.privacy-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--studio-gap);
  align-items: stretch;
}
.privacy-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.privacy-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.privacy-drop {
  flex: 0 0 auto;
  min-height: 112px;
  margin: 0;
}
.privacy-drop.has-file {
  min-height: 88px;
}
.privacy-source-thumb {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 180px;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--control-radius);
  border: 1px solid var(--line);
  background: var(--bg);
}
.privacy-source-thumb[hidden] { display: none; }
.privacy-list-label {
  margin: var(--space) 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.privacy-controls .privacy-list {
  flex: 1;
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 2px;
  align-content: start;
  align-items: start;
  justify-items: stretch;
  grid-auto-rows: min-content;
}
.privacy-actions {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  margin-top: var(--space);
}
.privacy-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.privacy-select-row .btn-ghost {
  width: 100%;
  margin: 0;
}
.privacy-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, #fff);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}
.privacy-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.privacy-status.is-pending {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.privacy-status.is-pending .privacy-status-dot {
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45);
  animation: privacy-pulse 1.1s ease-out infinite;
}
.privacy-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 12%, #fff);
  color: var(--good);
}
.privacy-status.is-ok .privacy-status-dot { background: var(--good); }
.privacy-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
}
.privacy-status.is-error .privacy-status-dot { background: var(--danger); }
@keyframes privacy-pulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(91, 95, 239, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0); }
}
.privacy-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  margin: 0;
  padding: var(--space-4);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #f7f7fb, #eef0f7);
  text-align: center;
}
.privacy-empty {
  color: var(--muted);
  font-size: 0.875rem;
}
.privacy-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--control-radius);
  box-shadow: 0 12px 32px rgba(26, 26, 46, 0.12);
  background: #fff;
}
.privacy-canvas[hidden] { display: none; }
.privacy-empty[hidden] { display: none; }
@media (max-width: 960px) {
  .privacy-workspace {
    grid-template-columns: 1fr;
  }
}

/* 证件照：原图 | 参数 | 预览 三栏等宽 */
.idphoto-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--studio-gap);
  align-items: stretch;
}
.idphoto-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.idphoto-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.idphoto-drop {
  flex: 0 0 auto;
  min-height: 112px;
  margin: 0;
}
.idphoto-drop.has-file {
  min-height: 88px;
}
.idphoto-source-thumb {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 180px;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--control-radius);
  border: 1px solid var(--line);
  background: var(--bg);
}
.idphoto-source-thumb[hidden] { display: none; }
.idphoto-controls .field { margin: 0; }
.idphoto-actions {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  margin-top: var(--space);
}
.idphoto-quota {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.idphoto-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, #fff);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}
.idphoto-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.idphoto-status.is-pending {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.idphoto-status.is-pending .idphoto-status-dot {
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45);
  animation: idphoto-pulse 1.1s ease-out infinite;
}
.idphoto-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 12%, #fff);
  color: var(--good);
}
.idphoto-status.is-ok .idphoto-status-dot { background: var(--good); }
.idphoto-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
}
.idphoto-status.is-error .idphoto-status-dot { background: var(--danger); }
@keyframes idphoto-pulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(91, 95, 239, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 95, 239, 0); }
}
.idphoto-preview {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #f7f7fb, #eef0f7);
}
.idphoto-empty {
  color: var(--muted);
  font-size: 0.875rem;
}
.idphoto-canvas {
  width: min(100%, 220px);
  height: auto;
  aspect-ratio: var(--idphoto-ratio, 295 / 413);
  border-radius: 2px;
  box-shadow: 0 12px 32px rgba(26, 26, 46, 0.16);
  background: #fff;
}
.idphoto-canvas[hidden] { display: none; }
@media (max-width: 960px) {
  .idphoto-workspace {
    grid-template-columns: 1fr;
  }
}

/* 图片处理：能力 | 画布 | 参数 */
.image-workspace {
  display: grid;
  grid-template-columns: minmax(140px, 168px) minmax(0, 1.35fr) minmax(240px, 0.9fr);
  gap: var(--studio-gap);
  align-items: stretch;
}
.image-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.image-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.image-mode-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-mode-btn {
  appearance: none;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 85%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
}
.image-mode-btn:hover { color: var(--text); }
.image-mode-btn.is-active {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.image-drop { min-height: 112px; margin: 0; }
.image-drop.has-file { min-height: 88px; }
.image-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7f7fb, #eef0f7);
  overflow: hidden;
}
.image-stage.is-batch { min-height: 180px; }
.image-stage-canvas {
  display: block;
  max-width: 100%;
  max-height: min(58vh, 520px);
  width: auto;
  height: auto;
  border-radius: var(--control-radius);
  box-shadow: 0 10px 28px rgba(26, 26, 46, 0.1);
  background:
    linear-gradient(45deg, #ececf1 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #ececf1 25%, transparent 25%) 0 8px / 16px 16px,
    #fff;
}
.image-stage-canvas[hidden] { display: none; }
.image-empty { width: 100%; }
.image-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}
.image-params {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.image-params .field { margin: 0; }
.image-section-label {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}
.image-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.image-btn-grid .btn-ghost {
  width: 100%;
  margin: 0;
}
.image-estimate,
.image-batch-progress {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.image-base64-area {
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.45;
  word-break: break-all;
}
/* 复选框行：强制横排 + 垂直居中（避免被 label/field 列布局影响） */
.check-row,
.image-check {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  min-height: 24px;
  font-size: var(--fs-sm);
  line-height: 1.25;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.privacy-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.25;
  color: var(--text);
  cursor: pointer;
}
.check-row > input[type="checkbox"],
.image-check > input[type="checkbox"],
.privacy-item > input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 16px;
  align-self: center;
  vertical-align: middle;
  accent-color: var(--brand);
}
.check-row > span,
.image-check > span,
.privacy-item > span {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  line-height: 1.25;
}
.image-batch-drop { margin: 0; }
.image-batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}
.image-batch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 80%, var(--surface));
}
.image-batch-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
}
.image-batch-item span {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.image-batch-item .btn-ghost {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: var(--fs-xs);
}
.image-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, #fff);
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.4;
}
.image-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}
.image-status.is-pending {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.image-status.is-pending .image-status-dot {
  background: var(--brand);
  animation: knowledge-pulse 1.1s ease-out infinite;
}
.image-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 12%, #fff);
  color: var(--good);
}
.image-status.is-ok .image-status-dot { background: var(--good); }
.image-status.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
}
.image-status.is-error .image-status-dot { background: var(--danger); }
.image-actions {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}
.image-crop-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: visible;
}
.image-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid var(--brand);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  cursor: move;
  touch-action: none;
}
.image-crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
  border: 1.5px solid var(--brand);
  pointer-events: auto;
}
.image-crop-handle.is-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.image-crop-handle.is-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.image-crop-handle.is-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.image-crop-handle.is-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
html[data-theme="dark"] .image-stage {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #000), color-mix(in srgb, var(--bg) 80%, var(--surface)));
}
html[data-theme="dark"] .image-stage-canvas {
  background:
    linear-gradient(45deg, #2a2a30 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #2a2a30 25%, transparent 25%) 0 8px / 16px 16px,
    #16161a;
}
html[data-theme="dark"] .image-status.is-ok,
html[data-theme="dark"] .image-status.is-error {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
@media (max-width: 960px) {
  .image-workspace {
    grid-template-columns: 1fr;
  }
  .image-mode-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .image-mode-btn {
    text-align: center;
    padding: 0 6px;
    font-size: 0.72rem;
  }
}
.tool-studio .result-sheet {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
}
.tool-studio .knowledge-ocr {
  width: 100%;
  margin: 0;
}
.tool-studio .knowledge-search {
  margin: 0;
}
.tool-studio .privacy-list,
.tool-studio .knowledge-list {
  margin: 0;
}
@media (max-width: 860px) {
  .studio-split {
    grid-template-columns: 1fr;
  }
  .studio-drop {
    min-height: 160px;
  }
  .studio-ask-row {
    grid-template-columns: 1fr;
  }
  .studio-ask-row .btn-primary,
  .studio-ask-row .studio-primary {
    width: 100%;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  margin-bottom: var(--space-3);
}
.field > span,
.field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.field-label { display: block; margin: 0 0 var(--space); }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.panel > input[readonly],
.studio-ask-row input,
.tool-studio .knowledge-search {
  width: 100%;
  height: var(--control-h);
  min-height: var(--control-h);
  max-height: var(--control-h);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--control-radius);
  padding: 0 12px;
  font-size: var(--control-font);
  line-height: 1;
  outline: none;
  box-sizing: border-box;
}
.field textarea,
.panel > textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--control-radius);
  padding: 8px 12px;
  font-size: var(--control-font);
  outline: none;
  box-sizing: border-box;
}
.field input::placeholder,
.field textarea::placeholder,
.panel > textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.field textarea,
.panel > textarea {
  height: auto;
  min-height: calc(var(--control-h) * 5);
  max-width: 100%;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: var(--control-font);
  resize: vertical;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.wide-tool .panel > .btn-primary { width: fit-content; }
.panel > input[readonly] {
  display: block;
  margin-top: var(--space-3);
}

.sheet-wrap { overflow: auto; }
.sheet-preview { width: 100%; border-collapse: collapse; margin-top: var(--space-3); font-size: 0.875rem; }
.sheet-preview th, .sheet-preview td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.compare.is-better { border-color: var(--brand); }
.qr-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--bg)), var(--surface));
}
.qr-stage canvas {
  display: block;
  width: min(100%, 280px);
  height: auto;
  image-rendering: pixelated;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(26, 26, 46, 0.08);
}
.qrcode-workspace {
  display: grid;
  grid-template-columns: minmax(120px, 148px) minmax(0, 1.2fr) minmax(240px, 0.95fr);
  gap: var(--studio-gap);
  align-items: stretch;
}
.qrcode-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.qrcode-col-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.qrcode-mode-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qrcode-mode-btn {
  appearance: none;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 85%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
}
.qrcode-mode-btn:hover { color: var(--text); }
.qrcode-mode-btn.is-active {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.qrcode-input,
.qrcode-result {
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--control-font);
  line-height: 1.5;
  resize: vertical;
}
.qrcode-result { min-height: 140px; }
.qrcode-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.qrcode-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.qrcode-color-row input[type='color'] {
  width: 100%;
  min-height: var(--control-h);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--bg);
}
.qrcode-drop { min-height: 140px; margin: 0; }
.qrcode-drop.has-file { min-height: 96px; }
.qrcode-parse-thumb {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.qrcode-parse-thumb[hidden] { display: none; }
.qrcode-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-sm);
}
.qrcode-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}
.qrcode-status.is-ok { color: var(--text); }
.qrcode-status.is-ok .qrcode-status-dot { background: #2f9e44; }
.qrcode-status.is-error { color: var(--text); }
.qrcode-status.is-error .qrcode-status-dot { background: #e03131; }
.qrcode-status.is-pending .qrcode-status-dot {
  background: var(--brand);
  animation: qrcode-pulse 1s ease-in-out infinite;
}
@keyframes qrcode-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}
.qrcode-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  pointer-events: none;
}
.qrcode-empty[hidden] { display: none; }
.qrcode-actions { display: grid; gap: 8px; }
@media (max-width: 960px) {
  .qrcode-workspace {
    grid-template-columns: 1fr;
  }
  .qrcode-mode-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .qrcode-mode-btn {
    width: auto;
    flex: 1 1 auto;
    text-align: center;
  }
}

.studio-preview {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.id-stage {
  position: relative;
  width: min(100%, 280px);
  margin: 12px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: grab;
  touch-action: none;
}
.id-stage.is-dragging { cursor: grabbing; }
.id-stage.is-clear {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececf1 25%, transparent 25%),
    linear-gradient(-45deg, #ececf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececf1 75%),
    linear-gradient(-45deg, transparent 75%, #ececf1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.id-stage img {
  position: absolute;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.media-stage {
  display: block;
  max-width: min(100%, 420px);
  height: auto;
  margin: 0 auto var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.media-stage.is-clear {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececf1 25%, transparent 25%),
    linear-gradient(-45deg, #ececf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececf1 75%),
    linear-gradient(-45deg, transparent 75%, #ececf1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.id-guide {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 8%;
  height: 58%;
  border: 1px dashed rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.unit-row .link-btn { flex: none; }

.text-actions:not(:empty),
.actions:not(:empty) { margin-bottom: var(--space-3); }
.field input[type="range"] {
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--brand);
}

.field .color-field input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex: none;
  overflow: hidden;
}
.field .color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.field .color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: var(--radius-sm);
}
.field .color-field input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: var(--radius-sm);
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
.panel > textarea:focus,
.panel > input[readonly]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field .chip-box input.chip-box-input {
  flex: 1 1 7rem;
  width: auto;
  min-width: 7rem;
  height: calc(var(--control-h) - 12px);
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: var(--control-font);
  line-height: calc(var(--control-h) - 12px);
  outline: none;
}
.field .chip-box input.chip-box-input:focus {
  border: 0;
  box-shadow: none;
}

.sheet-wrap + .panel-title { margin-top: var(--space-3); }

.sheet td.pos { color: var(--brand); font-weight: 600; }
.sheet td.neg { color: var(--danger); font-weight: 600; }
.field > .link-btn { margin-top: var(--space); }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.84rem;
}
.check input { accent-color: var(--brand); }
.form-error { margin: var(--space) 0 0; color: var(--danger); font-size: 0.8125rem; line-height: 1.5; }
.fine-print { margin: var(--space) 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.55; }
.panel-title { margin: 0 0 var(--space-2); font-size: var(--fs-base); font-weight: 700; line-height: var(--lh-tight); }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.split-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}
.split-3 > .field { margin-bottom: 0; }

.diff-sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 8px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.diff-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
}
.diff-cell {
  min-height: 1.5em;
  padding: 0 10px;
  white-space: pre-wrap;
  word-break: break-all;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.diff-cell.diff-add { background: color-mix(in srgb, var(--good) 16%, transparent); }
.diff-cell.diff-del { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.diff-cell.diff-pad { background: color-mix(in srgb, var(--line) 40%, transparent); }
.working { margin: 0; color: var(--muted); }
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: var(--space-3);
  text-align: center;
  gap: 6px;
  color: var(--muted);
}
.empty strong { color: var(--text); font-size: 0.95rem; }
.empty span { font-size: 0.8rem; max-width: 280px; line-height: 1.5; }

.delta { font-size: 0.82rem; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--danger); }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space); margin-top: var(--space-3); }
.actions + .seg { margin-top: var(--space-3); }
/* 按钮形态：主要 btn-primary · 次要 btn-ghost/btn-export · 三级 link-btn */
.btn-primary,
.btn-ghost,
.btn-export,
.link-btn,
.auth-btn,
button.btn-primary,
button.btn-ghost,
button.btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  min-height: var(--control-h);
  max-height: var(--control-h);
  margin: 0;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
/* 主要按钮 */
.btn-primary {
  background: var(--btn-primary-bg);
  border-color: transparent;
  color: var(--btn-primary-color);
  box-shadow: var(--btn-primary-shadow);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  color: var(--btn-primary-color);
  box-shadow: 0 8px 18px rgba(91, 95, 239, 0.24);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}
/* 次要按钮 */
.btn-ghost,
.btn-export {
  background: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-color);
}
.btn-ghost:hover:not(:disabled),
.btn-export:hover:not(:disabled) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--surface));
  color: var(--brand-2);
}
.btn-ghost:disabled,
.btn-export:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* 三级按钮 */
.link-btn {
  background: var(--btn-tertiary-bg);
  border-color: transparent;
  color: var(--btn-tertiary-color);
  padding: 0 10px;
  font-weight: 500;
}
.link-btn:hover:not(:disabled) {
  background: var(--brand-soft);
  color: var(--brand);
}
.head-actions .link-btn {
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 12px;
  border-radius: var(--control-radius);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--btn-tertiary-color);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}
.head-actions .link-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.panel > .link-btn,
.panel > .btn-ghost,
.panel > .btn-export {
  display: flex;
  width: fit-content;
  margin: var(--space-3) 0;
}
.panel > .btn-primary {
  display: flex;
  width: 100%;
  margin: var(--space-3) 0;
}
.studio-panel > .btn-primary,
.studio-panel > .btn-ghost,
.studio-panel > .btn-export,
.studio-panel > .link-btn,
.studio-actions > .btn-primary,
.studio-actions > .btn-ghost,
.studio-actions > .btn-export {
  width: auto;
  margin: 0;
}
.studio-panel > .btn-primary.is-block,
.studio-panel > .btn-ghost.is-block,
.studio-panel > .btn-export.is-block,
.studio-actions > .btn-primary.is-block,
.studio-actions > .btn-ghost.is-block,
.studio-actions > .btn-export.is-block {
  width: 100%;
}
table.result-table th,
table.result-table td {
  text-align: left;
  vertical-align: middle;
}
table.result-table td.num { text-align: right; }
table.result-table td.delta { margin: 0; }
.result-table .preview-cell { width: 52px; }
.result-table .thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececf1 25%, transparent 25%),
    linear-gradient(-45deg, #ececf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececf1 75%),
    linear-gradient(-45deg, transparent 75%, #ececf1 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  display: block;
}
html[data-theme="dark"] .result-table .thumb {
  background-color: #16161a;
  background-image:
    linear-gradient(45deg, #2a2a30 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a30 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a30 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a30 75%);
}
.result-table .file-name { max-width: 168px; }

.result-table .form-error { margin: 0; }

.hero { margin-bottom: 14px; }
.kicker { margin: 0 0 4px; color: var(--muted); font-size: 0.78rem; }
.hero-num {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero-num small {
  margin-left: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.stat {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}
.stat em { display: block; margin-bottom: 4px; color: var(--muted); font-style: normal; font-size: 0.75rem; font-weight: 600; }
.stat b { display: block; font-size: 0.98rem; font-weight: 700; }
.parts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.compare {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.compare p { margin: 0; color: var(--text); font-size: 0.86rem; line-height: 1.55; }
.compare span { color: var(--muted); }
.sheet tr.is-prepay td { color: var(--brand); font-weight: 600; }
.part-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 0.86rem;
}
.sheet-wrap,
.result-sheet {
  overflow: auto;
  max-height: 420px;
  margin-top: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.result-sheet { margin-top: 0; max-height: 520px; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.sheet th,
.sheet td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sheet tr:last-child td { border-bottom: 0; }
.sheet th:first-child,
.sheet td:first-child { text-align: left; }
.sheet th {
  position: sticky;
  top: 0;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
}
.out-panel .actions { margin-top: var(--space-3); }
.noscript {
  margin: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.site-foot {
  margin-top: 48px;
  padding: 12px max(16px, calc((100% - var(--page-w)) / 2)) calc(12px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  border-top: 1px solid var(--line);
}
.legal-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
}
.legal-nav a {
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: none;
}
.legal-nav a:hover { color: var(--text); }

.beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 16px;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.beian a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 17px;
  color: var(--muted);
  text-decoration: none;
  line-height: 17px;
}
.beian a:hover { color: var(--text); }
.beian img,
.beian-icon {
  display: block;
  width: 16px;
  height: 17px;
  max-width: none;
  flex: 0 0 16px;
  object-fit: contain;
}

.legal-wrap {
  background: var(--bg);
  color: var(--text);
}
.legal-inner {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 16px 32px;
}
.legal-back { display: inline-block; margin-bottom: 18px; color: var(--brand); font-size: 0.95rem; }
.legal-inner h1 { margin: 0 0 8px; font-size: 1.55rem; font-weight: 600; }
.legal-meta { margin: 0 0 22px; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.legal-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
}
.legal-body h2 { margin: 22px 0 10px; font-size: 1.05rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p,
.legal-body li { line-height: 1.65; font-size: 0.95rem; }
.legal-body p { margin: 0 0 10px; }
.legal-body ul,
.legal-body ol { margin: 0 0 10px; padding-left: 1.2em; }
.legal-body li { margin-bottom: 6px; }
.nf {
  background: var(--bg);
}
.nf-card {
  width: min(420px, calc(100% - 40px));
  margin: 64px auto 40px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 24px 28px;
  box-shadow: var(--shadow);
}
.nf-card img {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}
.nf-code {
  margin: 0;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand);
}
.nf-card h1 { margin: 4px 0 8px; font-size: 1.35rem; }
.nf-card p { margin: 0 0 20px; color: var(--muted); }
.nf .site-foot { width: 100%; }
.city-picker { position: relative; }
.city-panel {
  position: fixed;
  z-index: 40;
  overflow: auto;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.city-letters,
.city-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.city-letters { margin-bottom: 10px; }
.city-letters button,
.city-grid button {
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: var(--control-font);
  font-weight: 600;
  line-height: 1;
}
.city-letters button { min-width: var(--control-h); padding: 0 8px; color: var(--brand); }
.city-letters button[aria-pressed="true"] { background: #5b5fef; color: #fff; }
.city-grid button:hover,
.city-grid button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.city-empty { margin: 4px 0 0; color: var(--muted); font-size: 0.8125rem; }

.tool-boot {
  width: min(var(--page-w), calc(100% - 40px));
  margin: 48px auto;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.tool-boot.is-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .site-head { flex-wrap: wrap; padding: 10px 14px; }
  .tool-search { order: 4; flex: 1 0 100%; min-width: 0; margin-left: 0; }
  .head-actions { order: 3; margin-left: auto; }
  .market-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    order: 5;
    gap: 4px;
    margin: 8px 0 0;
    padding-top: 4px;
  }
  .market-nav a {
    padding: 12px 4px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }
  .app.nav-open .market-nav { display: flex; }
  .tool-nav { display: none !important; }
  .nav-group-btn { width: 100%; justify-content: flex-start; }
  .nav-caret { display: none; }
  .nav-menu {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 0 0 4px;
    padding: 0 0 4px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .home-inner { width: min(var(--page-w), calc(100% - 28px)); }
  .tool-grid,
  .stat-grid,
  .compare-grid,
  .split-2 { grid-template-columns: 1fr; }
  .tool-studio,
  .tool-studio.wide-tool,
  .tool { width: min(var(--tool-w), calc(100% - 28px)); }
  .tool-boot { width: min(var(--tool-w), calc(100% - 28px)); margin: 32px auto; }

  /* Avoid iOS zoom on focus; keep tap targets usable */
  .field input,
  .field select,
  .field textarea,
  .panel > textarea,
  .panel > input[readonly],
  .tool-search-field input {
    font-size: 16px;
  }

  .drop {
    min-height: 148px;
    padding: var(--space-4) var(--space-3);
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .actions .btn-primary,
  .actions .btn-ghost,
  .panel > .btn-primary,
  .panel > .btn-ghost {
    height: var(--control-h);
    min-height: var(--control-h);
    flex: 1 1 auto;
  }

}



.swal2-popup { font-family: var(--font); }
.tools-toast-container.swal2-center {
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
.tools-toast {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  max-width: min(420px, calc(100vw - 32px)) !important;
  width: auto !important;
  min-width: min(240px, calc(100vw - 32px)) !important;
  padding: 14px 20px !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}
.tools-toast .swal2-title,
.tools-toast-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  color: var(--text) !important;
  text-align: left !important;
}
.tools-toast .swal2-icon {
  margin: 0 !important;
  width: 1.6em !important;
  height: 1.6em !important;
  min-width: 1.6em !important;
  border-width: 0.15em !important;
  flex-shrink: 0 !important;
}
.tools-toast .swal2-timer-progress-bar { background: var(--brand); }

/* 前缀 + 域名 + 按钮：标准 input-group，单一外框 */
.backlink-domain {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 36rem;
  height: var(--control-h);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.backlink-domain:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.backlink-scheme {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  cursor: text;
}
.field input.backlink-domain-input,
.field input.backlink-domain-input:hover,
.field input.backlink-domain-input:focus {
  box-sizing: border-box;
  flex: 1 1 0%;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--text);
  font-size: var(--control-font);
  line-height: 1.25;
}
.backlink-domain .backlink-submit,
.backlink-domain .btn-primary.backlink-submit,
.backlink-domain .btn-ghost.backlink-submit {
  flex: 0 0 auto;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.backlink-domain .btn-primary.backlink-submit {
  background: var(--brand) !important;
  border-left-color: var(--brand) !important;
  color: #fff !important;
}
.backlink-domain .btn-primary.backlink-submit:hover {
  background: var(--brand-2) !important;
  border-left-color: var(--brand-2) !important;
  color: #fff !important;
}
.backlink-domain .btn-ghost.backlink-submit {
  background: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-color) !important;
}
.backlink-domain .btn-ghost.backlink-submit:hover {
  background: color-mix(in srgb, var(--brand-soft) 65%, var(--surface)) !important;
  color: var(--brand-2) !important;
}
@media (max-width: 640px) {
  .backlink-domain {
    max-width: none;
    height: auto;
    flex-wrap: wrap;
  }
  .backlink-scheme {
    flex: 0 0 auto;
    min-height: var(--control-h);
  }
  .field input.backlink-domain-input {
    flex: 1 1 8rem !important;
    min-height: var(--control-h) !important;
  }
  .backlink-domain .backlink-submit {
    flex: 1 1 100%;
    min-height: var(--control-h);
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
.backlink-progress-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.backlink-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0;
}
.backlink-progress-head .panel-title {
  margin: 0;
}
.backlink-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.backlink-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}
.backlink-notice.is-idle {
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  color: var(--muted);
}
.backlink-notice.is-info {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.backlink-notice.is-warn {
  border-color: color-mix(in srgb, #eab308 35%, var(--line));
  background: color-mix(in srgb, #eab308 12%, var(--surface));
}
.backlink-notice.is-ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
}
.backlink-notice.is-error {
  border-color: color-mix(in srgb, var(--danger, #dc2626) 35%, var(--line));
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, var(--surface));
  color: var(--danger, #dc2626);
}
html[data-theme="dark"] .backlink-notice.is-warn {
  border-color: color-mix(in srgb, #eab308 28%, var(--line));
  background: color-mix(in srgb, #eab308 10%, var(--surface));
}
.backlink-progress {
  position: relative;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.backlink-progress-fill {
  height: 100%;
  width: 0;
  background: var(--good);
  transition: width 0.25s ease;
}
.backlink-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}
.backlink-sheet {
  table-layout: fixed;
}
.backlink-sheet th,
.backlink-sheet td {
  padding: 7px 10px;
  vertical-align: middle;
  line-height: 1.35;
}
.backlink-sheet th:nth-child(1),
.backlink-sheet td:nth-child(1) {
  width: 52px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.backlink-sheet th:nth-child(2),
.backlink-sheet td.backlink-url {
  text-align: left;
  white-space: normal;
  word-break: break-all;
}
.backlink-sheet th:nth-child(3),
.backlink-sheet td.backlink-status {
  width: 56px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
  vertical-align: middle;
}
.backlink-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  line-height: 0;
}
.backlink-check svg {
  display: block;
  flex: 0 0 auto;
}
.backlink-check.is-wait {
  color: color-mix(in srgb, var(--brand) 55%, #94a3b8);
  animation: backlink-check-pulse 1.05s ease-in-out infinite;
}
.backlink-check.is-ok {
  color: var(--good);
}
.backlink-check.is-bad {
  color: var(--danger, #dc2626);
}
@keyframes backlink-check-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.backlink-hit-host {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.backlink-hit-frame {
  display: block;
  width: 0 !important;
  height: 0 !important;
  border: 0;
  overflow: hidden;
}
.backlink-sheet td.backlink-url a {
  color: var(--brand);
  text-decoration: none;
}
.backlink-sheet td.backlink-url a:hover {
  text-decoration: underline;
}
.backlink-sheet-wrap {
  position: relative;
  max-height: min(420px, 55vh);
  min-height: 9rem;
}
.backlink-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8.5rem;
  padding: 1.25rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
  text-align: center;
}
.backlink-empty[hidden],
.backlink-sheet[hidden] {
  display: none !important;
}
.backlink-tips .backlink-tip-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.backlink-tips .backlink-tip-list li + li {
  margin-top: 0.35rem;
}
.backlink-tool .studio-panel .field {
  max-width: 36rem;
}

/* —— AI 工具站视觉 —— */
html.is-home body,
body {
  background:
    radial-gradient(1200px 480px at 12% -10%, rgba(13, 148, 136, 0.12), transparent 60%),
    radial-gradient(900px 420px at 92% 0%, rgba(194, 65, 12, 0.06), transparent 55%),
    var(--bg);
}
.ai-quota {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.ai-body { min-height: 120px; }
.ai-placeholder { color: var(--muted); margin: 0; }
.ai-stream {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.65;
  max-height: 420px;
  overflow: auto;
}
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: var(--fs-sm); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
}
.privacy-list {
  display: grid;
  gap: 8px;
}
.privacy-item {
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  font-size: 0.875rem;
  min-height: 0;
}
.site-head .brand-tag {
  border: 0;
  color: #5b5fef;
  background: #ebe9ff;
}

.ip-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--bg);
}
.ip-input-row:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}
.field input.ip-input,
.field input.ip-input:hover,
.field input.ip-input:focus {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: var(--control-h) !important;
  margin: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  font-family: var(--font-mono);
}
.ip-input-row .ip-submit {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ip-result-panel { margin-top: var(--space-3); }
.ip-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.ip-result-head .panel-title { margin: 0; }
.ip-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
}
.ip-notice {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--control-radius);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.ip-notice.is-idle {
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
}
.ip-notice.is-info {
  color: var(--text);
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
}
.ip-notice.is-ok {
  color: var(--text);
  background: color-mix(in srgb, #2f9e44 10%, var(--surface));
  border-color: color-mix(in srgb, #2f9e44 28%, var(--line));
}
.ip-notice.is-error {
  color: var(--text);
  background: color-mix(in srgb, #e03131 10%, var(--surface));
  border-color: color-mix(in srgb, #e03131 28%, var(--line));
}
.ip-result-grid {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0 0 var(--space-3);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
}
.ip-result-grid dt {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.ip-result-grid dd {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--control-font);
  overflow-wrap: anywhere;
}
.ip-empty { margin: 0 0 var(--space-3); }
.ip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 720px) {
  .ip-input-row {
    flex-wrap: wrap;
  }
  .field input.ip-input {
    flex: 1 1 100%;
  }
  .ip-input-row .ip-submit {
    flex: 1 1 auto;
  }
  .ip-result-grid {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .ip-result-grid dd {
    margin-bottom: 10px;
  }
}

/* 全局统一：按钮 / 单行输入 / 下拉 = 36px */
:root { --control-h: 36px; }
button.btn-primary,
button.btn-ghost,
button.btn-export,
.auth-btn,
.head-actions .auth-btn,
.tool-search-field input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.field select,
.studio-panel select,
.studio-ask-row input,
.studio-ask-row .btn-primary,
.studio-ask-row .btn-ghost,
.tool-studio .btn-primary,
.tool-studio .btn-ghost,
.tool-studio .btn-export,
.tool-studio .knowledge-search,
.backlink-domain {
  height: var(--control-h) !important;
  min-height: var(--control-h) !important;
  max-height: var(--control-h) !important;
  box-sizing: border-box;
}
