/* ============================================================
   base.css — Reset & 排版 & 工具类
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-cn);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-secondary); }

button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.3);
}

/* ---------- 页面容器显隐：只用 data-attribute ---------- */
[id^="page-"] { display: none; }
[id^="page-"][data-active] { display: block; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10,14,23,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(88,166,255,0.15);
  z-index: 1000;
}

.nav-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--page-padding);
  gap: 16px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover,
.nav-links a[data-active] {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 16px;
  transition: background 0.2s;
}
.nav-icon-btn:hover { background: var(--bg-hover); }

/* ---------- 主内容区 ---------- */
.main-content {
  padding-top: calc(var(--nav-height) + 16px);
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
  padding-bottom: 80px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- Loading 遮罩 ---------- */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,14,23,0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ---------- 工具类 ---------- */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--accent-danger); }
.text-success { color: var(--accent-success); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ---------- 底部 Tab 导航（移动端） ---------- */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(10,14,23,0.8);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(88,166,255,0.15);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--text-muted); padding: 4px 12px; border-radius: 8px;
  transition: color 0.2s;
}
.tab-item[data-active] { color: var(--accent-primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .nav-links { display: none; }
}
@media (max-width: 767px) {
  .main-content { padding-bottom: 72px; }
  .bottom-tabs { display: flex; }
}
@media (max-width: 479px) {
  :root { --page-padding: 12px; }
}
