/* 星光闪闪AI 日报 —— 数字报纸风格
   颜色 / 字体 / 紧凑度 都会由 theme.json 覆盖，这里只是默认值。 */

:root {
  --bg: #faf7f2;
  --text: #1a1a1a;
  --accent: #b3472e;
  --muted: #6b6560;
  --rule: #ddd6cc;

  --font-title: Georgia, "Songti SC", "SimSun", "Noto Serif SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;

  --gap: 28px;
  --pad: 28px 0;
  --lead-size: 42px;
  --imp-size: 25px;
  --nor-size: 19px;
  --body-size: 15px;
  --line: 1.75;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 紧凑程度 ---------- */
body.density-compact  { --gap: 18px; --lead-size: 34px; --imp-size: 22px; --nor-size: 17px; --body-size: 14px; --line: 1.6; }
body.density-comfortable { --gap: 28px; --lead-size: 42px; --imp-size: 25px; --nor-size: 19px; --body-size: 15px; --line: 1.75; }
body.density-loose    { --gap: 40px; --lead-size: 50px; --imp-size: 28px; --nor-size: 21px; --body-size: 16px; --line: 1.95; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 26px 90px;
}

/* ---------- 报头 ---------- */
.masthead {
  border-bottom: 3px double var(--rule);
  padding-bottom: 22px;
  margin-bottom: 34px;
  text-align: center;
}

.masthead-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.masthead-dot { color: var(--accent); font-size: 9px; }

.masthead-title {
  font-family: var(--font-title);
  font-size: clamp(30px, 5.2vw, 58px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.masthead-sub {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- 语音播报 ---------- */
.player {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 16px 18px;
  margin-bottom: 30px;
  background: rgba(154, 123, 63, .045);
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.player-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.player-tabs { display: flex; gap: 6px; }

.player-tabs button {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  border-radius: 2px;
  cursor: pointer;
}

.player-tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.player audio { width: 100%; height: 38px; display: block; }

.player-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.65;
}

/* ---------- 网格：4 列 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  row-gap: 0;
}

.loading {
  grid-column: span 4;
  color: var(--muted);
  padding: 60px 0;
  text-align: center;
}

/* ---------- 单条内容 ---------- */
.item {
  border-top: 1px solid var(--rule);
  padding: var(--pad);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item.lead      { grid-column: span 4; }
.item.important { grid-column: span 2; }
.item.normal    { grid-column: span 1; }

/* 头条：左标题右摘要，报纸式分栏 */
.item.lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  column-gap: var(--gap);
  align-items: start;
}
.item.lead .title { grid-column: 1; margin-bottom: 0; }
.item.lead .lead-right { grid-column: 2; }

.item.important { padding-right: 0; }
.item.normal    { padding-right: 0; }

.title {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.item.lead .title      { font-size: var(--lead-size); }
.item.important .title { font-size: var(--imp-size); }
.item.normal .title    { font-size: var(--nor-size); }

.brief {
  margin: 0 0 10px;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text);
}

.summary {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.94em;
}

.item.lead .brief { color: var(--accent); }

/* 分类 / 等级 小标签 */
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cat { color: var(--accent); font-weight: 700; }
.level { color: var(--muted); }

.source {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  align-self: flex-start;
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}

.source:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 3px double var(--rule);
  margin-top: 50px;
  padding-top: 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- 浮动工具条 ---------- */
.toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.toolbar button,
.toolbar select {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.toolbar select { max-width: 190px; }

.toolbar select:hover { border-color: var(--accent); color: var(--accent); }

.toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.toolbar button.speaking { background: var(--accent); color: #fff; border-color: var(--accent); }

.hide { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 22px;
  font-size: 13px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 60;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 平板：2 列 ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .item.lead      { grid-column: span 2; display: block; }
  .item.lead .title { font-size: var(--imp-size); }
  .item.important { grid-column: span 2; }
  .item.normal    { grid-column: span 1; }
}

/* ---------- 手机：单列 ---------- */
@media (max-width: 640px) {
  .wrap { padding: 26px 18px 100px; }
  .grid { grid-template-columns: 1fr; }
  .item.lead,
  .item.important,
  .item.normal { grid-column: span 1; padding-right: 0; }
  .item.lead { display: block; }
  .item.lead .title { font-size: var(--imp-size); }
  .masthead-sub { letter-spacing: 0.06em; }

  .toolbar {
    right: 0;
    left: 0;
    bottom: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg);
    border-top: 1px solid var(--rule);
  }
  .toolbar button { padding: 9px 11px; font-size: 12px; }
  .toolbar select { max-width: 126px; padding: 9px 6px; font-size: 12px; }
}
