/* ==========================================================================
   XHS Media Content · 统一样式
   调性：年轻、直接、有能量；浅色主调 + 强调色
   ========================================================================== */

:root {
  --primary: #ff2442;          /* 小红书红 */
  --primary-dark: #d31b38;
  --primary-light: #ffe5e9;
  --secondary: #0f766e;        /* 副色：墨绿 */
  --secondary-light: #e0f2ef;
  --accent: #f59e0b;           /* 强调：橙 */
  --accent-light: #fef3c7;
  --bg: #fafaf7;               /* 米白底 */
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --text-faint: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success: #10b981;
  --danger: #ef4444;
  --code-bg: #1e1e1e;
  --code-text: #e6e6e6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

code, pre {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
}

/* ===== 布局 ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide { max-width: 1180px; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
}
.nav-brand .logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #ff5a6e);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 800;
}
.nav-links {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links a.active { background: var(--primary); color: white; }

/* ===== 通用元素 ===== */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 32px; margin-bottom: 12px; }
h2 { font-size: 24px; margin: 32px 0 14px; }
h3 { font-size: 18px; margin: 20px 0 10px; }
p { margin-bottom: 12px; color: var(--text); }

.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--border-light); }

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.muted { color: var(--text-light); }
.faint { color: var(--text-faint); font-size: 13px; }

.callout {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  font-size: 14px;
}
.callout.warn { border-color: var(--accent); background: var(--accent-light); }
.callout.info { border-color: var(--secondary); background: var(--secondary-light); }
.callout strong { color: var(--text); }

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow); }

.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.card-title .icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.card-title .icon.green { background: var(--secondary); }
.card-title .icon.amber { background: var(--accent); }
.card-desc { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== 表格 ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
th {
  background: #f9fafb;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ===== 标签 / Tag ===== */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--text-light);
  margin-right: 4px;
  margin-bottom: 4px;
}
.tag.primary { background: var(--primary-light); color: var(--primary); }
.tag.success { background: #d1fae5; color: #065f46; }
.tag.warn    { background: var(--accent-light); color: #92400e; }
.tag.cyan    { background: var(--secondary-light); color: var(--secondary); }
.tag.purple  { background: #ede9fe; color: #5b21b6; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-ghost { border-color: transparent; }

/* ===== 代码块 ===== */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  position: relative;
  margin: 12px 0;
}
pre code { background: none; color: inherit; padding: 0; }
code {
  background: #f3f4f6;
  color: #be185d;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }
.copy-btn.copied { background: var(--success); border-color: var(--success); color: white; }

/* ===== 日历组件 ===== */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 16px 0;
}
.cal-header {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  padding: 8px 0;
  letter-spacing: 0.5px;
}
.cal-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  min-height: 92px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.cal-day:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.cal-day.rest { background: #f9fafb; opacity: 0.6; }
.cal-day.highlight { background: linear-gradient(135deg, #fff5f7, #ffe5e9); border-color: var(--primary); }
.cal-day.completed { background: #d1fae5; border-color: var(--success); }
.cal-day.completed::after {
  content: '✓';
  position: absolute;
  top: 4px; right: 6px;
  color: var(--success);
  font-weight: 800;
  font-size: 12px;
}
.day-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 4px;
}
.day-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.day-type {
  font-size: 10px;
  color: var(--text-light);
  margin-top: auto;
  padding-top: 4px;
}
.week-label {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin: 12px 0 6px;
  padding-left: 4px;
}

/* ===== 详情弹窗 ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: #f3f4f6;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-light);
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }
.modal h2 { margin-top: 0; font-size: 22px; }
.modal h3 { font-size: 15px; margin-top: 16px; color: var(--text-light); }
.modal p { font-size: 14px; }
.modal .part { padding: 6px 0; border-bottom: 1px dashed var(--border-light); }
.modal .part:last-child { border: none; }
.modal .tag { font-size: 11px; }

/* ===== 首页 Hero ===== */
.hero {
  text-align: center;
  padding: 80px 24px 56px;
  background: linear-gradient(180deg, #fff5f7 0%, var(--bg) 100%);
}
.hero .badge {
  display: inline-block;
  background: white;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  color: var(--text-light);
}
.hero h1 {
  font-size: 44px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #ff5a6e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.hero .sub {
  font-size: 17px;
  color: var(--text-light);
  max-width: 620px;
  margin: 0 auto 24px;
}
.hero .meta {
  font-size: 13px;
  color: var(--text-faint);
}
.hero .cta-row {
  display: flex; gap: 10px; justify-content: center;
  margin-top: 28px; flex-wrap: wrap;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

hr { border: none; border-top: 1px solid var(--border-light); margin: 24px 0; }

/* 提示词卡片 */
.prompt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.prompt-card .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-light);
}
.prompt-card .head h3 {
  margin: 0; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.prompt-card .head h3 .icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.prompt-card .body { padding: 0; }
.prompt-card pre { margin: 0; border-radius: 0; }

/* 内容支柱展示 */
.pillar {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.pillar:hover { border-color: var(--primary); transform: translateY(-2px); }
.pillar .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.pillar .name { font-size: 15px; font-weight: 700; margin: 6px 0; }
.pillar .ratio { font-size: 12px; color: var(--text-light); }

/* 进度条 */
.progress {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ff5a6e);
  border-radius: 3px;
  transition: width 0.4s;
}

/* 折叠 */
details.collapse {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 12px;
  background: var(--card-bg);
}
details.collapse summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
details.collapse summary::before {
  content: '▸ ';
  color: var(--primary);
  display: inline-block;
  transition: transform 0.2s;
}
details.collapse[open] summary::before { content: '▾ '; }
details.collapse .body { padding-top: 12px; }

/* 搜索 */
.search-box {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.003 1.003 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/></svg>") no-repeat 12px center;
  font-family: inherit;
  margin-bottom: 16px;
}
.search-box:focus { outline: none; border-color: var(--primary); }

/* 移动端 */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero { padding: 48px 20px 36px; }
  .calendar { gap: 4px; }
  .cal-day { min-height: 76px; padding: 6px; }
  .day-label { font-size: 11px; }
  .nav-links a { padding: 4px 8px; font-size: 13px; }
  h1 { font-size: 26px; }
  .modal { padding: 20px 22px; }
  pre { font-size: 12px; padding: 14px; }
}
