/* ============================================================
   个人简介网站 · 全局样式表
   参考风格：Apple（极简留白 / 大标题）+ Porsche（深色大气）
             + Aston Martin（深色底 / 金色点缀）
   姓名：张三   学号：2-40
   ============================================================ */

/* ---------- 1. 设计变量（色彩系统） ---------- */
:root {
  --bg-light: #f5f5f7;        /* Apple 式浅灰背景 */
  --bg-dark: #0b0b0d;         /* Porsche 式深色背景 */
  --bg-card: #16161a;         /* 深色卡片 */
  --text-dark: #1d1d1f;       /* 深色文字 */
  --text-light: #f5f5f7;      /* 浅色文字 */
  --text-gray: #86868b;       /* 辅助灰文字（Apple 灰） */
  --gold: #c8a35f;            /* Aston Martin 式金色点缀 */
  --gold-light: #e3c98f;
  --radius: 18px;
  --max-width: 1080px;

  /* --- 供“深色模式”整体换肤使用的语义变量（BOM 任务 4） --- */
  --surface: #ffffff;         /* 卡片/表单等浅色面板底色 */
  --line: #e5e5ea;            /* 分割线 */
  --line-soft: #ececf0;       /* 更淡的分割线 / 边框 */
  --line-strong: #d2d2d7;     /* 输入框、虚线框的边框 */
  --hover: #fafafc;           /* 表格行 hover 底色 */
}

/* ---------- 1.1 深色主题：由 common.js 给 <html> 加 theme-dark 类 ---------- */
/* 只覆盖变量，所有引用这些变量的组件会自动换色，实现整站换肤 */
html.theme-dark {
  --bg-light: #101014;
  --bg-dark: #08080a;
  --bg-card: #17171c;
  --surface: #1b1b21;
  --text-dark: #f2f2f6;
  --text-light: #f5f5f7;
  --text-gray: #9c9ca6;
  --line: #2b2b33;
  --line-soft: #26262d;
  --line-strong: #3a3a44;
  --hover: #202027;
}

/* ---------- 2. 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- 3. 顶部导航（毛玻璃效果） ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(11, 11, 13, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.nav-logo {
  color: var(--gold); font-weight: 700; font-size: 17px;
  letter-spacing: 2px;
}
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  color: var(--text-light); font-size: 14px; opacity: 0.85;
  transition: opacity 0.25s, color 0.25s;
}
.nav-links a:hover { opacity: 1; color: var(--gold); }
.nav-links a.active { color: var(--gold); opacity: 1; }

/* ---------- 4. 首屏 Hero（Porsche 式深色大气） ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  color: var(--text-light);
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(200, 163, 95, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 110%, rgba(60, 70, 110, 0.25), transparent 60%),
    var(--bg-dark);
  position: relative; overflow: hidden;
  padding: 90px 24px 70px;
}
.hero-kicker {
  color: var(--gold); letter-spacing: 6px; font-size: 14px;
  text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 700; letter-spacing: 4px; line-height: 1.15;
}
.hero h1 .thin { font-weight: 300; color: var(--text-gray); }
.hero .hero-sub {
  margin-top: 18px; font-size: 18px; color: var(--text-gray);
  max-width: 560px;
}
.hero-actions { margin-top: 40px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

/* 金色描边按钮（Aston Martin 质感） */
.btn {
  display: inline-block; padding: 12px 34px; border-radius: 999px;
  font-size: 15px; transition: all 0.3s ease; cursor: pointer; border: none;
}
.btn-gold {
  background: var(--gold); color: #14100a; font-weight: 600;
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.35); color: var(--text-light);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* 首屏底部滚动提示 */
.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: var(--text-gray); font-size: 12px; letter-spacing: 3px;
  animation: float 2.2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- 5. 区块标题（Apple 式大标题） ---------- */
.section { padding: 96px 0; }
.section-dark { background: var(--bg-dark); color: var(--text-light); }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .kicker {
  color: var(--gold); font-size: 13px; letter-spacing: 4px;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(30px, 5vw, 44px); font-weight: 700;
  margin-top: 12px; letter-spacing: 1px;
}
.section-head p { color: var(--text-gray); margin-top: 12px; font-size: 16px; }
.section-dark .section-head h2 { color: var(--text-light); }

/* ---------- 6. 首页「关于我」三栏卡片 ---------- */
.cards-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 36px 28px; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12); }
.card .icon { font-size: 40px; margin-bottom: 16px; }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--text-gray); }

/* ---------- 7. 深色区块：设计风格来源 ---------- */
.style-refs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.ref-card {
  background: var(--bg-card); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius); padding: 34px 26px;
  transition: border-color 0.3s, transform 0.3s;
}
.ref-card:hover { border-color: var(--gold); transform: translateY(-4px); }
.ref-card .tag {
  display: inline-block; font-size: 12px; letter-spacing: 2px;
  color: var(--gold); border: 1px solid var(--gold);
  border-radius: 999px; padding: 3px 12px; margin-bottom: 16px;
}
.ref-card h3 { font-size: 18px; margin-bottom: 10px; }
.ref-card p { font-size: 14px; color: var(--text-gray); }

/* ---------- 8. 数据统计条 ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  text-align: center;
}
.stat .num {
  font-size: 40px; font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat .label { color: var(--text-gray); font-size: 14px; margin-top: 6px; }

/* ---------- 9. 个人简介页 ---------- */
.profile-hero {
  padding: 150px 0 70px; text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(200, 163, 95, 0.15), transparent 65%),
    var(--bg-dark);
  color: var(--text-light);
}
.avatar {
  width: 128px; height: 128px; border-radius: 50%;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, var(--gold), #6b5a3a);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 700; color: #14100a;
  border: 3px solid rgba(255, 255, 255, 0.25);
}
.profile-hero h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: 3px; }
.profile-hero .sub { color: var(--text-gray); margin-top: 10px; }

/* 信息表 */
.info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 40px;
  background: var(--surface); border-radius: var(--radius); padding: 40px 44px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.info-item { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 12px 0; }
.info-item .k { color: var(--text-gray); font-size: 14px; }
.info-item .v { font-size: 15px; font-weight: 600; }

/* 时间线 */
.timeline { position: relative; max-width: 720px; margin: 0 auto; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--gold), rgba(200, 163, 95, 0.15));
}
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(200, 163, 95, 0.2);
}
.tl-item .time { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.tl-item h3 { font-size: 18px; margin: 4px 0 6px; }
.tl-item p { font-size: 14px; color: var(--text-gray); }

/* 技能进度条 */
.skill { margin-bottom: 22px; }
.skill .row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.skill .row .pct { color: var(--text-gray); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  width: 0; transition: width 1.2s ease;
}

/* ---------- 10. 留言板 ---------- */
.board-layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 32px;
  align-items: start;
}
.board-form, .board-list {
  background: var(--surface); border-radius: var(--radius);
  padding: 34px 30px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.board-form h3, .board-list h3 { font-size: 18px; margin-bottom: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-gray); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; font-family: inherit;
  background: var(--bg-light); transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(200, 163, 95, 0.18);
}
.board-form .btn { width: 100%; }
.form-tip { font-size: 12px; color: var(--text-gray); margin-top: 12px; text-align: center; }

/* 留言列表 */
.msg-item {
  border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 14px;
  animation: msgIn 0.4s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg-item .meta {
  display: flex; justify-content: space-between; font-size: 13px;
  color: var(--text-gray); margin-bottom: 6px;
}
.msg-item .meta .name { color: var(--text-dark); font-weight: 600; }
.msg-item .content { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.board-empty {
  text-align: center; color: var(--text-gray); font-size: 14px;
  padding: 40px 0; border: 1px dashed var(--line-strong); border-radius: 14px;
}
.list-foot { text-align: right; margin-top: 8px; }
.btn-text {
  background: none; border: none; color: var(--text-gray);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}
.btn-text:hover { color: #c0392b; }

/* ---------- 11. 页脚 ---------- */
.footer {
  background: var(--bg-dark); color: var(--text-gray);
  padding: 44px 0; text-align: center; font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer .foot-logo { color: var(--gold); font-weight: 700; letter-spacing: 2px; margin-bottom: 8px; }
.footer .links { margin: 10px 0 6px; display: flex; gap: 26px; justify-content: center; }
.footer .links a:hover { color: var(--gold); }

/* ---------- 14. 管理后台 ---------- */
/* 管理员登录 */
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 110px 24px 60px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(200, 163, 95, 0.18), transparent 65%),
    var(--bg-dark);
}
.admin-login {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--surface); border-radius: var(--radius);
  padding: 42px 36px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.admin-login .lock { font-size: 40px; margin-bottom: 8px; }
.admin-login h2 { font-size: 24px; letter-spacing: 2px; }
.admin-login .hint { color: var(--text-gray); font-size: 13px; margin: 6px 0 24px; }
.admin-login .field { text-align: left; }
.admin-login .btn { margin-top: 6px; }

/* 控制台头部 */
.admin-hero {
  background:
    radial-gradient(ellipse 70% 60% at 20% 0%, rgba(200, 163, 95, 0.16), transparent 65%),
    var(--bg-dark);
  color: var(--text-light);
  padding: 130px 0 46px;
}
.admin-hero .container {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.admin-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: 3px; }
.admin-hero-right { display: flex; align-items: center; gap: 14px; }
.admin-badge {
  border: 1px solid var(--gold); color: var(--gold);
  border-radius: 999px; padding: 5px 16px; font-size: 13px;
}
.btn-logout-dark { color: var(--text-light); border-color: rgba(255, 255, 255, 0.3); }
.btn-logout-dark:hover { border-color: var(--gold); color: var(--gold); }

/* 标签页 */
.admin-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.admin-tab {
  background: none; border: none; cursor: pointer;
  padding: 12px 22px; font-size: 15px; font-family: inherit;
  color: var(--text-gray); border-bottom: 2px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.admin-tab:hover { color: var(--text-dark); }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: msgIn 0.35s ease; }

/* 统计卡片 */
.stat-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 26px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 26px 22px;
  text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border-top: 3px solid var(--gold);
  transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card .icon { font-size: 26px; }
.stat-card .num {
  font-size: 34px; font-weight: 700; color: var(--text-dark);
  font-variant-numeric: tabular-nums; margin: 6px 0 2px;
}
.stat-card .label { font-size: 13px; color: var(--text-gray); }

/* 通用卡片 */
.admin-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px 28px 24px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}
.admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.admin-card-head h3 { font-size: 17px; }
.admin-card-head .count { font-size: 13px; color: var(--text-gray); font-weight: 400; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* 趋势图 */
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--text-gray); }
.legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px;
}
.legend .dot.gold { background: var(--gold); }
.legend .dot.gray { background: var(--text-gray); }
.chart {
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 12px; padding: 16px 8px 0; border-bottom: 1px solid var(--line);
}
.chart .bar-group {
  flex: 1; display: flex; flex-direction: column; align-items: center;
}
.chart .bar-col {
  height: 140px; display: flex; align-items: flex-end; gap: 5px;
}
.chart .bar {
  width: 16px; border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
}
.chart .bar.gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.chart .bar.gray { background: #c7c7cc; }
.chart .x-label { font-size: 12px; color: var(--text-gray); margin: 8px 0 10px; }

/* 最新留言 */
.mini-msg {
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
}
.mini-msg-head {
  display: flex; justify-content: space-between; font-size: 13px;
  color: var(--text-gray); margin-bottom: 4px;
}
.mini-msg-head .name { color: var(--text-dark); font-weight: 600; }
.mini-msg-body { font-size: 14px; word-break: break-word; }

/* 工具栏与搜索 */
.admin-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-search {
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-family: inherit;
  background: var(--bg-light); width: 240px;
}
.admin-search:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(200, 163, 95, 0.15);
}
.btn-mini {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-dark);
  border-radius: 999px; padding: 6px 16px; font-size: 13px;
  font-family: inherit; cursor: pointer; transition: all 0.25s;
}
.btn-mini:hover { border-color: var(--gold); color: var(--gold); }
.btn-mini.danger { color: #c0392b; border-color: rgba(192, 57, 43, 0.5); }
.btn-mini.danger:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; padding: 12px 12px; white-space: nowrap;
  color: var(--text-gray); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.admin-table td {
  padding: 12px 12px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--hover); }
.admin-table .mono { font-family: Consolas, Monaco, monospace; letter-spacing: 0.5px; }
.admin-table .msg-cell { max-width: 340px; word-break: break-word; }
.td-empty { text-align: center; color: var(--text-gray); padding: 40px 0 !important; }
.table-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; flex-wrap: wrap;
}

/* 系统设置 */
.sys-note { font-size: 13px; color: var(--text-gray); margin-bottom: 16px; }
.sys-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(11, 11, 13, 0.55);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 82vh; overflow: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: msgIn 0.3s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--surface);
}
.modal-head h3 { font-size: 17px; }
.modal-close {
  background: none; border: none; font-size: 24px; line-height: 1;
  color: var(--text-gray); cursor: pointer;
}
.modal-close:hover { color: #c0392b; }
.modal-body { padding: 12px 24px 24px; }
.modal-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.modal-row .k { color: var(--text-gray); white-space: nowrap; }
.modal-row .v { text-align: right; word-break: break-all; }

@media (max-width: 860px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-search { width: 100%; }
}
@media (max-width: 560px) {
  .stat-cards { grid-template-columns: 1fr; }
}

/* ---------- 13. 用户注册页 ---------- */
.reg-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 32px;
  align-items: start;
}
/* 左侧"说明"面板 */
.reg-notice {
  background: var(--bg-dark); color: var(--text-light);
  border-radius: var(--radius); padding: 30px 28px;
  border: 1px solid rgba(200, 163, 95, 0.35);
  position: sticky; top: 76px;
}
.reg-notice h3 {
  color: var(--gold); font-size: 18px; letter-spacing: 2px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(200, 163, 95, 0.3);
}
.reg-notice ul { list-style: none; }
.reg-notice li {
  font-size: 13px; color: var(--text-gray); line-height: 1.8;
  padding: 8px 0 8px 16px; position: relative;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.reg-notice li:last-child { border-bottom: none; }
.reg-notice li::before {
  content: "★"; position: absolute; left: 0; top: 8px;
  color: var(--gold); font-size: 10px;
}
.reg-notice li b { color: var(--text-light); }

/* 右侧表单卡片 */
.reg-form {
  background: var(--surface); border-radius: var(--radius);
  padding: 38px 36px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.reg-row { display: grid; gap: 18px; margin-bottom: 6px; }
.reg-row-2 { grid-template-columns: 1fr 1fr; }
.reg-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.req { color: #c0392b; font-style: normal; }

.reg-form .field label { font-size: 13px; }
.reg-form select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 12px; font-size: 14px; font-family: inherit;
  background: var(--bg-light); transition: border-color 0.25s;
}
.reg-form select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(200, 163, 95, 0.18);
}
.addr-group { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* 校验错误提示 */
.err {
  font-size: 12px; color: #c0392b; margin-top: 5px;
  min-height: 16px; line-height: 16px;
}
.field input.invalid, .field select.invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12) !important;
}
.field input.valid { border-color: #27ae60 !important; }

/* 提交按钮区 */
.reg-actions {
  display: flex; justify-content: center; gap: 18px; margin-top: 24px;
}
.btn-ghost-dark {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-dark);
}
.btn-ghost-dark:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- 留言板登录门槛 ---------- */
.msg-gate {
  background: var(--surface); border-radius: var(--radius);
  padding: 46px 34px; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border: 1px dashed var(--line-strong);
}
.msg-gate .icon { font-size: 42px; margin-bottom: 12px; }
.msg-gate h3 { font-size: 20px; margin-bottom: 8px; }
.msg-gate p { color: var(--text-gray); font-size: 14px; margin-bottom: 22px; }
.user-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(200, 163, 95, 0.1); border: 1px solid rgba(200, 163, 95, 0.35);
  border-radius: 12px; padding: 10px 18px; margin-bottom: 22px;
  font-size: 14px;
}
.user-bar .who { color: var(--text-dark); }
.user-bar .who b { color: var(--gold); }
.btn-logout {
  background: none; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 16px; font-size: 13px; cursor: pointer; color: var(--text-gray);
  transition: all 0.25s;
}
.btn-logout:hover { border-color: #c0392b; color: #c0392b; }

@media (max-width: 860px) {
  .reg-layout { grid-template-columns: 1fr; }
  .reg-notice { position: static; }
  .reg-row-2, .reg-row-3 { grid-template-columns: 1fr; }
  .addr-group { grid-template-columns: 1fr; }
}

/* ---------- 12. 响应式（人机交互：移动端适配） ---------- */
@media (max-width: 860px) {
  .cards-3, .style-refs, .stats { grid-template-columns: 1fr 1fr; }
  .board-layout { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cards-3, .style-refs, .stats { grid-template-columns: 1fr; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }
}


/* ============================================================
   15. BOM 功能模块样式（本次增量开发新增）
   —— 日间/夜间切换、页脚访问统计、访客信息卡片、
      小屏提示条、打字机光标、留言删除按钮、回到顶部
   ============================================================ */

/* ---------- 15.1 导航右侧：链接 + 主题切换按钮 ---------- */

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-light); border-radius: 999px;
  padding: 5px 14px; font-size: 12px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.theme-toggle:hover {
  border-color: var(--gold); color: var(--gold);
  background: rgba(200, 163, 95, 0.12);
}

/* ---------- 15.2 页脚：第 N 次访问 + 本次停留时长 ---------- */
.bom-bar {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  justify-content: center; margin-top: 18px;
}
.bom-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 5px 16px;
  font-size: 12px; color: var(--text-gray);
}
.bom-chip b {
  color: var(--gold); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 15.3 个人简介页：访客环境画像 ---------- */
.visitor-section {
  background: var(--bg-light); border-top: 1px solid var(--line);
  padding: 70px 0 80px;
}
.visitor-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.visitor-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 22px;
  transition: border-color 0.3s, transform 0.3s;
}
.visitor-item:hover { border-color: var(--gold); transform: translateY(-3px); }
.visitor-item .k {
  font-size: 12px; letter-spacing: 2px; color: var(--gold);
  text-transform: uppercase;
}
.visitor-item .v {
  font-size: 16px; font-weight: 600; margin-top: 6px;
  word-break: break-word;
}
.visitor-item .sub { font-size: 12px; color: var(--text-gray); margin-top: 4px; }
.visitor-item.wide { grid-column: 1 / -1; }
.visitor-item.wide .v {
  font-size: 12px; font-weight: 400; line-height: 1.7;
  font-family: Consolas, Monaco, monospace; color: var(--text-gray);
}

/* 小屏设备提示条（与 alert 弹窗配合，可一直看到） */
.bom-tip { max-width: var(--max-width); margin: 52px auto 0; padding: 0 24px; display: none; }
.bom-tip.show { display: block; }
.bom-tip-inner {
  background: rgba(200, 163, 95, 0.12);
  border: 1px solid rgba(200, 163, 95, 0.45);
  border-radius: 12px; padding: 12px 18px;
  font-size: 14px; color: var(--text-dark);
}

/* ---------- 15.4 首页：打字机光标 ---------- */
.hero-sub.typewriter { min-height: 78px; }
.type-cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--gold); vertical-align: -2px; margin-left: 3px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- 15.5 留言板：删除按钮 + 页面跳转操作区 ---------- */
.msg-item .meta { align-items: center; gap: 12px; }
.meta-right { display: inline-flex; align-items: center; gap: 10px; }
.msg-del {
  background: none; border: 1px solid var(--line-strong);
  border-radius: 999px; color: var(--text-gray);
  font-size: 12px; font-family: inherit; padding: 2px 12px;
  cursor: pointer; transition: all 0.25s;
}
.msg-del:hover {
  border-color: #c0392b; color: #fff; background: #c0392b;
}
.page-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 14px; margin: 40px 0 0;
}
.page-actions .btn { padding: 10px 26px; font-size: 14px; }
.page-actions .note {
  flex-basis: 100%; text-align: center;
  font-size: 12px; color: var(--text-gray);
}

/* ---------- 15.6 回到顶部悬浮按钮（挑战 2） ---------- */
.back-top {
  position: fixed; right: 24px; bottom: 28px; z-index: 250;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(200, 163, 95, 0.5);
  background: rgba(11, 11, 13, 0.82); color: var(--gold);
  font-size: 20px; line-height: 1; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s,
              background 0.25s, color 0.25s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--gold); color: #14100a; }

/* ---------- 15.7 深色模式下的细节修正 ---------- */
/* 让表单控件（输入框、下拉框、滚动条）也用深色原生外观，
   否则深色模式下 input 会出现"黑字 + 深底"看不清的问题 */
html.theme-dark { color-scheme: dark; }
html.theme-dark .field input,
html.theme-dark .field textarea,
html.theme-dark .field select,
html.theme-dark .admin-search,
html.theme-dark .reg-form select { color: var(--text-dark); }
html.theme-dark .field input::placeholder,
html.theme-dark .field textarea::placeholder,
html.theme-dark .admin-search::placeholder { color: #7c7c88; }

html.theme-dark .section-dark { border-top: 1px solid var(--line-soft); }
html.theme-dark .card,
html.theme-dark .info-grid,
html.theme-dark .board-form,
html.theme-dark .board-list,
html.theme-dark .msg-gate,
html.theme-dark .reg-form,
html.theme-dark .admin-card,
html.theme-dark .stat-card,
html.theme-dark .admin-login,
html.theme-dark .modal { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
html.theme-dark .modal-head { border-bottom-color: var(--line-soft); }
html.theme-dark .chart .bar.gray { background: #3a3a44; }
html.theme-dark .msg-del:hover { color: #fff; }

/* 主题切换时的过渡（只给大面积面板加，避免影响既有动画） */
body { transition: background-color 0.35s ease, color 0.35s ease; }
.info-grid, .board-form, .board-list, .msg-gate, .reg-form,
.admin-card, .stat-card, .visitor-item, .modal, .info-item {
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease;
}

/* ---------- 15.8 响应式补充 ---------- */
@media (max-width: 860px) {
  .visitor-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .visitor-grid { grid-template-columns: 1fr; }
  .theme-toggle { padding: 6px 10px; }
  .theme-toggle .txt { display: none; }
  .page-actions .btn { width: 100%; text-align: center; }

  /* 小屏时导航改成两行：第一行 logo + 主题按钮，第二行菜单，避免挤出屏幕 */
  .navbar .container {
    display: grid; height: auto; min-height: 52px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo theme" "links links";
    row-gap: 6px; padding-top: 8px; padding-bottom: 8px;
  }
  .nav-logo { grid-area: logo; }
  .theme-toggle { grid-area: theme; }
  .nav-links { grid-area: links; justify-content: center; flex-wrap: wrap; gap: 10px; }
  /* 导航变高后，小屏提示条要往下挪，别被导航挡住 */
  .bom-tip { margin-top: 108px; }
}

/* ---------- 15.9 拓展：BOM 小实验台 ---------- */
.lab-section { padding: 0 0 84px; background: var(--bg-light); }
.lab-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.lab-btn {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text-dark); border-radius: 12px;
  padding: 14px 12px; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: all 0.25s;
}
.lab-btn:hover {
  border-color: var(--gold); color: var(--gold);
  transform: translateY(-2px);
}
.lab-btn:active { transform: translateY(0); }
.lab-result {
  margin-top: 18px; padding: 16px 20px; min-height: 56px;
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: 12px; font-size: 14px; color: var(--text-gray);
  line-height: 1.8; white-space: pre-line;
}
@media (max-width: 860px) { .lab-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .lab-grid { grid-template-columns: 1fr; } }
