/* ====== 公用主题 (shared/theme.css) ====== */
/* 所有板块通过 <link rel="stylesheet" href="/shared/theme.css"> 引用 */

:root {
  --gold-light: #fef3c7;
  --gold-mid: #f0d060;
  --gold-dark: #d4a017;
  --gold-gradient: linear-gradient(135deg, #f0d060 0%, #d4a017 30%, #fef3c7 50%, #d4a017 70%, #f0d060 100%);
  --bg-primary: #080c16;
  --bg-card: #0d1220;
  --bg-card-hover: #111827;
  --bg-input: #1a2540;
  --bg-input-hover: #243356;
  --border-default: #1a2035;
  --border-light: #2a3a60;
  --border-accent: #d4a017;
  --text-primary: #e0e0e0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --red: #dc2626;
  --red-hover: #b91c1c;
  --green: #16a34a;
}

* { margin: 0; padding: 0; box-sizing: border-box;  scrollbar-width: thin;
  scrollbar-color: #1e2d45 transparent;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2d45; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2a3a60; }


/* ====== 全局重置 ====== */

body {
  background: var(--bg-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  padding: 1rem;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard {
  max-width: 1500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ====== 顶部导航栏 ====== */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.8rem 1.5rem;
  border-radius: 2rem;
  box-shadow: 0 10px 25px -8px rgba(0,0,0,0.3);
  border: 1px solid var(--border-default);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon {
  background: var(--gold-gradient);
  background-size: 200% auto;
  color: #7c2d00;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 8px 18px rgba(217,119,6,0.3);
  animation: goldShine 3s linear infinite;
}

.header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  animation: goldShine 3s linear infinite;
}

/* 金色文字渐变（公用） */
.gold-text {
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShine 3s linear infinite;
}

@keyframes goldShine {
  to { background-position: 200% center; }
}

/* ====== 桌面端导航标签 ====== */
.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card-hover);
  padding: 0.22rem;
  border-radius: 2rem;
  flex-shrink: 0;
}

.nav-tab {
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-tab .nav-text {
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShine 3s linear infinite;
}

.nav-tab.active {
  background: var(--bg-input);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-tab:hover:not(.active) {
  background: rgba(255,255,255,0.08);
}

/* ====== 实时标签 ====== */
.live-badge {
  background: var(--bg-input);
  color: #ef4444;
  padding: 0.25rem 0.8rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ====== 桌面端"设置首页"弹窗 ====== */
.nav-settings-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.nav-settings-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 1rem;
  padding: 0.5rem;
  min-width: 170px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.5);
  z-index: 200;
}

.nav-settings-popover.show { display: block; }

.nav-settings-popover .popover-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-settings-popover .popover-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: 0.15s;
}

.nav-settings-popover .popover-option:hover {
  background: var(--bg-input);
  color: #fff;
}

.nav-settings-popover .popover-option .check {
  margin-left: auto;
  color: var(--gold-mid);
  font-size: 0.75rem;
}

/* ====== 手机端底部导航 ====== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-default);
  z-index: 1000;
  padding: 0.3rem 0;
  padding-bottom: calc(0.3rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.65rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i { font-size: 1rem; }

.mobile-nav-item.active { color: var(--gold-mid); }

.mobile-nav-item .nav-text {
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShine 3s linear infinite;
}

/* 手机端首页选择弹窗 */
.mobile-home-popover {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.mobile-home-popover.show { display: block; }

.mobile-home-popover-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.mobile-home-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 1rem 1rem 0 0;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-default);
}

.mobile-home-sheet-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.8rem;
}

.mobile-home-sheet-title .gold-text,
.mobile-home-sheet-title.gold-text {
  /* 兼容已有 gold-text class */
}

.mobile-home-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: 0.5rem;
}

.mobile-home-option:hover { background: var(--bg-input); }

.mobile-home-option .check {
  margin-left: auto;
  color: var(--gold-mid);
  font-size: 0.8rem;
}

/* ====== 公用卡片 ====== */
.shared-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1rem 1.2rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: 1px solid var(--border-default);
}

/* ====== 页脚 ====== */
.footer-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-wrap: wrap;
  max-width: 1500px;
  width: 100%;
  margin: 14px auto 0;
  justify-content: space-between;
  border: 1px solid var(--border-default);
}

.footer-col { text-align: center; flex: 1; }

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.4rem 0;
}

.footer-col p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.footer-col a { color: var(--red-hover); text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }

.footer-bottom {
  text-align: center;
  padding: 0.7rem 0 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--text-secondary); text-decoration: underline; }

/* ====== 模态框基础 ====== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  width: 90vw;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.25s ease;
  border: 1px solid var(--border-default);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1e2d45;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: var(--bg-input);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--bg-input-hover); color: var(--text-primary); }

.modal-body {
  flex: 1;
  padding: 0;
  overflow-y: auto;
}

/* ====== 公用 Toast ====== */
.shared-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #d4a017, #f0d060);
  color: #7c2d00;
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 25px rgba(217,119,6,0.4);
}

.shared-toast.show { opacity: 1; }

/* ====== 响应式：平板 ====== */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 65px; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .footer-card { flex-direction: column; gap: 16px; text-align: center; }
  .footer-col { flex: none; }
}

/* ====== 响应式：小屏手机 ====== */
@media (max-width: 480px) {
  body { padding: 0.5rem 0.5rem 65px 0.5rem; }
  .dashboard { gap: 10px; }
  .header { padding: 0.6rem 1rem; gap: 6px; }
  .header h1 { font-size: 1.2rem; }
  .logo-area { gap: 0.5rem; }
  .logo-icon { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 8px; }
  .nav-tab { padding: 0.45rem 0.7rem; font-size: 0.72rem; }
  .nav-tabs { gap: 0.15rem; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  .footer-card { padding: 0.8rem 1rem; }
  .footer-col h4 { font-size: 0.78rem; }
  .footer-col p { font-size: 0.7rem; }
  .footer-bottom { font-size: 0.65rem; padding: 0.5rem 0 0.7rem; }
}
