/* ai.jujue.de 样式表：设计令牌与关键尺寸按目标站点实测值复刻。
   令牌值来自浏览器 getComputedStyle 实测，不引用任何外部样式表。 */

:root {
  color-scheme: light;
  --tn-color-primary: #1d4ed8;
  --tn-color-primary-dark: #1e40af;
  --tn-color-primary-text: #1e40af;
  --tn-color-primary-soft: #eff6ff;
  --tn-color-primary-border: #bfdbfe;
  --tn-color-navy: #0f172a;
  --tn-color-navy-dark: #090e1a;
  --tn-color-header-bg: #0f172a;
  --tn-color-bg: #f1f5f9;
  --tn-color-surface: #ffffff;
  --tn-color-surface-subtle: #f8fafc;
  --tn-color-surface-hover: #eef2f6;
  --tn-color-border: #e2e8f0;
  --tn-color-border-strong: #cbd5e1;
  --tn-color-text: #0f172a;
  --tn-color-text-secondary: #334155;
  --tn-color-text-muted: #64748b;
  --tn-color-success: #15803d;
  --tn-color-success-solid: #16a34a;
  --tn-color-success-bg: #f0fdf4;
  --tn-color-success-border: #bbf7d0;
  --tn-color-warning: #b45309;
  --tn-color-warning-solid: #d97706;
  --tn-color-warning-bg: #fffbeb;
  --tn-color-warning-border: #fde68a;
  --tn-color-danger: #dc2626;
  --tn-color-danger-solid: #dc2626;
  --tn-color-danger-bg: #fef2f2;
  --tn-color-danger-border: #fecaca;
  --tn-similarity-blue: #2563eb;
  --tn-similarity-yellow: #eab308;
  --tn-similarity-orange: #f97316;
  --tn-similarity-red: #dc2626;
  --tn-match-1: #ff5050;
  --tn-match-2: #ff9933;
  --tn-match-3: #ffcc33;
  --tn-match-4: #66cc33;
  --tn-match-5: #3399ff;
  --tn-ai-low: #64748b;
  --tn-ai-mid: #d97706;
  --tn-ai-high: #dc2626;
  --tn-radius-sm: 6px;
  --tn-radius-md: 8px;
  --tn-radius-lg: 12px;
  --tn-shadow-card: 0 1px 3px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .03);
  --tn-shadow-md: 0 4px 12px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .04);
  --tn-shadow-soft: 0 1px 2px rgba(15, 23, 42, .04);
  --tn-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --tn-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --tn-line-height-body: 1.6;
  --tn-topbar-height: 56px;
  --tn-nav-width: 244px;
  --tn-ease-spring: cubic-bezier(.16, 1, .3, 1);
  --tn-transition-fast: .15s cubic-bezier(.16, 1, .3, 1);
  --tn-transition-normal: .25s cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --tn-color-primary: #3b82f6;
  --tn-color-primary-dark: #2563eb;
  --tn-color-primary-text: #93c5fd;
  --tn-color-primary-soft: rgba(59, 130, 246, .16);
  --tn-color-primary-border: rgba(96, 165, 250, .35);
  --tn-color-navy: #f8fafc;
  --tn-color-navy-dark: #f1f5f9;
  --tn-color-header-bg: #0f172a;
  --tn-color-bg: #0b1324;
  --tn-color-surface: #111a2e;
  --tn-color-surface-subtle: #162238;
  --tn-color-surface-hover: #1e293b;
  --tn-color-border: #1e293b;
  --tn-color-border-strong: #334155;
  --tn-color-text: #f8fafc;
  --tn-color-text-secondary: #cbd5e1;
  --tn-color-text-muted: #94a3b8;
  --tn-color-success: #4ade80;
  --tn-color-success-solid: #16a34a;
  --tn-color-success-bg: rgba(22, 163, 74, .14);
  --tn-color-success-border: rgba(74, 222, 128, .3);
  --tn-color-warning: #fbbf24;
  --tn-color-warning-solid: #d97706;
  --tn-color-warning-bg: rgba(217, 119, 6, .16);
  --tn-color-warning-border: rgba(251, 191, 36, .32);
  --tn-color-danger: #f87171;
  --tn-color-danger-solid: #dc2626;
  --tn-color-danger-bg: rgba(220, 38, 38, .16);
  --tn-color-danger-border: rgba(248, 113, 113, .32);
  --tn-shadow-card: 0 1px 3px rgba(0, 0, 0, .4);
  --tn-shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --tn-shadow-soft: 0 1px 2px rgba(0, 0, 0, .3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--tn-font-family);
  font-size: 14px;
  line-height: var(--tn-line-height-body);
  color: var(--tn-color-text);
  background: var(--tn-color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--tn-color-primary-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.28;
}

p {
  margin: 0;
}

/* ---------- 通用控件 ---------- */

.tn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--tn-radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--tn-transition-fast), border-color var(--tn-transition-fast),
    color var(--tn-transition-fast), box-shadow var(--tn-transition-fast);
  white-space: nowrap;
}

.tn-button--primary {
  background: var(--tn-color-primary);
  color: #fff;
  border-color: var(--tn-color-primary);
  box-shadow: 0 1px 2px rgba(29, 78, 216, .24);
}

.tn-button--primary:hover:not(:disabled) {
  background: var(--tn-color-primary-dark);
  border-color: var(--tn-color-primary-dark);
}

.tn-button--secondary {
  background: var(--tn-color-surface);
  color: var(--tn-color-text-secondary);
  border-color: var(--tn-color-border-strong);
}

.tn-button--secondary:hover:not(:disabled) {
  background: var(--tn-color-surface-hover);
}

.tn-button--ghost {
  background: transparent;
  color: var(--tn-color-text-secondary);
  border-color: transparent;
}

.tn-button--ghost:hover:not(:disabled) {
  background: var(--tn-color-surface-hover);
}

.tn-button--danger {
  background: var(--tn-color-danger-solid);
  color: #fff;
  border-color: var(--tn-color-danger-solid);
}

.tn-button--large {
  padding: 11px 20px;
  font-size: 14px;
}

.tn-button--xs {
  padding: 4px 9px;
  font-size: 12px;
  gap: 4px;
}

.tn-button--block {
  width: 100%;
}

.tn-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.tn-link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--tn-color-primary-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.tn-link-button:hover {
  text-decoration: underline;
}

.tn-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--tn-color-border-strong);
  border-radius: var(--tn-radius-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--tn-color-text);
  background: var(--tn-color-surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.tn-input::placeholder {
  color: #94a3b8;
}

.tn-input:focus {
  outline: none;
  border-color: var(--tn-color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.tn-input:disabled {
  background: var(--tn-color-surface-subtle);
  color: var(--tn-color-text-muted);
}

.tn-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tn-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tn-color-text-secondary);
}

.tn-field-help {
  font-size: 11.5px;
  color: var(--tn-color-text-muted);
}

.tn-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.tn-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tn-input-wrap .tn-input {
  padding-right: 42px;
}

.tn-input-affix {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 6px;
  border-radius: 5px;
  color: var(--tn-color-text-muted);
  cursor: pointer;
  display: inline-flex;
}

.tn-input-affix:hover {
  color: var(--tn-color-text-secondary);
  background: var(--tn-color-surface-hover);
}

.tn-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: var(--tn-radius-sm);
  background: var(--tn-color-danger-bg);
  border: 1px solid var(--tn-color-danger-border);
  color: var(--tn-color-danger);
  font-size: 12.5px;
  line-height: 1.5;
}

.tn-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: var(--tn-radius-sm);
  background: var(--tn-color-primary-soft);
  border: 1px solid var(--tn-color-primary-border);
  color: var(--tn-color-primary-text);
  font-size: 12.5px;
  line-height: 1.5;
}

.tn-muted {
  color: var(--tn-color-text-muted);
}

.tn-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface-subtle);
  color: var(--tn-color-text-secondary);
  white-space: nowrap;
}

.tn-chip--safe {
  background: var(--tn-color-success-bg);
  border-color: var(--tn-color-success-border);
  color: var(--tn-color-success);
}

.tn-chip--warn {
  background: var(--tn-color-warning-bg);
  border-color: var(--tn-color-warning-border);
  color: var(--tn-color-warning);
}

.tn-chip--danger {
  background: var(--tn-color-danger-bg);
  border-color: var(--tn-color-danger-border);
  color: var(--tn-color-danger);
}

.tn-card {
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  box-shadow: var(--tn-shadow-soft);
}

/* ---------- 登录 / 注册 外壳 ---------- */

.tn-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  background: var(--tn-color-bg);
}

.tn-auth-shell__brand {
  position: relative;
  padding: 52px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 82% 16%, rgba(37, 99, 235, .14), transparent 52%),
    radial-gradient(circle at 14% 86%, rgba(29, 78, 216, .1), transparent 56%),
    linear-gradient(165deg, #eff6ff, #e0ecff 52%, #dbeafe);
  border-right: 1px solid var(--tn-color-primary-border);
  color: #0f172a;
  overflow: hidden;
}

/* 32px 网格 + 径向遮罩：左栏的细纹背景 */
.tn-auth-shell__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 35%, transparent 82%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 35%, transparent 82%);
  pointer-events: none;
}

.tn-auth-shell__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, transparent 60%, rgba(29, 78, 216, .05) 100%);
  pointer-events: none;
}

[data-theme="dark"] .tn-auth-shell__brand {
  background:
    radial-gradient(circle at 82% 16%, rgba(37, 99, 235, .28), transparent 52%),
    radial-gradient(circle at 14% 86%, rgba(29, 78, 216, .18), transparent 56%),
    linear-gradient(165deg, #0b1324, #0f172a 55%, #090e1a);
  border-right-color: var(--tn-color-border);
  color: #fff;
}

[data-theme="dark"] .tn-auth-shell__brand::before {
  background-image:
    linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
}

.tn-auth-shell__brandbody {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 520px;
}

.tn-auth-brandline {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.tn-auth-shell__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(180deg, #3b82f6 0%, var(--tn-color-primary) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, .28);
}

.tn-auth-compliance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid #bfdbfe;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  align-self: flex-start;
}

[data-theme="dark"] .tn-auth-compliance-pill {
  background: rgba(15, 23, 42, .65);
  border-color: rgba(148, 163, 184, .22);
  color: #cbd5e1;
}

.tn-auth-hero-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.22;
}

.tn-auth-hero-tagline {
  font-size: 15px;
  line-height: 1.65;
  color: #334155;
  max-width: 470px;
}

[data-theme="dark"] .tn-auth-hero-tagline {
  color: #cbd5e1;
}

.tn-auth-trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-auth-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(191, 219, 254, .85);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
  font-size: 14px;
  color: #1e293b;
  line-height: 1.5;
}

[data-theme="dark"] .tn-auth-trust-item {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: none;
  color: #e2e8f0;
}

.tn-auth-trust-item svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--tn-color-primary);
}

[data-theme="dark"] .tn-auth-trust-item svg {
  color: #60a5fa;
}

.tn-auth-compliance-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.tn-auth-compliance-row .tn-auth-compliance-pill {
  background: rgba(255, 255, 255, .6);
  font-size: 11px;
}

[data-theme="dark"] .tn-auth-compliance-row .tn-auth-compliance-pill {
  background: rgba(15, 23, 42, .5);
}

.tn-auth-pane {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 24px 48px;
}

.tn-auth-utils {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.tn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  border-radius: 7px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  color: var(--tn-color-text-muted);
  cursor: pointer;
}

.tn-theme-toggle:hover {
  color: var(--tn-color-text-secondary);
  background: var(--tn-color-surface-hover);
}

.tn-lang-switcher {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: var(--tn-color-surface-subtle);
  border: 1px solid var(--tn-color-border);
  padding: 2px;
  gap: 2px;
}

.tn-lang-switcher button {
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  cursor: pointer;
}

.tn-lang-switcher button[aria-pressed="true"] {
  background: var(--tn-color-surface);
  color: var(--tn-color-text);
  box-shadow: var(--tn-shadow-soft);
}

.tn-auth-card {
  width: 100%;
  max-width: 456px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: 14px;
  box-shadow: var(--tn-shadow-md);
  padding: 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tn-auth-card__head {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tn-auth-card__head h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.tn-auth-card__head p {
  font-size: 13px;
  color: var(--tn-color-text-muted);
}

.tn-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tn-captcha-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.tn-captcha-img {
  height: 41px;
  width: 104px;
  border-radius: var(--tn-radius-sm);
  border: 1px solid var(--tn-color-border-strong);
  display: block;
  background: var(--tn-color-surface-subtle);
}

.tn-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tn-color-text-muted);
  font-size: 12px;
}

.tn-auth-divider::before,
.tn-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tn-color-border);
}

.tn-auth-alt {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-auth-alt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--tn-radius-md);
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface-subtle);
  color: inherit;
  transition: border-color var(--tn-transition-fast), background var(--tn-transition-fast);
}

.tn-auth-alt-card:hover {
  text-decoration: none;
  border-color: var(--tn-color-primary-border);
  background: var(--tn-color-primary-soft);
}

.tn-auth-alt-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tn-color-text);
}

.tn-auth-alt-card span {
  font-size: 12px;
  color: var(--tn-color-text-muted);
}

.tn-auth-alt-card svg {
  color: var(--tn-color-text-muted);
  flex: 0 0 auto;
}

.tn-auth-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--tn-color-text-muted);
}

.tn-auth-footer nav {
  display: flex;
  gap: 14px;
}

.tn-auth-footer a {
  color: var(--tn-color-text-muted);
}

/* ---------- 应用外壳 ---------- */

.tn-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--tn-topbar-height) 1fr;
  background: var(--tn-color-bg);
  min-width: 0;
}

.tn-shell__topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--tn-color-surface);
  border-bottom: 1px solid var(--tn-color-border);
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
}

.tn-shell__topbar > * {
  flex: 0 0 auto;
}

.tn-shell__topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tn-color-text);
  letter-spacing: -.01em;
}

.tn-shell__topbar-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(180deg, #2563eb 0%, var(--tn-color-primary) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(29, 78, 216, .24);
}

.tn-shell__topbar-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.tn-topbar-credits {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--tn-color-primary-soft);
  border: 1px solid var(--tn-color-primary-border);
  font-size: 12px;
  color: var(--tn-color-primary-text);
  white-space: nowrap;
  flex: 0 0 auto;
}

.tn-topbar-credits strong {
  font-size: 13px;
  font-weight: 700;
}

.tn-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--tn-color-text-secondary);
  font-size: 12.5px;
}

.tn-topbar-user:hover {
  background: var(--tn-color-surface-hover);
}

.tn-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.tn-shell__body {
  display: grid;
  grid-template-columns: var(--tn-nav-width) minmax(0, 1fr);
  min-height: 0;
  position: relative;
}

.tn-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px 20px;
  background: var(--tn-color-surface);
  border-right: 1px solid var(--tn-color-border);
  overflow-y: auto;
}

.tn-nav__group {
  padding: 12px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tn-color-text-muted);
}

.tn-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--tn-radius-sm);
  color: var(--tn-color-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--tn-transition-fast), color var(--tn-transition-fast);
}

.tn-nav__item:hover {
  background: var(--tn-color-surface-hover);
  color: var(--tn-color-text);
  text-decoration: none;
}

.tn-nav__item.is-active {
  background: var(--tn-color-primary-soft);
  color: var(--tn-color-primary-text);
  font-weight: 600;
}

.tn-nav__item svg {
  flex: 0 0 auto;
  opacity: .85;
}

.tn-nav-icon {
  display: inline-flex;
  width: 18px;
  justify-content: center;
}

.tn-main {
  padding: 22px 26px 44px;
  min-width: 0;
}

.tn-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.tn-page-head h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.012em;
}

.tn-page-description {
  margin-top: 5px;
  font-size: 13px;
  color: var(--tn-color-text-muted);
}

.tn-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 总览 ---------- */

.tn-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.tn-dashboard-card {
  padding: 18px 20px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  box-shadow: var(--tn-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.tn-dashboard-card--credits {
  background:
    radial-gradient(circle at 92% 12%, rgba(37, 99, 235, .1), transparent 60%),
    var(--tn-color-surface);
}

.tn-dashboard-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  letter-spacing: .02em;
}

.tn-dashboard-card__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.tn-dashboard-card__value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  margin-left: 5px;
}

.tn-dashboard-card__foot {
  font-size: 12px;
  color: var(--tn-color-text-muted);
}

.tn-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tn-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  color: inherit;
  transition: border-color var(--tn-transition-fast), box-shadow var(--tn-transition-fast),
    transform var(--tn-transition-fast);
}

.tn-quick-card:hover {
  text-decoration: none;
  border-color: var(--tn-color-primary-border);
  box-shadow: var(--tn-shadow-card);
  transform: translateY(-1px);
}

.tn-quick-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--tn-color-primary-soft);
  color: var(--tn-color-primary);
  flex: 0 0 auto;
}

.tn-quick-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.tn-quick-card span {
  font-size: 11.5px;
  color: var(--tn-color-text-muted);
}

/* ---------- 列表 / 表格 ---------- */

.tn-panel {
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  box-shadow: var(--tn-shadow-soft);
  overflow: hidden;
}

.tn-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tn-color-border);
}

.tn-panel__head h2 {
  font-size: 14.5px;
  font-weight: 700;
}

.tn-panel__body {
  padding: 16px 18px;
}

.tn-panel__body--flush {
  padding: 0;
}

.tn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tn-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tn-color-text-muted);
  padding: 10px 18px;
  background: var(--tn-color-surface-subtle);
  border-bottom: 1px solid var(--tn-color-border);
  white-space: nowrap;
}

.tn-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--tn-color-border);
  vertical-align: middle;
}

.tn-table tr:last-child td {
  border-bottom: 0;
}

.tn-table tbody tr:hover {
  background: var(--tn-color-surface-subtle);
}

.tn-table a {
  font-weight: 600;
}

.tn-num {
  font-family: var(--tn-font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.tn-submission-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.tn-submission-card + .tn-submission-card {
  margin-top: 10px;
}

.tn-submission-card--clickable {
  cursor: pointer;
  color: inherit;
}

.tn-submission-card--clickable:hover {
  text-decoration: none;
  border-color: var(--tn-color-primary-border);
  box-shadow: var(--tn-shadow-card);
}

.tn-submission-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--tn-color-surface-subtle);
  border: 1px solid var(--tn-color-border);
  color: var(--tn-color-text-muted);
  flex: 0 0 auto;
}

.tn-submission-card__title {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-submission-card__meta {
  font-size: 11.5px;
  color: var(--tn-color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tn-submission-card__scores {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tn-score {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 54px;
}

.tn-score__label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  letter-spacing: .03em;
}

.tn-score__value {
  font-family: var(--tn-font-mono);
  font-size: 14px;
  font-weight: 700;
}

.tn-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
  color: var(--tn-color-text-muted);
}

.tn-empty-state svg {
  color: var(--tn-color-border-strong);
}

.tn-empty-state strong {
  font-size: 14px;
  color: var(--tn-color-text-secondary);
}

.tn-empty-state p {
  font-size: 12.5px;
  max-width: 380px;
}

/* ---------- 提交检测 ---------- */

.tn-submit {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.tn-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 24px;
  border: 1.5px dashed var(--tn-color-border-strong);
  border-radius: var(--tn-radius-md);
  background: var(--tn-color-surface-subtle);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tn-transition-fast), background var(--tn-transition-fast);
}

.tn-dropzone:hover,
.tn-dropzone--active {
  border-color: var(--tn-color-primary);
  background: var(--tn-color-primary-soft);
}

.tn-dropzone--busy {
  opacity: .65;
  pointer-events: none;
}

.tn-dropzone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  color: var(--tn-color-primary);
}

.tn-dropzone strong {
  font-size: 14px;
  font-weight: 600;
}

.tn-dropzone span {
  font-size: 12px;
  color: var(--tn-color-text-muted);
}

.tn-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--tn-radius-sm);
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface);
  font-size: 12.5px;
}

.tn-file-chip__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.tn-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--tn-radius-sm);
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface-subtle);
}

.tn-option-row input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: var(--tn-color-primary);
}

.tn-option-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.tn-option-row span {
  font-size: 11.5px;
  color: var(--tn-color-text-muted);
}

.tn-side-card {
  background: var(--tn-color-surface);
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  box-shadow: var(--tn-shadow-soft);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tn-side-card h2 {
  font-size: 13.5px;
  font-weight: 700;
}

.tn-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
  color: var(--tn-color-text-secondary);
}

.tn-side-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.tn-side-list svg {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--tn-color-success);
}

/* ---------- 报告详情 ---------- */

.tn-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.tn-report-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--tn-radius-md);
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface);
}

.tn-report-tile__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  letter-spacing: .03em;
}

.tn-report-tile__value {
  font-family: var(--tn-font-mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.tn-bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--tn-color-surface-hover);
  overflow: hidden;
}

.tn-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width .4s var(--tn-ease-spring);
}

.tn-source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tn-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--tn-radius-sm);
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface);
  font-size: 12.5px;
}

.tn-source-row__url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--tn-font-mono);
  font-size: 11.5px;
  color: var(--tn-color-text-secondary);
}

.tn-doc-inspector {
  border: 1px solid var(--tn-color-border);
  border-radius: var(--tn-radius-md);
  background: var(--tn-color-surface);
  overflow: hidden;
}

.tn-doc-inspector__head {
  padding: 11px 18px;
  border-bottom: 1px solid var(--tn-color-border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tn-color-text-muted);
  background: var(--tn-color-surface-subtle);
}

.tn-doc-inspector__body {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tn-inspector-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tn-inspector-cell span {
  font-size: 11px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  letter-spacing: .03em;
}

.tn-inspector-cell strong {
  font-family: var(--tn-font-mono);
  font-size: 14px;
  font-weight: 700;
}

.tn-text-block {
  margin: 0;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--tn-color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--tn-color-border);
  max-height: 460px;
  overflow: auto;
}

.tn-text-block mark {
  background: rgba(234, 179, 8, .28);
  border-radius: 3px;
  padding: 0 1px;
  color: inherit;
}

/* ---------- 设置 ---------- */

.tn-settings-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--tn-color-border);
}

.tn-settings-row:first-of-type {
  border-top: 0;
}

.tn-settings-row__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tn-color-text-secondary);
}

.tn-settings-row__value {
  font-size: 13px;
  color: var(--tn-color-text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.tn-settings-lang {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tn-settings-theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  background: var(--tn-color-surface-hover);
  border: 1px solid var(--tn-color-border);
  max-width: 280px;
}

.tn-settings-theme-switch button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tn-settings-theme-switch button[aria-pressed="true"] {
  background: var(--tn-color-surface);
  color: var(--tn-color-text);
  box-shadow: var(--tn-shadow-soft);
}

/* ---------- 提示条 ---------- */

.tn-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  max-width: 360px;
}

.tn-toast {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--tn-radius-sm);
  background: var(--tn-color-navy);
  color: #f8fafc;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
  animation: tn-toast-in .22s var(--tn-ease-spring);
}

.tn-toast--error {
  background: #7f1d1d;
}

@keyframes tn-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.tn-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  animation: tn-spin .7s linear infinite;
  display: inline-block;
}

@keyframes tn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1040px) {
  .tn-submit {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 960px) {
  .tn-auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .tn-auth-shell__brand {
    padding: 34px 26px 30px;
    border-right: 0;
    border-bottom: 1px solid var(--tn-color-primary-border);
    gap: 18px;
  }

  .tn-auth-hero-title {
    font-size: 28px;
  }

  .tn-auth-trust-list {
    display: none;
  }

  .tn-auth-pane {
    padding: 34px 18px 40px;
  }

  .tn-auth-utils {
    position: static;
    justify-content: flex-end;
    padding: 14px 16px 0;
  }

  .tn-shell__body {
    grid-template-columns: 1fr;
  }

  .tn-nav {
    position: fixed;
    inset: var(--tn-topbar-height) 0 auto 0;
    max-height: calc(100vh - var(--tn-topbar-height));
    border-right: 0;
    border-bottom: 1px solid var(--tn-color-border);
    z-index: 15;
    box-shadow: var(--tn-shadow-md);
    display: none;
  }

  .tn-nav.is-open {
    display: flex;
  }

  .tn-main {
    padding: 18px 16px 40px;
  }

  .tn-menu-toggle {
    display: inline-flex !important;
  }

  .tn-dashboard-grid,
  .tn-report-grid {
    grid-template-columns: 1fr;
  }

  .tn-settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tn-doc-inspector__body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tn-auth-card {
    padding: 24px 22px;
  }

  .tn-report-grid {
    grid-template-columns: 1fr;
  }

  .tn-submission-card,
  .tn-submission-card--clickable {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .tn-submission-card__scores {
    grid-column: 1 / -1;
  }
}

/* 窄屏顶栏：去掉可省的文案，只留图标，避免内容把最小宽度撑出视口 */
@media (max-width: 720px) {
  .tn-shell__topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .tn-shell__topbar-brand > span:last-child,
  .tn-topbar-user > span:last-child,
  .tn-shell__topbar .tn-lang-switcher {
    display: none;
  }

  .tn-main {
    padding: 16px 12px 36px;
  }

  .tn-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.tn-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--tn-color-border);
  background: var(--tn-color-surface);
  color: var(--tn-color-text-secondary);
  cursor: pointer;
}
