/* ═══════════════════════════════════════════════════════
   无穷学社 Wuqiong News — 样式表
   色彩系统忠实还原自 HN news.css（#ff6600 / #f6f6ef / #828282）
   ═══════════════════════════════════════════════════════ */

:root {
  --orange:  #ff6600;
  --bg:      #f6f6ef;
  --body-fg: #828282;
  --title:   #000000;
  --visited: #828282;
  --pagetop: #222222;
  --border:  #e8e8e0;
}

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

body {
  font-family: Verdana, Geneva, "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  color: var(--body-fg);
  background: var(--bg);
  line-height: 1.5;
}

a:link    { color: var(--title);   text-decoration: none; }
a:visited { color: var(--visited); text-decoration: none; }
a:hover   { text-decoration: underline; color: var(--orange); }

/* ─── Header ──────────────────────────────────────────── */
header {
  background: var(--orange);
  padding: 4px 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-box {
  background: white;
  color: var(--orange);
  font-weight: bold;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 2px;
  line-height: 1.4;
  flex-shrink: 0;
}
.site-name {
  color: white;
  font-weight: bold;
  font-size: 13px;
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.header-nav {
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  display: flex;
  gap: 10px;
  margin-left: 4px;
  flex-shrink: 0;
}
.header-nav a { color: rgba(255,255,255,0.85); }
.header-nav a:hover { color: white; text-decoration: none; }
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}


/* ─── 日历弹层 ─────────────────────────────────────────── */
.cal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 56px;
}
.cal-overlay.hidden { display: none; }
.cal-panel {
  background: white;
  border-radius: 4px;
  padding: 14px;
  width: 260px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.18);
  font-size: 12px;
}
.cal-month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  color: var(--title);
}
.cal-month-nav button {
  background: none; border: none;
  font-size: 15px; cursor: pointer;
  color: var(--body-fg); padding: 2px 6px;
}
.cal-month-nav button:hover { color: var(--orange); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}
.cal-weekday { font-size: 9px; color: var(--body-fg); padding: 3px 0; }
.cal-day { font-size: 11px; padding: 5px 2px; border-radius: 3px; cursor: default; color: #ccc; }
.cal-day.has-data { color: var(--title); cursor: pointer; font-weight: bold; }
.cal-day.has-data:hover { background: rgba(255,102,0,0.1); color: var(--orange); }
.cal-day.today { background: var(--orange); color: white !important; }
.cal-day.selected { box-shadow: 0 0 0 2px var(--orange); }

/* ─── 主内容区 ─────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 10px 60px;
}

/* ─── 当日 Banner ──────────────────────────────────────── */
.day-banner {
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.day-banner .day-date  { font-size: 11px; font-weight: bold; color: var(--pagetop); }
.day-banner .day-count { font-size: 10px; color: var(--body-fg); }

/* ─── 分享按钮 ─────────────────────────────────────────── */
.share-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--body-fg);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 3px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.share-btn:hover { border-color: var(--orange); color: var(--orange); }
.share-btn.copied { border-color: #4caf50; color: #4caf50; }

/* ─── 复制成功 Toast ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #222;
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── 分类标题 ─────────────────────────────────────────── */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  margin-top: 6px;
  border-bottom: 1px solid var(--orange);
}
.cat-name  { font-size: 10pt; font-weight: bold; color: var(--pagetop); }
.cat-count { font-size: 8pt;  color: var(--body-fg); }

/* ─── 文章条目（忠实 HN 密度）────────────────────────────── */
.story-item { padding: 7px 0 6px; border-bottom: 1px solid var(--border); }

.story-title {
  font-size: 10pt;
  color: var(--title);
  line-height: 1.45;
  word-break: break-word;
}
.story-source { font-size: 8pt; color: var(--body-fg); margin-left: 5px; }

.story-summary {
  font-size: 8.5pt;
  color: #9c9c9c;
  font-style: italic;
  margin: 3px 0 2px;
  line-height: 1.5;
}

.story-meta {
  font-size: 7pt;
  color: var(--body-fg);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1.6;
}
.story-meta .sep { margin: 0 4px; }
.story-meta a { color: var(--body-fg); }
.story-meta a:hover { text-decoration: underline; color: var(--orange); }

/* ─── 标签 ─────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: rgba(255,102,0,0.10);
  color: var(--orange);
  font-size: 8pt;
  padding: 0 5px;
  border-radius: 2px;
  margin-left: 4px;
  font-style: normal;
}
.tag-hot { background: #fff3e0; color: #bf360c; }

/* ─── 加载中 / 空状态 ──────────────────────────────────── */
.loading { padding: 30px; text-align: center; color: var(--body-fg); font-size: 11px; }

/* ─── Footer ───────────────────────────────────────────── */
footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
  font-size: 8pt;
  color: var(--body-fg);
  text-align: center;
  border-top: 1px solid var(--border);
}
footer a { color: var(--body-fg); }

/* ─── 移动端适配（≤750px）─────────────────────────────── */
@media (max-width: 750px) {
  body    { font-size: 13px; }
  main    { padding: 0 12px 60px; }

  /* Header */
  .header-nav  { display: flex; font-size: 12px; gap: 8px; }
  .site-name   { font-size: 14px; }

  /* 条目 */
  .story-item  { padding: 10px 0 9px; }
  .story-title { font-size: 14px; line-height: 1.5; }
  .story-source{ font-size: 11px; }
  .story-summary { font-size: 12px; }
  .story-meta  { font-size: 11px; }

  /* 分类标题 */
  .cat-name    { font-size: 14px; }

  /* Banner */
  .day-banner  { padding: 10px 0 6px; }
  .share-btn   { font-size: 11px; padding: 4px 12px; }

  /* 标签 */
  .tag         { font-size: 10px; padding: 1px 6px; }

  /* 日历 */
  .cal-panel   { width: 90vw; max-width: 320px; }
}
