/* ========== 全局基础 ========== */
:root {
  --sidebar-w: 230px;
  --red: #d83a2e;
  --orange: #f57c00;
  --ink: #3d2c23;
  --muted: #9a8a7c;
  --bg: #fdf7ef;
  --line: #f0e6d8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ========== 左侧导航栏 ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #c62828 0%, #e65100 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(183, 28, 28, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
  padding: 0 10px 24px;
}

.brand .logo {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.nav-label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.65;
  padding: 0 12px 8px;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.nav-toggle .tri {
  font-size: 10px;
  letter-spacing: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sidebar nav a.active {
  background: #fff;
  color: var(--red);
  font-weight: bold;
}

.sidebar nav a .ico {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.7;
  padding: 0 12px;
}

/* ========== 主内容区 ========== */
.main {
  margin-left: var(--sidebar-w);
  padding: 44px 48px 60px;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.page-title {
  font-size: 28px;
  margin-bottom: 6px;
}

.page-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ========== 卡片 ========== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 28px rgba(120, 70, 20, 0.08);
  margin-bottom: 24px;
}

/* ========== 通用按钮 ========== */
.btn {
  display: inline-block;
  padding: 11px 30px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  border: none;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(216, 58, 46, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: #f6efe4;
  color: #8a6d52;
}

.btn.secondary:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========== 小屏适配：导航栏变顶部横条 ========== */
@media (max-width: 768px) {
  .sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
  }

  .brand {
    padding: 0;
    font-size: 17px;
    white-space: nowrap;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .sidebar nav {
    flex-direction: row;
    margin-left: auto;
  }

  .sidebar nav a {
    padding: 8px 14px;
    font-size: 14px;
  }

  .main {
    margin-left: 0;
    padding: 24px 16px 40px;
  }
}

/* ========== 主题系统：导航栏与页面底色跟随当前页面 ========== */
/* 主页：青草绿（生机） */
body.t-green {
  --red: #3e8e4f;
  --orange: #8bc34a;
  --bg: #f4faf1;
  --line: #e2eedb;
}

body.t-green .sidebar {
  background: linear-gradient(180deg, #2e7d43 0%, #689f4e 100%);
  box-shadow: 4px 0 20px rgba(46, 125, 67, 0.22);
}

/* 码字（记事本、AI 反馈）：夕阳橙黄 */
body.t-orange {
  --red: #e0731d;
  --orange: #f5b041;
  --bg: #fdf6ec;
  --line: #f2e6d3;
}

body.t-orange .sidebar {
  background: linear-gradient(180deg, #d96a1e 0%, #f0a83c 100%);
  box-shadow: 4px 0 20px rgba(217, 106, 30, 0.22);
}

/* 名人名言：墨蓝 */
body.t-blue {
  --red: #2f6fa3;
  --orange: #6aa5d8;
  --bg: #f2f7fb;
  --line: #dde9f2;
}

body.t-blue .sidebar {
  background: linear-gradient(180deg, #2a5f8f 0%, #5d95c4 100%);
  box-shadow: 4px 0 20px rgba(42, 95, 143, 0.22);
}

/* 画廊：绯红 */
body.t-rose {
  --red: #c04a63;
  --orange: #e58ba0;
  --bg: #fbf3f4;
  --line: #efdce1;
}

body.t-rose .sidebar {
  background: linear-gradient(180deg, #a63a52 0%, #d4728c 100%);
  box-shadow: 4px 0 20px rgba(166, 58, 82, 0.22);
}

/* ========== 更新日志抽屉（右侧） ========== */
.log-toggle {
  position: fixed;
  right: 18px;
  top: 20px;
  z-index: 150;
  font-family: inherit;
  font-size: 13px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.log-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.log-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 390px;
  max-width: 92vw;
  background: #fffdf9;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.14);
  z-index: 140;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 68px 26px 40px;
}

.log-drawer.open {
  transform: translateX(0);
}

.log-drawer .drawer-title {
  font-size: 17px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
