/* Portal 资讯站 · BBC 式编辑排版（黑白灰主体 + 红色品牌栏） */

:root {
  --bbc-red: #b80000;
  --ink: #141414;
  --charcoal: #3a3a3a;
  --muted: #6e6e6e;
  --line: #e3e3e3;
  --canvas: #f4f4f4;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--bbc-red); outline-offset: 2px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* —— 品牌栏 —— */
.masthead { background: var(--bbc-red); }
.masthead-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand {
  color: #fff; text-decoration: none; font-size: 24px; font-weight: 800;
  letter-spacing: .02em; white-space: nowrap;
}
.searchbox { margin-left: auto; display: flex; max-width: 320px; width: 100%; }
.searchbox input {
  flex: 1; min-width: 0; border: 0; padding: 8px 12px; font-size: 14px;
  background: #fff; color: var(--ink);
}
.searchbox button {
  border: 0; background: var(--ink); color: #fff; padding: 8px 14px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.searchbox button:hover { background: #000; }

/* —— 主题导航 —— */
.topics { border-bottom: 1px solid var(--line); background: var(--surface); }
.topics-inner { display: flex; gap: 4px; overflow-x: auto; }
.topics a {
  padding: 10px 12px; text-decoration: none; font-size: 14px; font-weight: 600;
  color: var(--charcoal); border-bottom: 3px solid transparent; white-space: nowrap;
}
.topics a:hover { color: var(--bbc-red); }
.topics a.on { color: var(--ink); border-bottom-color: var(--bbc-red); }

.main-area { padding-top: 22px; padding-bottom: 40px; }
.page-heading { margin: 4px 0 18px; font-size: 26px; letter-spacing: -.01em; }

/* —— 头条区 —— */
.np-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 26px; padding-bottom: 22px; border-bottom: 4px solid var(--ink); margin-bottom: 8px;
}
.np-hero h2 { margin: 12px 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; }
.np-hero p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--charcoal); }
.np-secondary { display: grid; gap: 16px; align-content: start; }
.np-card { border: 1px solid var(--line); padding: 12px; }
.np-card h3 { margin: 10px 0 6px; font-size: 15px; line-height: 1.35; }

/* —— 媒体区（16:9，仅有图时渲染） —— */
.np-media { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--canvas); }
.np-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-media-fallback { display: none; position: absolute; inset: 0; place-items: center; color: var(--muted); font-size: 12px; }
.np-media.np-media-fail img { display: none; }
.np-media.np-media-fail .np-media-fallback { display: grid; }

/* —— 标题链接 —— */
h1 a, h2 a, h3 a, h4 a { color: var(--ink); text-decoration: none; }
h2 a:hover, h3 a:hover, h4 a:hover { color: var(--bbc-red); text-decoration: underline; }

/* —— meta 行 —— */
.np-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.np-source { color: var(--bbc-red); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.np-tag { border: 1px solid var(--line); padding: 1px 7px; font-size: 11px; text-decoration: none; color: var(--charcoal); }
.np-tag:hover { border-color: var(--bbc-red); color: var(--bbc-red); }
.np-cluster { font-weight: 700; }

/* —— 信息流（无图纯文本，不留空媒体框） —— */
.np-stream { display: grid; }
.np-row { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.np-row.has-thumb { grid-template-columns: minmax(0, 1fr) 176px; }
.np-row:last-child { border-bottom: 0; }
.np-row h4 { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.np-row p { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.np-row-thumb { align-self: start; }
.np-row-text { min-width: 0; }

.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* —— 详情页 —— */
.detail { max-width: 760px; }
.detail h1 { margin: 6px 0 12px; font-size: 30px; line-height: 1.25; letter-spacing: -.01em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.detail-author::before { content: "· "; }
.detail .np-media { margin-bottom: 16px; }
.detail-summary { font-size: 17px; line-height: 1.75; color: var(--charcoal); border-left: 4px solid var(--bbc-red); padding-left: 14px; margin: 16px 0 22px; }
.detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-origin {
  display: inline-block; background: var(--bbc-red); color: #fff; text-decoration: none;
  padding: 10px 22px; font-size: 15px; font-weight: 700; border: 0; cursor: pointer;
}
.btn-origin:hover { background: #900; }
.origin-note { font-size: 12px; color: var(--muted); }

.detail-block { margin-top: 34px; border-top: 4px solid var(--ink); padding-top: 12px; max-width: 760px; }
.detail-block h2 { font-size: 18px; margin: 4px 0 10px; }
.sibling-list { list-style: none; margin: 0; padding: 0; }
.sibling-list li { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sibling-list li:last-child { border-bottom: 0; }
.sibling-list a { text-decoration: none; flex: 1; min-width: 0; }
.sibling-list a:hover { color: var(--bbc-red); text-decoration: underline; }
.sibling-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* —— 登录 / 404 —— */
.login-card { max-width: 380px; margin: 60px auto; border: 1px solid var(--line); padding: 30px 26px; text-align: center; }
.login-card h1 { margin: 0 0 10px; font-size: 24px; }
.login-hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.login-error { color: var(--bbc-red); font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.login-input {
  width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--charcoal);
  margin-bottom: 14px; text-align: center; letter-spacing: .1em;
}
.login-btn { width: 100%; }

/* —— 页脚 —— */
.site-footer { border-top: 4px solid var(--ink); margin-top: 30px; background: var(--canvas); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 16px; padding-bottom: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.inline-form { display: inline; }
.linklike { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.linklike:hover { color: var(--bbc-red); }

/* —— 响应式 —— */
@media (max-width: 1024px) {
  .np-grid { grid-template-columns: 1fr; gap: 18px; }
  .np-secondary { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
  .np-row.has-thumb { grid-template-columns: 1fr; }
  .np-row-thumb { order: -1; }
  .np-hero h2 { font-size: 22px; }
  .detail h1 { font-size: 24px; }
  .masthead-inner { flex-wrap: wrap; }
  .searchbox { max-width: none; }
}

@media (max-width: 375px) {
  .brand { font-size: 20px; }
  .np-hero h2 { font-size: 20px; }
  .main-area { padding-top: 14px; }
}
