:root,
:root[data-theme="dark"] {
  --primary-blue: #1A73E8;
  --secondary-purple: #6E40F7;
  --accent-green: #30C57B;
  --dark-bg: #12141D;
  --dark-bg-2: #1a1d27;
  --light-text: #F8F9FA;
  --gray-text: #AEB6C3;
  --border-color: rgba(92, 107, 138, 0.15);
  --bg: #12141D;
  --bg2: #1a1d27;
  --card: rgba(25, 28, 38, 0.7);
  --text: #F8F9FA;
  --muted: #AEB6C3;
  --line: rgba(92, 107, 138, 0.15);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  --code-bg: #10131a;
  --ok: #30C57B;
  --danger: #f87171;
  --nav: rgba(12, 13, 18, 0.95);
  --nav-link: #e8ecf4;
  --nav-link-active: #ffffff;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2f8;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #1a1d27;
  --muted: #5c6578;
  --light-text: #1a1d27;
  --gray-text: #5c6578;
  --line: rgba(26, 115, 232, 0.12);
  --border-color: rgba(26, 29, 39, 0.08);
  --shadow: 0 12px 32px rgba(26, 29, 39, 0.08);
  --code-bg: #e8eef8;
  --nav: rgba(255, 255, 255, 0.92);
  --nav-link: #3d4656;
  --nav-link-active: #12141d;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #12141D 0%, #1a1d27 100%);
  color: var(--muted);
  font-family: "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
:root[data-theme="light"] body { background: linear-gradient(135deg, #e8eef8 0%, #f5f7fb 100%); }
#chrome, .site-foot { flex-shrink: 0; }
body > :not(#chrome):not(.site-foot):not(.toast):not(.overlay) {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
body > .hero,
body > .about,
body > .docs,
body > .plaza,
body > .login-wrap,
body > .wait {
  overflow: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body > .app { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { color: var(--text); font-weight: 600; letter-spacing: -0.03em; }
.top {
  position: relative; z-index: 100;
  background: var(--nav);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}
.top-inner {
  width: 100%;
  max-width: none;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; column-gap: 1rem;
  padding: 0.85rem 1.25rem;
}
.logo { display: flex; align-items: center; justify-self: start; gap: 0.5rem; font-weight: 700; color: var(--text); font-size: 1.15rem; white-space: nowrap; }
.logo-icon { width: 22px; height: 22px; color: var(--primary-blue); flex-shrink: 0; }
.top nav {
  display: flex; align-items: center; justify-self: center;
  gap: 1.65rem; min-width: 0;
}
.top nav a {
  color: var(--nav-link); font-size: 1.05rem; font-weight: 600; letter-spacing: 0.01em;
  position: relative; padding: 0.25rem 0; white-space: nowrap;
}
.top nav a::after {
  content: ""; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-purple));
  transition: width .3s;
}
.top nav a.on, .top nav a:hover { color: var(--nav-link-active); }
.top nav a.on::after, .top nav a:hover::after { width: 100%; }
.tools {
  display: flex; align-items: center; justify-content: flex-end; justify-self: end;
  gap: 0.4rem; flex-shrink: 0;
}
.chip-btn, .lang-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.18rem;
  height: 26px; padding: 0 0.5rem;
  border-radius: 50px; border: 1px solid rgba(174, 182, 195, 0.22);
  background: rgba(174, 182, 195, 0.08); color: var(--muted);
  font-size: 0.72rem; font-weight: 600; line-height: 1;
}
.chip-btn:hover, .lang-btn:hover { color: var(--text); border-color: rgba(174, 182, 195, 0.45); }
.top-login, .auth-btn {
  height: 26px; padding: 0 0.62rem; border-radius: 50px;
  border: 1px solid rgba(26, 115, 232, 0.55); background: transparent;
  color: var(--text); font-weight: 600; font-size: 0.72rem;
  display: inline-flex; align-items: center; white-space: nowrap; line-height: 1;
}
.top-login:hover, .auth-btn:hover { background: rgba(26, 115, 232, 0.15); border-color: var(--primary-blue); }
.user-wrap { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.28rem;
  height: 26px; padding: 0 0.5rem 0 0.14rem; border-radius: 50px;
  border: 1px solid rgba(26, 115, 232, 0.35); background: rgba(26, 115, 232, 0.12);
  color: var(--text); font-size: 0.72rem; font-weight: 600; line-height: 1;
}
.user-ava {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--secondary-purple), var(--primary-blue));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.62rem;
  text-transform: uppercase;
}
.user-name {
  max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-drop {
  position: absolute; right: 0; top: calc(100% + 0.6rem); min-width: 160px;
  background: #1a1d27; border: 1px solid var(--border-color); border-radius: 14px;
  box-shadow: var(--shadow); padding: 0.35rem; z-index: 30;
  display: grid;
}
:root[data-theme="light"] .user-drop { background: var(--card); }
.user-drop[hidden] { display: none; }
.user-drop a, .user-drop button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--muted); padding: 0.6rem 0.55rem; border-radius: 8px; font-size: 0.9rem;
}
.user-drop a:hover, .user-drop button:hover { background: rgba(26, 115, 232, 0.12); color: var(--text); }
.menu-toggle {
  display: none; flex-direction: column; gap: 5px; width: auto; height: auto;
  border: 0; background: transparent; padding: 0.5rem;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 50px; padding: 0 2rem; height: 2.75rem; font-weight: 600; font-size: 1rem;
  transition: transform .3s, box-shadow .3s, background .3s, border-color .3s;
}
.btn.primary {
  background: linear-gradient(90deg, var(--secondary-purple) 0%, var(--primary-blue) 100%);
  color: #fff;
}
.btn.primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(110, 64, 247, 0.4); }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid rgba(26, 115, 232, 0.5);
}
.btn.ghost:hover { border-color: var(--primary-blue); background: rgba(26, 115, 232, 0.1); transform: translateY(-3px); }
.btn.signed,
.btn.primary.signed:hover {
  background: rgba(174, 182, 195, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
  transform: none;
  pointer-events: none;
  cursor: default;
}
.hero {
  max-width: none; margin: 0; padding: 48px max(28px, calc((100% - 1180px) / 2)) 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px;
  align-items: stretch;
}
.hero-copy {
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
}
.hero-copy .lead { max-width: none; }
.hero .panel {
  display: flex; flex-direction: column; min-width: 0; height: 100%;
}
.hero .panel .body { flex: 1; }
.hero .url code { flex: 1; min-width: 0; }
.badge-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: #8ab4f8; font-size: 13px; margin: 0;
}
:root[data-theme="light"] .badge { color: var(--primary-blue); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--primary-blue); }
.badge.warn { color: #f0ab4e; }
.badge.warn::before { background: #f0ab4e; }
:root[data-theme="light"] .badge.warn { color: #b45309; }
.hero h1 { font-size: 3.5rem; line-height: 1.2; margin: 0 0 14px; color: var(--text); letter-spacing: -0.03em; }
.lead { color: var(--muted); line-height: 1.7; max-width: 460px; margin: 0 0 24px; font-size: 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  font-size: 14px;
}
.steps b { color: var(--text); font-weight: 600; }
.steps li > div { min-width: 0; line-height: 28px; }
.step-n {
  width: 28px; height: 28px; margin: 0; padding: 0;
  border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary-purple); font-size: 12px; font-weight: 700; line-height: 1;
}
.urls { display: grid; gap: 8px; margin-top: 22px; }
.url { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.url span { width: 72px; flex-shrink: 0; }
.url code, .bar code {
  user-select: all; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--text); font-size: 13px;
}
.url button, .copy, .chip, .bar button {
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.note { margin: 18px 0 0; font-size: 13px; }
.note a, .link { color: var(--primary-blue); }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px rgba(110, 64, 247, 0.12), 0 18px 40px rgba(26, 115, 232, 0.12);
  position: relative;
}
.panel::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--secondary-purple), var(--primary-blue), var(--ok));
}
.tabs { display: flex; gap: 6px; padding: 16px 18px 0; font-size: 14px; align-items: center; }
.tabs button {
  background: none; border: 0; color: var(--muted);
  padding: 8px 12px 12px; position: relative; font-weight: 600;
}
.tabs button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  border-radius: 2px; width: 0; margin: 0 auto;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-purple));
  transition: width .25s;
}
.tabs button.on { color: var(--text); }
.tabs button.on::after { width: calc(100% - 24px); }
.ok { margin-left: auto; color: var(--ok); font-size: 12px; padding-top: 4px; }
.panel .body {
  padding: 8px 18px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; color: var(--text);
  min-height: 220px;
}
.dots { display: flex; gap: 8px; justify-content: center; padding: 0 18px 4px; }
.dots button {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 99px;
  background: rgba(174, 182, 195, 0.35);
}
.dots button.on {
  width: 18px;
  background: linear-gradient(90deg, var(--secondary-purple), var(--primary-blue));
}
.method { display: inline-block; background: #5b21b6; color: #e9d5ff; border-radius: 6px; padding: 2px 6px; margin-right: 8px; font-size: 11px; }
.path { color: var(--muted); }
.k { color: var(--muted); font-size: 11px; letter-spacing: .08em; margin: 14px 0 6px; }
.kw { color: #c4b5fd; }
.st { color: #7dd3fc; }
.str { color: #86efac; }
:root[data-theme="light"] .kw { color: #6E40F7; }
:root[data-theme="light"] .st { color: #1A73E8; }
:root[data-theme="light"] .str { color: #0f9f6e; }
.foot {
  display: flex; justify-content: space-between; color: var(--muted);
  font-size: 11px; padding: 10px 18px 14px; border-top: 1px solid var(--line);
}
.plaza { max-width: none; margin: 0; padding: 36px max(28px, calc((100% - 1180px) / 2)) 80px; }
.plaza h1 { text-align: center; font-size: 40px; margin: 0 0 8px; }
.sub { text-align: center; margin: 0 0 28px; }
.bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
}
input[type=search], .login input, .chat-head select {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
}
input[type=search] {
  width: 100%; max-width: 520px; margin: 0 auto 18px; display: block;
  padding: 12px 14px; border-radius: 999px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.chip { border-radius: 999px; padding: 6px 12px; }
.chip.on { border-color: var(--secondary-purple); color: var(--secondary-purple); }
.meta { font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.row { display: flex; align-items: center; gap: 8px; }
.id { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; flex: 1; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; background: var(--bg2); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.free { color: var(--ok); }
.empty { text-align: center; padding: 40px 0; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
:root[data-theme="light"] .toast { background: #1a1d27; }
.toast.show { opacity: 1; }
.login-wrap {
  max-width: none; margin: 0; padding: 10vh 24px 80px;
  display: flex; justify-content: center; align-items: flex-start;
}
.login-card {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 28px; margin: 0 0 10px; }
.login-card .lead { margin-bottom: 22px; }
.login-card .btn.primary { width: 100%; }
.login-card details { margin-top: 22px; font-size: 14px; }
.login-card summary { cursor: pointer; }
.login-card form { display: grid; gap: 10px; margin-top: 12px; }
.login-card input { border-radius: 10px; padding: 10px 12px; }
.err { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }
.site-foot {
  width: 100%;
  margin-top: 0;
  flex-shrink: 0;
  text-align: center;
  padding: 3rem 24px 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-top: 1px solid var(--border-color);
  background: rgba(12, 13, 18, 0.95);
}
:root[data-theme="light"] .site-foot { background: var(--nav); }
.site-foot p { margin: 0; }
.site-foot .icp { margin-top: 0.45rem; }
.site-foot .icp a { color: inherit; }
.site-foot .icp a:hover { color: var(--text); }
.site-foot .powered { margin-top: 0.75rem; font-size: 0.875rem; font-weight: 500; }
.site-foot .powered a { color: var(--primary-blue); font-weight: 600; }
.about, .docs {
  max-width: none; margin: 0;
  padding: 48px max(28px, calc((100% - 720px) / 2)) 40px;
}
.about h1, .docs h1 { font-size: 36px; margin: 0 0 18px; }
.about p { font-size: 16px; line-height: 1.8; margin: 0 0 16px; }
.docs .lead { max-width: none; font-size: 16px; margin: 0 0 8px; }
.docs .lead a { color: var(--primary-blue); }
.docs h2 { font-size: 18px; margin: 32px 0 14px; }
.docs .steps { margin-top: 4px; }
.docs .urls { margin-top: 28px; }
.docs ul.client { list-style: disc; margin: 0; padding-left: 18px; display: grid; gap: 12px; font-size: 15px; }
.docs ul.client li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.docs ul.client a { color: var(--primary-blue); }
.docs ul.client code {
  user-select: all; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--text); font-size: 13px;
}
.docs ul.client button {
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
:root[data-theme="light"] .chip-btn,
:root[data-theme="light"] .lang-btn {
  background: rgba(26, 115, 232, 0.06);
  border-color: rgba(26, 115, 232, 0.18);
}
:root[data-theme="light"] .user-chip {
  background: rgba(26, 115, 232, 0.08);
}
:root[data-theme="light"] .panel,
:root[data-theme="light"] .card,
:root[data-theme="light"] .login-card {
  box-shadow: var(--shadow);
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero h1 { font-size: 2.5rem; }
  .menu-toggle { display: flex; }
  .top-inner { display: flex; justify-content: space-between; padding: 0.85rem 1.25rem; }
  .top nav {
    display: none; position: absolute; top: 54px; left: 0; right: 0;
    background: rgba(12, 13, 18, 0.98); border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem; flex-direction: column; align-items: flex-start; gap: 1.25rem;
    justify-self: stretch;
  }
  .top nav.open { display: flex; }
  :root[data-theme="light"] .top nav { background: rgba(255, 255, 255, 0.98); }
}
