/* ================================================================
   TaoRubber 共享样式 — 所有页面通用
   ================================================================ */

/* ── 变量 ── */
:root {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --bg3:     #1c2128;
  --bg4:     #22272e;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --accent:  #4493f8;
  --accent2: #3fb950;
  --danger:  #f85149;
  --amber:   #e3b341;
  --text:    #e6edf3;
  --text2:   #7d8590;
  --text3:   #cdd9e5;
  --mono:    'JetBrains Mono', monospace;
  --sans:    'Noto Sans SC', sans-serif;
  --radius:  8px;
}
[data-theme="light"] {
  --bg:      #ffffff;
  --bg2:     #f6f8fa;
  --bg3:     #f0f2f5;
  --bg4:     #e8eaed;
  --border:  rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.12);
  --text:    #1f2328;
  --text2:   #656d76;
  --text3:   #434a54;
}

/* ── Reset & Base ── */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(68,147,248,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68,147,248,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none; z-index: 0;
}

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes blink {
  0%,100% { opacity:1; }
  50%     { opacity:.35; }
}
@keyframes shimmer {
  0%   { background-position:200% 0; }
  100% { background-position:-200% 0; }
}
@keyframes spin {
  to { transform:rotate(360deg); }
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none; border: 1px solid var(--border2);
  border-radius: 6px; padding: 4px 8px;
  cursor: pointer; font-size: .9rem; line-height: 1;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ── Badges ── */
.badge {
  font-family: var(--mono); font-size: .72rem;
  font-weight: 600; padding: 2px 9px; border-radius: 4px;
}
.badge-green {
  background: rgba(63,185,80,.12);  color: #56d364;
  border: 1px solid rgba(63,185,80,.25);
}
.badge-blue {
  background: rgba(68,147,248,.12); color: #79c0ff;
  border: 1px solid rgba(68,147,248,.25);
}
.badge-gray {
  background: rgba(125,133,144,.12); color: var(--text2);
  border: 1px solid var(--border2);
}
.badge-amber {
  background: rgba(227,179,65,.12);  color: var(--amber);
  border: 1px solid rgba(227,179,65,.25);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius); border: none;
  font-family: var(--sans); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: opacity .15s; text-decoration: none;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent);  color: #fff; }
.btn-success { background: var(--accent2); color: #0d1117; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }

/* ── Section Title ── */
.section-title {
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 18px;
  font-size: .88rem; color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 8px;
  transform: translateY(80px); opacity: 0;
  transition: transform .3s, opacity .3s; z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok   { border-color: rgba(63,185,80,.3); }
.toast.err  { border-color: rgba(248,81,73,.3); }

/* ── Navbar (public pages) ── */
.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.9);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
  transition: background .3s;
}
[data-theme="light"] .navbar { background: rgba(255,255,255,0.9); }
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--mono); font-size: 1rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.logo-dot {
  width: 7px; height: 7px; background: var(--accent2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent2);
  animation: blink 2.4s ease-in-out infinite;
}
.logo-muted { color: var(--text2); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  text-decoration: none; color: var(--text2);
  font-size: .88rem; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links .active { color: var(--accent) !important; }

.btn-login {
  background: var(--accent) !important; color: #fff !important;
  padding: 7px 18px; border-radius: 6px;
  font-size: .85rem; font-weight: 500;
  transition: opacity .2s !important;
  cursor: pointer; font-family: var(--sans);
  border: none; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-login:hover { opacity: .82 !important; }
.btn-login .nav-arrow { font-size: .65rem; transition: transform .2s; }

/* ── Page Header & Breadcrumb ── */
.page-header { padding: 52px 0 36px; }
.breadcrumb {
  font-family: var(--mono); font-size: .75rem;
  color: var(--text2); margin-bottom: 12px;
}
.breadcrumb a {
  color: var(--text2); text-decoration: none; transition: color .2s;
}
.breadcrumb a:hover { color: var(--text); }
.page-header h1 {
  font-size: 1.8rem; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 8px;
}
.page-header p { color: var(--text2); font-size: .95rem; }

/* ── Footer (public pages) ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text2);
  font-size: .82rem;
  transition: border-color .3s;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text2); text-decoration: none; transition: color .2s;
}
.footer-links a:hover { color: var(--text); }
.footer .active { color: var(--accent) !important; }
.beian a {
  color: var(--text2); text-decoration: none;
  font-size: .78rem; margin-top: 8px;
  display: inline-block; transition: color .2s;
}
.beian a:hover { color: var(--accent); }

/* ── Nav User Dropdown (login.html, used on other pages) ── */
.nav-user { position: relative; display: inline-block; }
.nav-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 10px; padding: 6px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  display: none; min-width: 160px;
  animation: menuIn .15s ease;
}
.nav-user-menu.show { display: block; }
@keyframes menuIn {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
.nav-user-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 6px;
  color: var(--text3); text-decoration: none;
  font-size: .84rem; transition: background .12s, color .12s;
}
.nav-user-menu a:hover { background: var(--bg4); color: var(--text); }
.nav-user-menu a .um-icon {
  font-size: 1rem; width: 20px;
  text-align: center; flex-shrink: 0;
}
.nav-user-menu .divider {
  height: 1px; background: var(--border);
  margin: 4px 10px;
}
.nav-user-menu a.danger:hover { color: var(--danger); }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ── Responsive navbar (shared) ── */
@media(max-width:720px) {
  .nav-links { gap: 12px; }
  .nav-links a:not(.btn-login) { display: none; }
  .nav-links .theme-toggle { display: inline-block !important; }
}
