:root {
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --soft: #94a3b8;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --panel: #ffffff;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-soft: #eff6ff;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1100px; height: 64px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.logo { font-size: 21px; font-weight: 850; color: var(--ink); text-decoration: none; }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo svg { width: 34px; height: 34px; flex: 0 0 auto; }
.brand-logo rect { fill: none; stroke: var(--blue); stroke-width: 3; }
.brand-logo path { fill: none; stroke: var(--blue-dark); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.brand-logo span { color: var(--ink); letter-spacing: 0; }
.nav-links { display: flex; gap: 28px; color: var(--muted); font-size: 14px; grid-column: 2; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--blue); }
.nav-cta, .btn, button {
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: .18s ease;
}
.nav-cta { padding: 8px 20px; font-size: 14px; }
.nav-cta:hover, .btn.primary:hover, button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; }
.btn.outline, .ghost { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.btn.outline:hover, .ghost:hover { background: #f1f5f9; color: var(--ink); transform: none; }

.hero { position: relative; overflow: hidden; display: grid; align-items: center; min-height: min(720px, calc(100vh - 64px)); padding: 108px 0 104px; background: var(--bg); }
.hero:before { content: ""; position: absolute; width: 780px; height: 780px; top: -420px; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(59,130,246,.12), transparent 68%); }
.hero .container { position: relative; }
.hero-grid { width: 100%; max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: center; gap: 72px; }
.hero-copy { text-align: center; }
.hero-badge { display: inline-flex; padding: 6px 14px; margin-bottom: 24px; border: 1px solid #bfdbfe; border-radius: 999px; background: #fff; color: var(--blue); font-size: 13px; box-shadow: 0 1px 3px rgba(59,130,246,.1); }
.hero h1 { margin: 0 0 20px; color: var(--ink); font-size: clamp(38px, 6vw, 64px); line-height: 1.08; letter-spacing: -.8px; }
.hero h1 span { color: transparent; background: linear-gradient(135deg, #3b82f6, #6366f1); -webkit-background-clip: text; background-clip: text; }
.hero-sub { max-width: 620px; margin: 0 auto 36px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

input, select {
  width: 100%;
  min-height: 46px;
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  font: inherit;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 20px,
    calc(100% - 11px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-color: #fff;
}
select:hover {
  border-color: #cbd5e1;
}
select:disabled {
  color: #94a3b8;
  background-image:
    linear-gradient(45deg, transparent 50%, #cbd5e1 50%),
    linear-gradient(135deg, #cbd5e1 50%, transparent 50%);
  cursor: not-allowed;
}
input:focus, select:focus { border-color: var(--blue); outline: 3px solid rgba(59,130,246,.14); }
button { min-height: 46px; padding: 0 20px; }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.token { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.hidden { display: none; }
.form-message { min-height: 22px; color: var(--blue-dark); }
.form-message a { color: var(--blue-dark); font-weight: 800; }
.login-panel .login-form-error {
  margin: 0 0 8px;
  min-height: 0;
  color: #ff0000 !important;
  font-size: 13px;
  font-weight: 700;
}
.login-panel .unlock-form-error {
  margin: 8px 0 10px;
  min-height: 0;
  color: #ff0000 !important;
  font-size: 13px;
  font-weight: 700;
}

.stats-bar { padding: clamp(20px, 4vw, 38px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 2.5vw, 24px); text-align: center; }
.stats-grid div { min-width: 0; }
.stats-grid strong { display: block; color: var(--ink); font-size: clamp(24px, 7vw, 34px); line-height: 1; white-space: nowrap; }
.stats-grid span { display: block; margin-top: 8px; color: var(--soft); font-size: clamp(11px, 2.8vw, 14px); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.features, .cta { padding: 80px 0; background: var(--bg); }
.how { padding: 80px 0; background: #fff; }
.section-label { margin: 0 0 12px; color: var(--blue); text-align: center; font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.section-title { margin: 0 0 16px; color: var(--ink); text-align: center; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.4px; }
.section-sub { max-width: 520px; margin: 0 auto 52px; color: var(--muted); text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.features-grid article { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.features-grid article:hover { border-color: #bfdbfe; box-shadow: 0 8px 22px rgba(59,130,246,.08); transform: translateY(-2px); }
.features-grid span { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 14px; border-radius: 12px; background: var(--blue-soft); font-size: 22px; }
.features-grid h3, .steps h3 { margin: 0 0 8px; color: var(--text); font-size: 18px; }
.features-grid p, .steps p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.steps b { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #3b82f6, #6366f1); font-size: 22px; }
.cta-box { max-width: 720px; margin: 0 auto; padding: 58px 36px; border: 1px solid #bfdbfe; border-radius: 24px; background: linear-gradient(135deg, #eff6ff, #dbeafe); text-align: center; }
.cta-box h2 { margin: 0 0 14px; color: #1e40af; font-size: clamp(28px, 4vw, 40px); }
.cta-box p { margin: 0 0 30px; color: var(--blue); }
.footer { padding: 38px 0; background: #f1f5f9; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer p { color: var(--soft); max-width: 360px; }
.footer-links { display: flex; gap: 18px; color: var(--muted); }

.login-body { min-height: 100vh; background: var(--bg); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 16px 50px rgba(15,23,42,.08); }
.hero-login { justify-self: stretch; text-align: left; }
.login-panel h1, .login-panel h2 { margin: 0 0 18px; color: var(--ink); }
.login-panel p { color: var(--muted); }
.login-panel label { display: grid; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 14px; }
.login-panel button { width: 100%; margin-top: 8px; }
.account-card { padding: 30px; }
.account-head { display: flex; align-items: center; gap: 14px; }
.account-head h2 { margin: 0 0 4px; }
.account-head p { margin: 0; }
.account-avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; font-size: 20px; font-weight: 800; box-shadow: 0 10px 24px rgba(37,99,235,.22); }
.account-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 22px 0 16px; }
.account-meta div { min-width: 0; padding: 12px 8px; border: 1px solid #dbeafe; border-radius: 8px; background: #f8fbff; text-align: center; }
.account-meta dt { color: var(--muted); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.account-meta dd { margin: 6px 0 0; color: var(--ink); font-size: 23px; font-weight: 800; line-height: 1; }
.account-info { display: grid; gap: 8px; padding: 13px 14px; border-radius: 8px; background: #f8fafc; color: var(--muted); font-size: 13px; }
.account-info span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-info em { font-style: normal; white-space: nowrap; }
.account-info b { min-width: 0; color: var(--ink); font-weight: 700; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.captcha-state { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pcaptcha-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(220px, 100%);
  min-height: 46px;
  margin: 16px 0 6px;
  padding: 0 12px;
  border: 2px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  color: #3669f4;
  box-shadow: 0 1px 0 rgba(37,99,235,.04);
  font-size: 15px;
  font-weight: 500;
}
.pcaptcha-widget[hidden] { display: none !important; }
.pcaptcha-widget:hover { background-color: #f8fbff; }
.pcaptcha-widget .pcaptcha-checkbox,
.pcaptcha-widget .pcaptcha-spinner,
.pcaptcha-widget .pcaptcha-success { display: none; }
.pcaptcha-widget[data-state="ready"] .pcaptcha-checkbox,
.pcaptcha-widget[data-state="error"] .pcaptcha-checkbox,
.pcaptcha-widget[data-state="disabled"] .pcaptcha-checkbox { display: block; }
.pcaptcha-widget[data-state="loading"] .pcaptcha-spinner,
.pcaptcha-widget[data-state="solving"] .pcaptcha-spinner { display: block; }
.pcaptcha-widget[data-state="verified"] .pcaptcha-success { display: block; }
.login-panel .pcaptcha-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border: 2px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: none;
}
.login-panel .pcaptcha-checkbox:hover { border-color: #60a5fa; }
.login-panel .pcaptcha-checkbox:disabled { cursor: wait; opacity: 1; }
.pcaptcha-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20width='80'%20height='80'%20style='display:%20block;%20margin:%20auto;'%3e%3cdefs%3e%3clinearGradient%20id='gradient'%20x1='0%25'%20y1='0%25'%20x2='100%25'%20y2='100%25'%3e%3cstop%20offset='0%25'%20style='stop-color:%234f46e5;stop-opacity:1'%3e%3canimate%20attributeName='stop-color'%20values='%234f46e5;%237c3aed;%234f46e5'%20dur='2s'%20repeatCount='indefinite'/%3e%3c/stop%3e%3cstop%20offset='100%25'%20style='stop-color:%237c3aed;stop-opacity:1'%3e%3canimate%20attributeName='stop-color'%20values='%237c3aed;%234f46e5;%237c3aed'%20dur='2s'%20repeatCount='indefinite'/%3e%3c/stop%3e%3c/linearGradient%3e%3cfilter%20id='glow'%3e%3cfeGaussianBlur%20stdDeviation='2'%20result='coloredBlur'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='coloredBlur'/%3e%3cfeMergeNode%20in='SourceGraphic'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cpath%20d='M50%2020%20A30%2030%200%201%201%2020%2050%20A30%2030%200%201%201%2050%2080%20A30%2030%200%201%201%2080%2050%20A30%2030%200%201%201%2050%2020'%20fill='none'%20stroke='url(%23gradient)'%20stroke-width='3'%20filter='url(%23glow)'%3e%3canimateTransform%20attributeName='transform'%20type='rotate'%20from='0%2050%2050'%20to='360%2050%2050'%20dur='3s'%20repeatCount='indefinite'/%3e%3canimate%20attributeName='d'%20dur='3s'%20repeatCount='indefinite'%20values='M50%2020%20A30%2030%200%201%201%2020%2050%20A30%2030%200%201%201%2050%2080%20A30%2030%200%201%201%2080%2050%20A30%2030%200%201%201%2050%2020;%20M50%2025%20A25%2035%200%201%201%2025%2050%20A35%2025%200%201%201%2050%2075%20A25%2035%200%201%201%2075%2050%20A35%2025%200%201%201%2050%2025;%20M50%2020%20A30%2030%200%201%201%2020%2050%20A30%2030%200%201%201%2050%2080%20A30%2030%200%201%201%2080%2050%20A30%2030%200%201%201%2050%2020'/%3e%3c/path%3e%3ccircle%20cx='50'%20cy='50'%20r='20'%20fill='none'%20stroke='url(%23gradient)'%20stroke-width='2'%20filter='url(%23glow)'%3e%3canimate%20attributeName='r'%20values='20;25;20'%20dur='2s'%20repeatCount='indefinite'/%3e%3canimate%20attributeName='stroke-width'%20values='2;4;2'%20dur='2s'%20repeatCount='indefinite'/%3e%3c/circle%3e%3c/svg%3e");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 24px 24px;
}
.pcaptcha-success {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  stroke: #3669f4;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pcaptcha-widget[data-state="error"] .pcaptcha-checkbox {
  border-color: #ef4444;
  background: #fff;
  box-shadow: none;
}
.pcaptcha-widget[data-state="disabled"] {
  color: var(--muted);
  background: #f8fafc;
}
.pcaptcha-label { white-space: nowrap; }
.account-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; }
.account-actions .btn { width: auto; min-height: 46px; margin: 0; padding-inline: 24px; }

.admin-body { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; background: var(--bg); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; border-right: 1px solid var(--line); background: #fff; }
.sidebar nav { display: grid; gap: 8px; margin-top: 32px; }
.sidebar-menu { position: relative; display: none; margin-top: 24px; }
.sidebar-menu-button {
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--blue-dark);
}
.sidebar-menu-button span { display: block; width: 18px; height: 2px; border-radius: 999px; background: currentColor; }
.sidebar-menu-button:hover { background: #dbeafe; color: var(--blue-dark); transform: none; }
.sidebar-menu-list {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 50;
  width: min(220px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15,23,42,.16);
}
.sidebar-menu-list[hidden] { display: none; }
.sidebar-menu-list a, .sidebar-menu-list button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
  font-weight: 800;
}
.sidebar-menu-list a[hidden], .sidebar-menu-list button[hidden] { display: none !important; }
.sidebar-menu-list a:hover, .sidebar-menu-list button:hover, .sidebar-menu-list button.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  transform: none;
}
.tab { justify-content: flex-start; width: 100%; background: #fff; color: var(--muted); text-align: left; }
.tab:hover, .tab.active { background: var(--blue-soft); color: var(--blue-dark); transform: none; }
.link-tab { display: flex; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.dashboard { padding: 28px; overflow: hidden; min-width: 0; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dashboard-head > * { min-width: 0; }
.dashboard-head h1 { margin: 0 0 4px; color: var(--ink); }
.dashboard-head p { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.account-menu { position: relative; }
.account-menu summary {
  min-height: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: var(--blue-dark);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:after { content: "⌄"; color: var(--muted); font-size: 13px; }
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 170px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15,23,42,.14);
}
.account-dropdown button { width: 100%; justify-content: flex-start; background: #fff; color: var(--text); text-align: left; }
.account-dropdown button:hover { background: var(--blue-soft); color: var(--blue-dark); transform: none; }
.view { display: none; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-grid div, .panel, .table-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.metric-grid div { min-width: 0; padding: 20px; }
.metric-grid span { display: block; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-grid strong { color: var(--ink); font-size: 32px; line-height: 1; }
.panel { padding: 18px; margin-bottom: 18px; }
.compact-form { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(130px, .7fr) minmax(180px, .9fr) minmax(190px, .9fr) auto; gap: 10px; align-items: end; min-width: 0; }
.compact-form h2 { grid-column: 1 / -1; margin: 0; font-size: 18px; }
.batch-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto minmax(150px, .6fr); gap: 12px; align-items: center; }
.batch-copy { min-width: 0; }
.batch-form h2 { margin: 0 0 6px; font-size: 18px; }
.batch-form p { margin: 0; color: var(--muted); font-size: 13px; }
.batch-form span { color: var(--muted); font-size: 13px; }
.batch-actions { display: flex; justify-content: flex-end; gap: 10px; }
.file-picker { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--blue-dark); background: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.file-picker:hover { border-color: #93c5fd; background: #f8fbff; }
.file-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.table-wrap { overflow-x: auto; padding: 18px; margin-bottom: 18px; min-width: 0; }
.table-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.table-heading h2 { margin: 0; font-size: 18px; color: var(--ink); }
.table-heading span { color: var(--muted); }
.table-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
.table-tools input { width: min(280px, 42vw); min-height: 38px; padding: 0 12px; }
.table-tools select { min-height: 38px; height: 38px; padding: 0 12px; }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; }
th { color: var(--muted); font-size: 13px; }
.truncate { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger { min-height: 34px; padding: 0 12px; color: var(--danger); background: #fff; border: 1px solid #fecaca; }
.danger:hover { background: #fef2f2; color: var(--danger); transform: none; }
.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.action-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.link-button { min-height: auto; padding: 0; border: 0; color: var(--blue-dark); background: transparent; box-shadow: none; font: inherit; text-decoration: underline; }
.link-button:hover { color: var(--blue); background: transparent; transform: none; }
.status-chip { display: inline-flex; align-items: center; min-height: 22px; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 700; white-space: nowrap; }
.danger-chip { background: #fef2f2; color: var(--danger); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; color: var(--muted); font-size: 13px; }
.pagination span { margin-right: auto; }
.settings-form { display: grid; gap: 14px; padding: 20px; background: #f8fbff; }
.settings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 2px 6px; }
.settings-head h2 { margin: 0; }
.settings-head p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-group { border: 1px solid #dbe6f5; border-radius: 12px; padding: 14px; background: #fff; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings-group h3 { margin: 0; font-size: 16px; color: var(--ink); }
.group-head p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-subgroup { border-top: 1px dashed #e2e8f0; padding-top: 12px; margin-top: 12px; }
.settings-subgroup:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.settings-subgroup h4 { margin: 0 0 10px; color: #334155; font-size: 13px; font-weight: 800; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.settings-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-form label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.settings-form label > input,
.settings-form label > select { width: 100%; }
.settings-form .field-number { width: 100%; }
.settings-form .check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}
.settings-form .check input { width: auto; min-height: auto; }
.settings-form .field-number input {
  width: 100%;
  min-height: 46px;
  height: 46px;
}
.settings-grid[hidden] { display: none !important; }
.settings-subgroup #password-policy-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.settings-subgroup #password-policy-detail-grid > .check:first-child {
  grid-column: 1 / -1;
}
.password-policy-advanced {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
@supports selector(.settings-subgroup:has(#set-password-policy-enabled)) {
  .settings-subgroup:has(#set-password-policy-enabled:not(:checked)) .password-policy-advanced {
    display: none;
  }
}
.settings-form button { width: max-content; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.modal { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 22px 70px rgba(15,23,42,.22); }
.modal::backdrop { background: rgba(15,23,42,.38); }
.modal code { display: block; padding: 14px; border-radius: 10px; background: var(--bg); color: var(--blue-dark); overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.link-modal { width: min(980px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 44px)); padding: 30px; border-radius: 20px; background: #f8fbff; overflow: auto; color: #17365d; scrollbar-width: thin; scrollbar-color: #bfdbfe transparent; }
.link-modal::-webkit-scrollbar, .compact-table::-webkit-scrollbar { width: 8px; height: 8px; }
.link-modal::-webkit-scrollbar-track, .compact-table::-webkit-scrollbar-track { background: transparent; }
.link-modal::-webkit-scrollbar-thumb, .compact-table::-webkit-scrollbar-thumb { border-radius: 999px; background: #bfdbfe; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 0 0 8px; color: #0f2f57; font-size: clamp(28px, 4vw, 38px); line-height: 1; }
.modal-head p { display: flex; align-items: center; gap: 10px; margin: 0; color: #55729a; overflow-wrap: anywhere; font-size: 17px; }
.modal-head p span { min-width: 0; overflow-wrap: anywhere; }
.icon-close { display: grid; place-items: center; width: 42px; min-height: 42px; padding: 0; border: 1px solid #bfdbfe; border-radius: 12px; color: var(--blue-dark); background: #fff; font-size: 26px; line-height: 1; }
.icon-close:hover { background: #eff6ff; color: var(--blue-dark); transform: none; }
.link-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.link-summary div { padding: 14px; border: 1px solid #dbeafe; border-radius: 10px; background: #fff; }
.link-summary span { display: block; margin-bottom: 8px; color: #647b9b; font-size: 13px; }
.link-summary strong { display: block; color: #123762; font-size: 22px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 238px; gap: 18px; align-items: stretch; }
.link-detail-meta, .link-detail-qr, .compact-table { border: 1px solid #dbeafe; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.link-detail-meta { padding: 18px; }
.link-detail-meta dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.link-detail-meta div { min-width: 0; padding: 0; border-bottom: 0; }
.link-detail-meta dt { margin-bottom: 7px; color: #647b9b; font-size: 13px; }
.link-detail-meta dd { margin: 0; color: #143a66; font-weight: 700; overflow-wrap: anywhere; }
.link-detail-meta div:first-child { grid-column: 1 / -1; }
.copy-line { display: flex; align-items: center; gap: 10px; }
.copy-line a { min-width: 0; overflow-wrap: anywhere; }
.link-detail-qr { display: grid; align-content: center; justify-items: center; padding: 18px; text-align: center; }
.link-detail-qr img { width: 178px; height: 178px; }
.link-detail-qr .action-link { margin-top: 12px; }
.link-modal h3 { margin: 22px 0 10px; font-size: 17px; color: #123762; }
.detail-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.detail-tools input { width: min(340px, 100%); min-height: 38px; padding: 0 12px; }
.detail-tools select { min-height: 38px; height: 38px; padding: 0 12px; }
.detail-tools span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.password-value { display: inline-block; padding: 0; border-radius: 0; background: transparent; color: #143a66; font: inherit; font-weight: 700; }
.compact-table { max-height: 206px; overflow: auto; margin-bottom: 0; padding: 0; }
.compact-table table { min-width: 720px; }
.compact-table thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
.compact-table .pagination { position: sticky; bottom: 0; padding: 10px 12px; border-top: 1px solid #dbeafe; background: #fff; }
.profile-form { display: grid; gap: 14px; }
.profile-form h2 { margin: 0; }
.profile-form label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
#qr-canvas { width: 180px; height: 180px; background: #fff; border-radius: 8px; }
.record-codes { display: flex; gap: 12px; flex-wrap: wrap; }
.record-codes span:empty { display: none; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: min(420px, calc(100vw - 44px)); padding: 12px 16px; border: 1px solid #bfdbfe; border-radius: 10px; color: #1e40af; background: #eff6ff; box-shadow: 0 14px 40px rgba(15,23,42,.16); font-weight: 700; text-align: center; }
.toast.error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.toast.warn { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.toast.success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.login-links { display: flex; justify-content: flex-end; gap: 14px; margin-top: 6px; }
.login-links a { color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.login-links a:hover { color: var(--text); }
.plain-dialog { border: 1px solid #bfdbfe; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 28px)); }
.plain-dialog::backdrop { background: rgba(15, 23, 42, .35); }
.plain-dialog form { padding: 18px; display: grid; gap: 10px; }
.plain-dialog h3 { margin: 0 0 4px; color: #0f172a; font-size: 24px; font-weight: 500; }
.plain-dialog label { display: grid; gap: 6px; color: #64748b; font-weight: 400; }
.plain-dialog input { min-height: 46px; border-radius: 12px; border: 1px solid #bfd2eb; padding: 0 12px; font-size: 18px; color: #1e3a5f; }
.code-row { display: flex; align-items: center; gap: 10px; }
.phone-row { display: flex; align-items: center; gap: 10px; }
.phone-row input { flex: 1 1 auto; min-width: 0; }
.sms-captcha-widget { width: 220px; min-width: 220px; margin: 0; min-height: 46px; padding: 0 12px; border-width: 2px; border-color: #dbeafe; border-radius: 12px; background: #f8fbff; color: #3669f4; }
.sms-captcha-widget .pcaptcha-label { font-size: 15px; font-weight: 500; }
.code-row input { margin: 0; }
.code-row input { flex: 1 1 auto; min-width: 0; }
.code-send-btn { flex: 0 0 auto; width: 220px; min-width: 220px; min-height: 46px; padding: 0 12px; white-space: nowrap; border-radius: 12px; }
.code-send-btn:disabled { cursor: not-allowed; }
.settings-action-line { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.settings-action-line .btn { min-height: 46px; }
.muted-text { color: #64748b; font-size: 13px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

@media (max-width: 980px) {
  .nav-inner { display: flex; justify-content: space-between; }
  .nav-links { display: none; }
  .hero { min-height: auto; padding: 78px 0 82px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; justify-items: center; }
  .hero-copy { max-width: 720px; }
  .hero-login { width: min(430px, 100%); justify-self: center; }
  .steps, .compact-form, .batch-form { grid-template-columns: 1fr; }
  .settings-head { flex-direction: column; align-items: flex-start; }
  .settings-grid, .settings-grid-2, .settings-grid-3 { grid-template-columns: 1fr; }
  .password-policy-advanced {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
  .settings-subgroup #password-policy-detail-grid > .check:first-child {
    grid-column: 1 / -1;
  }
  .batch-actions { flex-direction: column; }
  .file-picker, .batch-actions button { width: 100%; }
  .table-heading.searchable-heading { align-items: stretch; flex-direction: column; }
  .table-tools { justify-content: flex-start; margin-left: 0; }
  .table-tools input { width: 100%; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .metric-grid div { padding: 12px 10px; border-radius: 10px; }
  .metric-grid span { margin-bottom: 6px; font-size: 12px; }
  .metric-grid strong { font-size: 24px; }
  .dashboard-head, .footer-inner { flex-direction: column; align-items: flex-start; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .head-actions > * { min-width: 0; }
}

@media (max-width: 1100px) {
  .admin-body { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px; display: flex; flex-direction: column; align-items: center; }
  .sidebar .brand-logo { justify-content: center; gap: 0; }
  .sidebar .brand-logo svg { width: 34px; height: 34px; }
  .sidebar .brand-logo span { display: none; }
  .sidebar nav { display: none; }
  .sidebar-menu { display: block; margin-top: 28px; }
  .sidebar-menu-list { left: 0; }
  .dashboard { padding: 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .link-modal { padding: 22px; }
  .link-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-detail-grid { grid-template-columns: 1fr; }
  .link-detail-meta dl { grid-template-columns: 1fr; }
  .link-detail-meta div:first-child { grid-column: auto; }
  .detail-tools { align-items: stretch; flex-direction: column; }
  .detail-tools input { width: 100%; }
  .account-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-actions { grid-template-columns: 1fr; }
  .account-actions .btn { width: 100%; }
  .code-row { flex-wrap: nowrap; }
  .phone-row { flex-wrap: nowrap; }
  .code-send-btn { min-width: 104px; }
  .admin-body { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; }
  .sidebar .brand-logo svg { width: 30px; height: 30px; }
  .sidebar-menu-button { width: 40px; min-height: 40px; }
  .sidebar-menu-list { left: 0; width: 190px; }
  .dashboard { padding: 18px; }
  .dashboard-head h1 { font-size: 34px; line-height: 1.1; }
  .metric-grid { grid-template-columns: 1fr; }
  .table-wrap { padding: 14px; }
  th, td { padding: 10px 6px; font-size: 13px; }
  .row-actions { justify-content: flex-start; }
  .modal { width: calc(100vw - 20px); padding: 18px; border-radius: 14px; }
  .modal-actions { flex-wrap: wrap; justify-content: flex-start; }
  .modal-actions button { flex: 1 1 140px; }
  .compact-form button,
  .batch-actions button,
  #settings-form .settings-actions button { width: 100%; }
}
