:root {
  --sidebar-w: 240px;
  --text-secondary: #64748b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: #333;
  background: #f7f7f9;
  overflow-x: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: #f0f7ff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid #e2e8f0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 0.6rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.78rem;
  transition: all 0.15s;
}

.sidebar-footer a:hover {
  background: #dbeafe;
  color: #1e40af;
}

/* ===== 主内容区 ===== */
.main-area {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem 3rem;
  max-width: 1080px;
}

.hero {
  text-align: center;
  padding: 10px 0 26px;
}

.hero h1 {
  font-size: 32px;
  color: #0f172a;
  margin-bottom: 12px;
}

.hero p {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ===== 资源列表 ===== */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-title {
  font-size: 15px;
  font-weight: 700;
  color: #8b8da3;
  letter-spacing: 0.5px;
  margin: 14px 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 76px;
}

.group-title::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #4f46e5;
}

#resource-list,
#help {
  scroll-margin-top: 76px;
}

.resource {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid #e6e6e9;
  border-radius: 10px;
  padding: 14px 18px;
}

.resource .info {
  flex: 1;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.title-row h2 {
  font-size: 18px;
  color: #0f172a;
}

.badge {
  font-size: 12px;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 2px 10px;
}

.resource p {
  color: #555;
  font-size: 14px;
}

.resource .meta {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 6px;
}

.action {
  flex-shrink: 0;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  background: #1e40af;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  font-weight: 600;
}

.btn:hover {
  background: #1e3a8a;
}

/* ===== 使用须知 ===== */
.tip {
  background: #fff;
  border: 1px solid #e6e6e9;
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.tip h2 {
  font-size: 17px;
  margin-bottom: 12px;
  color: #0f172a;
}

.tip ul {
  padding-left: 20px;
  color: #555;
  font-size: 14px;
}

.tip li {
  margin: 6px 0;
}

.tip code {
  background: #f1f1f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid #e8e8ee;
  margin-top: 30px;
  padding: 18px 0 0;
  color: #94a3b8;
  font-size: 13px;
}

/* ===== 响应式 ===== */
@media (min-width: 821px) {
  .hamburger-btn,
  .sidebar-backdrop {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    border-right: none;
    height: 100%;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.show {
    display: block;
    opacity: 1;
  }

  .main-area {
    margin-left: 0;
    padding: 1.5rem 1.25rem 2rem;
    padding-top: 3.6rem;
  }

  .hamburger-btn {
    position: fixed;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 98;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: 0.15s;
    color: #0f172a;
    line-height: 1;
  }

  .hamburger-btn:active {
    background: #e2e8f0;
  }

  .hamburger-btn.open {
    left: 0.65rem;
    opacity: 0;
    pointer-events: none;
  }

  .resource {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .main-area {
    padding: 0.5rem 0.75rem 2rem;
    padding-top: 3.2rem;
  }

  .hero h1 {
    font-size: 24px;
  }
}