/* SunWu.Si — shared styles (design tokens, base, nav, footer, controls)
   Used by index.html and login.html; docs/dashboard keep page-scoped styles. */

/* ---------- design tokens ---------- */
:root {
  --bg: #000;
  --surface: #0b0e13;
  --text: #fff;
  --body: #b6bdc8;
  --muted: #a1a9b6;
  --faint: #8f97a3;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.06);
  --panel: rgba(255, 255, 255, 0.03);
  --green: #3ddba4;
  --amber: #f5b84b;
  --red: #ff9d9d;
  --nav-h: 64px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }

/* ---------- top navigation ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, calc((100% - 1280px) / 2));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-nav.scrolled { border-bottom-color: var(--line-soft); }
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em;
}
.nav-mark { display: block; width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links .nav-login {
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  padding: 7px 18px; color: #e9edf3;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-links .nav-login:hover { background: #fff; color: #000; border-color: #fff; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px max(24px, calc((100% - 1280px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  color: var(--faint); font-size: 0.82rem;
}
.site-footer a { color: var(--muted); transition: color 0.2s; }
.site-footer a:hover { color: #fff; }

/* ---------- controls ---------- */
.btn {
  background: #fff; color: #000; border: none; border-radius: 10px;
  padding: 12px 24px; font-size: 0.95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background 0.2s, transform 0.1s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.88); }
.btn:active { transform: scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-ghost { background: transparent; color: #e9edf3; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-ghost:hover { background: #fff; color: #000; }

input, select {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; color: var(--text); font-size: 0.95rem; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: rgba(255, 255, 255, 0.45); }
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--faint); margin: 14px 0 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #14181f; border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 11px 20px; font-size: 0.88rem; z-index: 50;
  max-width: min(560px, calc(100vw - 40px));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.toast.ok { border-color: rgba(61, 219, 164, 0.4); }
.toast.error { border-color: rgba(255, 99, 99, 0.45); }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .site-nav { padding: 0 18px; }
  .nav-name { display: none; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }
  .nav-links .nav-login { padding: 6px 14px; }
  .site-footer { padding: 24px 18px; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .nav-links { gap: 11px; }
  .nav-links a { font-size: 0.8rem; }
}
