/* 多啦A梦的口袋 · 重新设计
* 风格：Dead Simple Sites
* 配色：白 + 浅蓝 + 黑 + 哆啦A梦蓝（主调 #1C9BDA）
* 字体：Inter / Helvetica / Noto Sans SC
*/

:root {
  --bg: #FFFFFF;
  --bg-tint: #F5FAFE;
  --card-bg: #F5F5F5;
  --border: #EAF1F7;
  --border-strong: #D4E5F1;
  --text: #0A2540;
  --text-secondary: #48627E;
  --text-muted: #7A8FA6;
  --text-faint: #AEBFCE;
  --link: #1C9BDA;
  --link-hover: #0E7FB8;
  --accent: #1C9BDA;
  --accent-deep: #0B5A8A;

  --sidebar-w: 300px;
  --content-x: 80px;
  --content-top: 72px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
               'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
}

/* ===== 布局：左固定边栏 + 右主区 ===== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 48px 32px 32px;
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.2;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: #FFFFFF;
}

.sidebar-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
  letter-spacing: 0.05em;
}

.sidebar-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 18px;
}

.sidebar-quote {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 28px;
}

.sidebar-stats {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.sidebar-stats span {
  color: var(--text-muted);
}

.sidebar-nav {
  margin-top: 48px;
}

.sidebar-nav-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  color: var(--text);
  padding: 3px 0;
}

.sidebar-nav-list .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 10px;
  opacity: 0.7;
  vertical-align: 1px;
}

.sidebar-nav-list a.active .dot {
  opacity: 1;
}

.sidebar-nav-list a:hover {
  color: var(--link);
}

.sidebar-nav-list a.active {
  font-weight: 500;
  color: var(--accent);
}

.sidebar-nav-list .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 10px;
  opacity: 0.7;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 0.5px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

.sidebar-footer a {
  color: var(--text-muted);
}

.sidebar-footer a:hover {
  color: var(--link);
}

/* ===== 主区 ===== */
.content {
  padding: var(--content-top) var(--content-x) 96px;
  min-width: 0;
}

/* hero */
.hero {
  margin-bottom: 96px;
}

.hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.hero-text {
  padding: 32px 36px;
  background: var(--bg-tint);
  border: 0.5px solid var(--border);
  border-radius: 24px;
  flex: 1;
}

.hero h1 {
  font-size: 52px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}

.hero-brand h1 {
  margin-bottom: 0;
}

.hero-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  background: #FFFFFF;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
}

.hero-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 160px;
  padding-top: 48px;
  flex-shrink: 0;
}

.hero-dots span {
  display: block;
  border-radius: 50%;
  opacity: 0.85;
}

.hero-dots span:nth-child(1) { width: 14px; height: 14px; }
.hero-dots span:nth-child(2) { width: 10px; height: 10px; margin-top: -8px; }
.hero-dots span:nth-child(3) { width: 16px; height: 16px; margin-top: 4px; }
.hero-dots span:nth-child(4) { width: 12px; height: 12px; margin-top: 6px; }
.hero-dots span:nth-child(5) { width: 10px; height: 10px; margin-top: 2px; }
.hero-dots span:nth-child(6) { width: 8px; height: 8px; margin-top: 10px; }
.hero-dots span:nth-child(7) { width: 8px; height: 8px; margin-top: -6px; }
.hero-dots span:nth-child(8) { width: 10px; height: 10px; margin-top: 14px; }
.hero-dots span:nth-child(9) { width: 6px; height: 6px; margin-top: 4px; }

.search {
  margin-top: 44px;
  max-width: 600px;
  position: relative;
}

.search input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px 12px 44px;
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 0;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.search input:focus {
  border-color: var(--border-strong);
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* section label */
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid var(--border);
}

.section-label .label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-label .meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 分类卡片网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 96px;
}

.category-card {
  background: var(--card-bg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: outline-color 0.15s ease, transform 0.15s ease;
  outline: 0.5px solid transparent;
  outline-offset: -0.5px;
  text-decoration: none;
  color: inherit;
  min-height: 240px;
}

.category-card:hover {
  outline-color: var(--border-strong);
}

.category-card.active {
  outline: 1.5px solid var(--accent);
  outline-offset: -1.5px;
}

.category-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card .card-icon svg {
  width: 22px;
  height: 22px;
}

.category-card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--card-accent);
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.category-card h3 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--card-title);
  margin-top: 6px;
}

.category-card .desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* 方案 C：文字摘要预览 */
.category-card .preview-text {
  margin-top: auto;
  padding-top: 16px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-card .preview-subs {
  font-size: 12px;
  color: var(--card-accent);
  font-weight: 500;
}

.category-card .preview-links {
  font-size: 12px;
  color: var(--text-secondary);
}

.category-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-card .visit {
  color: var(--card-accent);
}

.category-card.active .visit {
  font-weight: 500;
}

/* ===== 分类详情页 ===== */
.detail-header {
  margin-bottom: 64px;
}

.detail-header .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.detail-header .breadcrumb a {
  color: var(--text-muted);
}

.detail-header .breadcrumb a:hover {
  color: var(--link);
}

.detail-header h1 {
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-icon svg {
  width: 34px;
  height: 34px;
}

.detail-header .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 16px;
}

.detail-header .stats {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.detail-header .stats span {
  margin-right: 24px;
}

/* 子分类区块 */
.subcategory {
  margin-bottom: 96px;
}

.subcategory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--border);
}

.subcategory-header h2 {
  font-size: 22px;
  font-weight: 500;
}

.subcategory-header .count {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 链接列表 */
.link-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 40px;
  row-gap: 0;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 0.5px solid var(--border);
  font-size: 15px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.link-item:hover {
  background: var(--card-bg);
}

.link-item .favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--card-bg);
  object-fit: contain;
}

.link-item .badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  width: 16px;
  text-align: center;
  margin-right: 4px;
  flex-shrink: 0;
  font-weight: 500;
}

.link-item .badge.gold { color: #B5850F; }
.link-item .badge.silver { color: #6F6F6F; }
.link-item .badge.bronze { color: #9B6B3D; }
.link-item .badge.tutorial { color: var(--text-faint); }

.link-item .name {
  flex: 1;
  font-weight: 400;
}

.link-item .name .note {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
}

.link-item:hover .name {
  color: var(--link);
}

.link-item .arrow {
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-left: 8px;
  flex-shrink: 0;
}

.link-item:hover .arrow {
  color: var(--link);
}

/* 移动端 */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    padding: 24px 20px;
  }

  .sidebar-nav {
    margin-top: 24px;
  }

  .sidebar-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .sidebar-footer {
    margin-top: 24px;
  }

  .content {
    padding: 32px 20px 64px;
  }

  .hero h1 { font-size: 34px; }
  .hero p { font-size: 14px; }
  .hero-dots { display: none; }
  .hero-text { padding: 24px 20px; }
  .hero-logo { width: 26px; height: 26px; border-radius: 8px; }

  .detail-head {
    flex-direction: column;
    gap: 16px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-header h1 {
    font-size: 36px;
  }

  .link-list {
    grid-template-columns: 1fr;
  }
}