:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-soft: #fafbff;
  --text: #14161f;
  --muted: #6b7280;
  --muted-strong: #4b5563;
  --line: #e5e7ef;
  --line-strong: #d6d9e4;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef2ff;
  --douyin: #111827;
  --douyin-cyan: #22d3ee;
  --weibo: #e6162d;
  --weibo-soft: #fff1f2;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 8px 24px rgba(20, 22, 31, 0.06);
  --shadow-lg: 0 24px 60px rgba(20, 22, 31, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 12% 0%, #e9e7ff 0, transparent 34%),
    radial-gradient(circle at 88% 4%, #dff7fb 0, transparent 30%), var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

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

.spacer {
  flex: 1;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
}

.btn.ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn.ghost:hover:not(:disabled) {
  border-color: #b9bed0;
  background: #fbfcff;
}

.btn.small {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.btn.block {
  width: 100%;
}

.btn.danger-text {
  color: var(--red);
}

.btn.danger-text:hover:not(:disabled) {
  background: var(--red-soft);
  border-color: #fecaca;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-btn:hover {
  background: #f1f2f7;
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-strong);
}

.field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea,
.add-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.add-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.13);
}

.field input:disabled {
  background: #f5f6fa;
  color: var(--muted);
}

.form-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-title {
  margin: 0;
  font-size: 15px;
}

.divider {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: var(--line);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- 品牌 ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  box-shadow: 0 8px 20px rgba(35, 211, 238, 0.25);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand.compact {
  gap: 9px;
}

.brand.compact .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
}

.brand.compact .brand-name {
  font-size: 17px;
}

.brand-badge {
  padding: 3px 8px;
  border: 1px solid #dfe2ef;
  border-radius: 999px;
  color: var(--muted-strong);
  background: #f8f9ff;
  font-size: 11px;
  font-weight: 600;
}

/* ---------------- 登录 / 注册 ---------------- */

.auth-view {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  overflow: hidden;
  color: #eef1ff;
  background: radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.5) 0, transparent 38%),
    radial-gradient(circle at 82% 76%, rgba(34, 211, 238, 0.28) 0, transparent 42%),
    linear-gradient(145deg, #0d1020 0%, #171a33 52%, #111427 100%);
}

.auth-view::before,
.auth-view::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.auth-view::before {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-view::after {
  width: 320px;
  height: 320px;
  bottom: -160px;
  left: -100px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 56px;
  align-items: center;
  width: 100%;
  max-width: 1060px;
}

.auth-brand .brand-name {
  color: #fff;
}

.auth-brand h1 {
  margin: 34px 0 14px;
  max-width: 520px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -1.4px;
}

.auth-lead {
  max-width: 480px;
  margin: 0;
  color: rgba(238, 241, 255, 0.72);
  font-size: 15px;
  line-height: 1.75;
}

.feature-list {
  display: grid;
  gap: 11px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(238, 241, 255, 0.86);
  font-size: 14px;
}

.feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.8;
}

.feature-dot.douyin {
  background: var(--douyin-cyan);
}

.feature-dot.weibo {
  background: #fb7185;
}

.feature-dot.pulse {
  background: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.15);
}

.feature-dot.notify {
  background: #4ade80;
}

.auth-footnote {
  max-width: 460px;
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(238, 241, 255, 0.5);
  font-size: 12px;
  line-height: 1.7;
}

.auth-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f2f9;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.auth-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(20, 22, 31, 0.08);
}

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

/* ---------------- 顶栏 / 主区域 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 217, 228, 0.7);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-email {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 34px 24px 48px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.8px;
}

.page-head p {
  margin: 0;
  font-size: 13.5px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted-strong);
  font-size: 12.5px;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
  animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.28);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.notice-area {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.notice-area:empty {
  display: none;
}

.notice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f0f7ff;
  color: #1e40af;
  font-size: 13px;
}

.notice-item .btn {
  min-height: 30px;
}

/* ---------------- 统计卡片 ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  position: relative;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat::after {
  content: "";
  position: absolute;
  top: -26px;
  right: -26px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--stat-color, #eef2ff);
  opacity: 0.55;
}

.stat-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.stat-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stat-color-solid, #94a3b8);
}

.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-value.compact {
  font-size: 24px;
  letter-spacing: -0.5px;
}

.stat-note {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- 面板 ---------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff 0%, #fff 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.platform-tabs {
  display: flex;
  gap: 6px;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.platform-tab:hover {
  color: var(--text);
}

.platform-tab.active {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 3px 10px rgba(20, 22, 31, 0.07);
}

.platform-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.platform-mark.douyin {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  box-shadow: -2px 0 0 rgba(34, 211, 238, 0.9), 2px 0 0 rgba(244, 63, 94, 0.75);
}

.platform-mark.weibo {
  background: linear-gradient(135deg, #e6162d 0%, #f97316 100%);
}

.tab-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef0f7;
  color: var(--muted-strong);
  font-size: 11px;
  text-align: center;
}

.platform-tab.active .tab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-hint {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------------- Cookie 状态条 ---------------- */

.cookie-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.cookie-banner.ok {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: #166534;
}

.cookie-banner.warn {
  border-color: #fde68a;
  background: var(--amber-soft);
  color: #92400e;
}

.cookie-banner.danger {
  border-color: #fecaca;
  background: var(--red-soft);
  color: #991b1b;
}

.cookie-banner .cookie-copy {
  min-width: 0;
}

.cookie-banner strong {
  font-weight: 700;
}

.cookie-banner .cookie-detail {
  margin-top: 3px;
  opacity: 0.8;
  font-size: 12px;
}

.cookie-banner .btn {
  flex: none;
  min-height: 32px;
}

/* ---------------- 添加账户 ---------------- */

.add-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
  padding: 18px 20px 0;
}

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

.add-field > span {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 600;
}

.add-field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.add-row .btn {
  min-height: 42px;
}

#platformHint {
  padding: 0 20px;
}

/* ---------------- 账户列表 ---------------- */

.account-list {
  display: grid;
  gap: 12px;
  padding: 16px 20px 22px;
}

.account-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 16px 16px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.account-card:hover {
  border-color: #d5d9e8;
  box-shadow: 0 8px 20px rgba(20, 22, 31, 0.05);
}

.account-card::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #cbd5e1;
}

.account-card.status-online::before {
  background: var(--green);
}

.account-card.status-offline::before {
  background: #94a3b8;
}

.account-card.status-unknown::before {
  background: #f59e0b;
}

.account-card.paused {
  background: #fbfcff;
}

.account-card.paused .account-main {
  opacity: 0.68;
}

.avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 800;
  flex: none;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-main {
  min-width: 0;
}

.account-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.account-title h3 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-title h3 a {
  color: inherit;
  text-decoration: none;
}

.account-title h3 a:hover {
  color: var(--accent);
}

.platform-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f2f8;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.platform-chip.douyin {
  background: #f1f5f9;
  color: #0f172a;
}

.platform-chip.weibo {
  background: var(--weibo-soft);
  color: var(--weibo);
}

.paused-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
}

.account-meta {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-online .status-pill {
  background: var(--green-soft);
  color: #15803d;
}

.status-online .status-pill i {
  animation: dot-pulse 1.8s ease-out infinite;
}

@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.35);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.status-offline .status-pill {
  background: #f1f5f9;
  color: #475569;
}

.status-unknown .status-pill {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-paused .status-pill {
  background: #f3f4f6;
  color: #6b7280;
}

.status-detail {
  min-width: 0;
  color: var(--muted-strong);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.account-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.account-sub .warn-text {
  color: var(--amber);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 220px;
}

.account-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.account-actions button:hover:not(:disabled) {
  border-color: #c3c8d8;
  background: #fafbff;
  color: var(--text);
}

.account-actions button[data-action="delete"]:hover {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.account-actions button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.empty-state {
  padding: 40px 24px 46px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(180deg, #fcfdff 0%, #f8f9fe 100%);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.empty-state p {
  max-width: 460px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.loading-state {
  padding: 46px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* ---------------- 说明 ---------------- */

.tips {
  margin-top: 26px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.tips h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tip h3 {
  margin: 0 0 5px;
  font-size: 13.5px;
}

.tip p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 34px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(13, 16, 32, 0.48);
  backdrop-filter: blur(4px);
  animation: fade-in 0.16s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s ease;
}

.modal-card.wide {
  width: min(720px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
}

.modal-body {
  padding: 18px 22px 22px;
}

.steps {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 13px;
}

.steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.steps code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f2f8;
  color: #3730a3;
  font-size: 12px;
}

.cookie-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12.5px;
}

.cookie-state .ok-text {
  color: var(--green);
  font-weight: 600;
}

.cookie-state .bad-text {
  color: var(--red);
  font-weight: 600;
}

.modal-result {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
}

.modal-result.success {
  border: 1px solid #bbf7d0;
  background: var(--green-soft);
  color: #166534;
}

.modal-result.error {
  border: 1px solid #fecaca;
  background: var(--red-soft);
  color: #991b1b;
}

.modal-result.info {
  border: 1px solid #dbeafe;
  background: #f0f7ff;
  color: #1e40af;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.history-stat {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.history-stat span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.history-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
}

.history-row.open {
  border-color: #bbf7d0;
  background: var(--green-soft);
}

.history-row .time {
  color: var(--muted-strong);
}

.history-row .duration {
  font-weight: 700;
}

.history-row .ongoing {
  color: var(--green);
  font-weight: 700;
}

.history-empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 22, 31, 0.14);
  color: var(--text);
  font-size: 13px;
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.info {
  border-left-color: #3b82f6;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
    gap: 34px;
  }

  .auth-brand h1 {
    margin-top: 26px;
  }

  .auth-footnote,
  .feature-list {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    padding: 10px 16px;
  }

  .user-email {
    display: none;
  }

  .brand-badge {
    display: none;
  }

  .main {
    padding: 24px 16px 38px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
  }

  .panel-actions {
    flex-wrap: wrap;
  }

  .refresh-hint {
    margin-right: auto;
  }

  .cookie-banner {
    align-items: flex-start;
    flex-direction: column;
    margin: 14px 16px 0;
  }

  .add-row {
    grid-template-columns: 1fr;
    padding: 16px 16px 0;
  }

  .add-row .btn {
    width: 100%;
  }

  #platformHint {
    padding: 0 16px;
  }

  .account-list {
    padding: 14px 16px 18px;
  }

  .account-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 14px 14px 14px 18px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 18px;
  }

  .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
    padding-top: 2px;
  }

  .account-actions button {
    flex: 1;
    min-width: 64px;
  }

  .tips {
    padding: 18px;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px 26px;
  }

  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-card,
  .modal-card.wide {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .modal-head,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .history-row {
    grid-template-columns: 1fr auto;
  }

  .history-row .ongoing {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  .auth-view {
    padding: 24px 14px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    padding: 14px;
  }

  .stat-value {
    font-size: 26px;
  }

  .platform-tab {
    flex: 1;
    justify-content: center;
  }

  .platform-tabs {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
