/* ===== 配色：暖色 Newsletter 风格 ===== */
:root {
  color-scheme: light dark;
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-2: #4a4a4a;
  --text-3: #8a8a8a;
  --accent: #e8652b;
  --accent-hover: #d4551d;
  --border: #e8e5e1;
  --tag-bg: #f0ece7;
  --tag-text: #7a7168;
  --header-bg: rgba(250, 249, 247, 0.92);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --bg-card: #1e1c1a;
    --text: #e8e4df;
    --text-2: #a8a49e;
    --text-3: #6e6a64;
    --accent: #f0845a;
    --accent-hover: #f69a76;
    --border: #2e2c28;
    --tag-bg: #282624;
    --tag-text: #8a867f;
    --header-bg: rgba(20, 18, 16, 0.92);
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
}

[data-theme="light"] {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-2: #4a4a4a;
  --text-3: #8a8a8a;
  --accent: #e8652b;
  --accent-hover: #d4551d;
  --border: #e8e5e1;
  --tag-bg: #f0ece7;
  --tag-text: #7a7168;
  --header-bg: rgba(250, 249, 247, 0.92);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg: #141210;
  --bg-card: #1e1c1a;
  --text: #e8e4df;
  --text-2: #a8a49e;
  --text-3: #6e6a64;
  --accent: #f0845a;
  --accent-hover: #f69a76;
  --border: #2e2c28;
  --tag-bg: #282624;
  --tag-text: #8a867f;
  --header-bg: rgba(20, 18, 16, 0.92);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a:active {
  opacity: 0.7;
}

/* ===== 容器 ===== */
.container {
  width: 100%;
  padding: 0 24px;
}

@media (min-width: 780px) {
  .container {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* ===== 顶部栏 ===== */
.header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.header-icon:hover,
.header-icon.active {
  background: var(--tag-bg);
  color: var(--text);
}

.header-icon {
  position: relative;
  z-index: 201;
}

/* ===== 日历浮层 ===== */
.dp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s;
}

.dp-overlay.dp-open {
  background: rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.dp-sheet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: 420px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .dp-sheet {
    max-width: 100%;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
  }
}

.dp-overlay.dp-open .dp-sheet {
  transform: translateY(0);
}

.dp-panel {
  padding: 20px 0 8px;
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dp-month {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dp-nav:hover {
  background: var(--tag-bg);
  color: var(--text);
}

.dp-nav:active {
  background: var(--border);
}

.dp-nav-disabled {
  opacity: 0.2;
  pointer-events: none;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dp-weekday {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  padding: 4px 0 8px;
  text-transform: uppercase;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-size: 15px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.dp-empty {
  visibility: hidden;
}

.dp-has-content {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.dp-has-content::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.dp-has-content:hover {
  background: var(--tag-bg);
}

.dp-has-content:active {
  background: var(--border);
}

.dp-no-content {
  color: var(--text-3);
  opacity: 0.25;
}

.dp-current {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}

.dp-current::after {
  background: rgba(255,255,255,0.7);
}

.dp-today:not(.dp-current) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  color: var(--accent);
  font-weight: 700;
}

.dp-archive-link {
  display: block;
  text-align: center;
  padding: 16px 0 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dp-archive-link:hover {
  color: var(--accent);
}

/* ===== 日期导航 ===== */
.date-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.date-bar-inner {
  display: flex;
  align-items: center;
  padding: 28px 0;
}

.date-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  color: var(--text-3);
  font-size: 24px;
  font-weight: 300;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.date-arrow:hover {
  color: var(--text);
  background: var(--tag-bg);
}

.date-arrow.disabled {
  opacity: 0.15;
  pointer-events: none;
}

.date-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.date-main {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.date-sub {
  display: block;
  font-size: 14px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ===== Tab 导航 ===== */
.tab-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 90;
}

.tab-nav {
  display: flex;
}

.tab-btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
  color: var(--text-2);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Tab 面板 */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===== 主内容 ===== */
.main-content {
  padding-top: 12px;
  padding-bottom: 48px;
}

/* ===== Section ===== */
.section {
  margin-top: 40px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 8px;
}

.category-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 20px 0 8px;
  letter-spacing: -0.01em;
}

/* ===== 新闻卡片 ===== */
.news-item {
  padding: 20px;
  margin: 8px 0;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.news-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-color: #d5d0ca;
}

[data-theme="dark"] .news-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-color: #3a3836;
}

.news-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.news-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.news-title a:hover {
  color: var(--accent);
}

.news-summary {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.65;
  margin-top: 8px;
}

.news-comment {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  margin-top: 8px;
  padding: 6px 10px;
  background: transparent;
  border-radius: 6px;
}

.news-meta {
  margin-top: 10px;
}

.news-source {
  font-size: 12px;
  font-weight: 500;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 12px;
}

/* ===== 子分组标题 ===== */
.group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  padding: 16px 0 4px;
}

/* ===== 推文卡片 ===== */
.tweet-item {
  padding: 20px;
  margin: 8px 0;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tweet-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-color: #d5d0ca;
}

[data-theme="dark"] .tweet-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-color: #3a3836;
}

.tweet-author {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.tweet-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tweet-handle {
  font-size: 14px;
  color: var(--text-3);
}

.tweet-content {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.65;
}

.tweet-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.tweet-link:hover {
  text-decoration: underline;
}

/* ===== 空状态 ===== */
.empty-state {
  padding: 40px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 15px;
}

/* ===== 页脚 ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: 14px;
  color: var(--text-3);
}

.theme-btn {
  font-size: 14px;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 14px;
  transition: color 0.15s, border-color 0.15s;
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--text-3);
}

/* ===== 归档页 ===== */
.archive-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  padding: 36px 0 20px;
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin: 4px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  min-height: 56px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.archive-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-color: #d5d0ca;
}

[data-theme="dark"] .archive-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-color: #3a3836;
}

.archive-date {
  font-size: 17px;
  font-weight: 700;
}

.archive-num {
  font-size: 14px;
  color: var(--text-3);
}

.archive-stats {
  font-size: 14px;
  color: var(--text-3);
  margin-left: auto;
}

.archive-arrow {
  color: var(--text-3);
  font-size: 18px;
}
