:root {
  --tad-red: #c91f2e;
  --tad-red-dark: #981923;
  --tad-ink: #2c1746;
  --tad-blue: #2850a3;
  --tad-yellow: #edae1d;
  --tad-gray: #e6e3e7;
  --tad-paper: #fff;
  --tad-surface: #f7f4f7;
  --tad-muted: #756b7e;
  --tad-line: #d9d1db;
  --tad-success: #2f8a63;
  --tad-warning: #9a6200;
  --tad-danger: #b51d2b;
  --tad-header-height: 72px;
  --tad-content: 1360px;
  --tad-shadow: 0 24px 80px rgb(44 23 70 / 18%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--tad-ink);
  background: var(--tad-surface);
  font: 15px/1.7 CangErYuYang, "Microsoft YaHei", sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgb(40 80 163 / 34%); outline-offset: 2px; }

.tad-skip {
  position: fixed;
  top: -80px;
  left: 18px;
  z-index: 1000;
  padding: 9px 14px;
  color: #fff;
  background: var(--tad-ink);
}
.tad-skip:focus { top: 12px; }

.tad-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: var(--tad-header-height);
  padding: 0 clamp(18px, 4vw, 64px);
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--tad-line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}
.tad-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.tad-brand img { width: 43px; height: 43px; object-fit: contain; }
.tad-brand strong { font: 27px/1 CangErYuMo, sans-serif; letter-spacing: .02em; }
.tad-brand small { display: block; margin-top: 4px; color: var(--tad-red); font: 9px/1 Consolas, monospace; letter-spacing: .16em; }
.tad-global-nav { display: flex; margin-left: auto; align-items: center; gap: 26px; }
.tad-global-nav a { color: var(--tad-muted); font-size: 14px; text-decoration: none; }
.tad-global-nav a[aria-current="page"], .tad-global-nav a:hover { color: var(--tad-red); }
.tad-account-button, .tad-menu-button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--tad-line);
  color: var(--tad-ink);
  background: #fff;
}
.tad-menu-button { display: none; width: auto; padding: 0 10px; font-size: 12px; }

.tad-main { width: min(var(--tad-content), 100%); margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.tad-breadcrumb { display: flex; gap: 8px; color: var(--tad-muted); font-size: 13px; }
.tad-breadcrumb a { color: var(--tad-red); text-decoration: none; }
.tad-kicker { color: var(--tad-red); font: 10px/1.4 Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; }
.tad-title { margin: 12px 0; font: clamp(38px, 5vw, 66px)/1.08 CangErYuMo, sans-serif; }
.tad-title em { color: var(--tad-red); font-style: normal; }
.tad-lede { max-width: 760px; color: var(--tad-muted); font-size: 16px; }

.tad-button {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--tad-line);
  color: var(--tad-ink);
  background: #fff;
  text-decoration: none;
}
.tad-button:hover { border-color: var(--tad-red); }
.tad-button.primary { border-color: var(--tad-red); color: #fff; background: var(--tad-red); }
.tad-button.primary:hover { background: var(--tad-red-dark); }
.tad-button.danger { border-color: var(--tad-danger); color: var(--tad-danger); }
.tad-button:disabled { cursor: not-allowed; opacity: .48; }
.tad-button.compact { min-height: 34px; padding: 5px 11px; font-size: 13px; }

.tad-field { display: grid; gap: 6px; color: var(--tad-muted); font-size: 13px; }
.tad-field input, .tad-field textarea, .tad-field select,
.tad-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--tad-line);
  border-radius: 2px;
  color: var(--tad-ink);
  background: #fff;
}
.tad-field textarea { resize: vertical; }
.tad-field input:focus, .tad-field textarea:focus, .tad-field select:focus, .tad-input:focus { border-color: var(--tad-blue); outline: 2px solid rgb(40 80 163 / 14%); }

.tad-status { padding: 14px 16px; border-left: 4px solid var(--tad-blue); background: #eef2fb; }
.tad-status.error { border-color: var(--tad-danger); background: #fff0f1; }
.tad-status.warning { border-color: var(--tad-yellow); background: #fff8e7; }
.tad-empty { padding: 42px 24px; border: 1px dashed var(--tad-line); color: var(--tad-muted); text-align: center; }

.tad-footer {
  display: flex;
  min-height: 56px;
  margin-top: auto;
  padding: 12px clamp(20px, 5vw, 72px);
  align-items: center;
  gap: 24px;
  color: #d8cedd;
  background: var(--tad-ink);
  font: 11px/1.5 Consolas, monospace;
}
.tad-footer a { margin-left: auto; color: inherit; }

.tad-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 1px solid var(--tad-red);
  border-radius: 5px;
  color: var(--tad-ink);
  background: #fff;
  box-shadow: var(--tad-shadow);
  overflow: auto;
}
.tad-dialog.wide { width: min(900px, calc(100vw - 28px)); }
.tad-dialog::backdrop { background: rgb(32 13 43 / 58%); backdrop-filter: blur(3px); }
.tad-dialog-header { display: flex; padding: 17px 20px; align-items: center; gap: 12px; border-bottom: 1px solid var(--tad-line); }
.tad-dialog-header img { width: 24px; height: 24px; }
.tad-dialog-header div { min-width: 0; }
.tad-dialog-header small { display: block; color: var(--tad-red); font: 9px Consolas, monospace; letter-spacing: .14em; }
.tad-dialog-header h2 { margin: 2px 0 0; font: 27px/1.2 CangErYuMo, sans-serif; }
.tad-dialog-close { width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--tad-line); background: #fff; }
.tad-dialog-body { padding: 20px; }
.tad-dialog-body > :first-child { margin-top: 0; }
.tad-dialog-body > :last-child { margin-bottom: 0; }
.tad-dialog-actions { display: flex; padding: 14px 20px 20px; justify-content: flex-end; gap: 9px; }
.tad-dialog-form { display: grid; gap: 14px; }
.tad-auth-tabs { display: flex; gap: 8px; }
.tad-auth-tabs button.active { border-color: var(--tad-red); color: var(--tad-red); }
.tad-inline-check { display: flex; align-items: center; gap: 8px; color: var(--tad-muted); font-size: 13px; }
.tad-inline-check input { width: auto; min-height: auto; }
.tad-form-message { min-height: 22px; margin: 0; color: var(--tad-danger); font-size: 13px; }

.tad-toast-region { position: fixed; right: 18px; bottom: 20px; z-index: 1200; display: grid; width: min(380px, calc(100vw - 36px)); gap: 9px; }
.tad-toast { padding: 13px 15px; border: 1px solid var(--tad-line); border-left: 5px solid var(--tad-blue); color: var(--tad-ink); background: #fff; box-shadow: 0 12px 36px rgb(44 23 70 / 18%); }
.tad-toast.success { border-left-color: var(--tad-success); }
.tad-toast.error { border-left-color: var(--tad-danger); }
.tad-toast.warning { border-left-color: var(--tad-yellow); }

@media (max-width: 820px) {
  .tad-header { min-height: 64px; gap: 12px; }
  .tad-brand strong { font-size: 23px; }
  .tad-brand small { display: none; }
  .tad-global-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    padding: 16px 20px;
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--tad-line);
    background: #fff;
  }
  .tad-global-nav.open { display: flex; }
  .tad-global-nav a { padding: 10px 2px; }
  .tad-menu-button { display: block; margin-left: auto; }
  .tad-account-button { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tad-footer { flex-wrap: wrap; gap: 6px 18px; }
  .tad-footer a { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
