:root {
  --bg: #FBF9F4;
  --surface: #FFFFFF;
  --surface-2: #F5F3EE;
  --border: #E8E4DA;
  --primary: #96472D;
  --primary-soft: #C2745A;
  --text: #1B1C19;
  --text-dim: #6B6A65;
  --text-faint: #9A9893;
  --bull: #2E8B57;
  --bear: #B33A3A;
  --neutral: #8A8A8A;
  --watch: #C28E2C;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.container.wide { max-width: 1080px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(10px);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.brand small {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 13px;
  margin-left: 8px;
}

.nav { display: flex; gap: 4px; }

.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 14px;
  transition: all 0.2s var(--ease);
}

.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--text); color: var(--bg); }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 24px 0;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 13px;
}

.filter-bar .filter-label { color: var(--text-faint); margin-right: 4px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.tag:hover { border-color: var(--primary-soft); color: var(--primary); }
.tag.active { background: var(--primary); color: white; border-color: var(--primary); }

.tag.ticker { font-family: "JetBrains Mono", "SF Mono", monospace; font-weight: 600; letter-spacing: 0.5px; }

.clear-filter {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  cursor: pointer;
}
.clear-filter:hover { color: var(--primary); }

/* Note card */
.notes-list { display: flex; flex-direction: column; gap: 16px; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all 0.2s var(--ease);
}

.note-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: transparent;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.mood-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.mood-dot.bullish { background: var(--bull); }
.mood-dot.bearish { background: var(--bear); }
.mood-dot.neutral { background: var(--neutral); }
.mood-dot.watch { background: var(--watch); }

.note-title {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.note-title a { color: inherit; }

.note-summary { color: var(--text-dim); font-size: 14px; }

.note-body {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.note-card.short .note-body { display: block; }
.note-card.long .note-body { display: none; }

.note-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.read-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--primary);
}

/* Article view */
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
}

.article h1 {
  font-family: "Noto Serif SC", serif;
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1.35;
}

.article h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  margin: 28px 0 12px;
}

.article h3 { font-size: 17px; margin: 20px 0 10px; }

.article p { margin: 12px 0; color: var(--text); }

.article ul, .article ol { margin: 12px 0 12px 24px; }
.article li { margin: 6px 0; }

.article blockquote {
  border-left: 3px solid var(--primary-soft);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-dim);
  font-style: italic;
}

.article code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 13px;
}

.article pre {
  background: var(--surface-2);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.article pre code { background: none; padding: 0; }

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-dim);
  font-size: 13px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; }
td.num { font-family: "JetBrains Mono", "SF Mono", monospace; }
td.ticker { font-family: "JetBrains Mono", "SF Mono", monospace; font-weight: 600; }

.gain { color: var(--bull); }
.loss { color: var(--bear); }

.action-buy { color: var(--bull); font-weight: 600; }
.action-sell { color: var(--bear); font-weight: 600; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 22px;
  font-weight: 600;
}

.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.stat-unit {
  font-family: "Manrope", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 4px;
}

/* Section */
.section { margin: 32px 0; }
.section-title {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--text);
}

/* Chart container */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.chart-card canvas { max-height: 320px; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

/* Reading list */
.reading-group { margin-bottom: 28px; }

.reading-cat {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.reading-items { list-style: none; padding: 0; margin: 0; }

.reading-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  transition: all 0.15s var(--ease);
}

.reading-item:hover {
  border-color: var(--primary-soft);
  transform: translateY(-1px);
}

.reading-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.reading-title:hover { color: var(--primary); }

.reading-note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-dim);
}

/* Page intro */
.page-intro {
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-style: italic;
}
