/*
Theme Name: Modern Family Demo
Template: twentytwentyfour
*/

/* ---------- Design tokens ---------- */
:root {
  /* 基础色 */
  --leiden-blue: #001157;          /* 历史保留：品牌蓝 */
  --text-color: #ffffff;           /* 默认文字（深色背景） */
  --card-bg: #ffffff;              /* 白底卡片 */
  --card-text: #333333;            /* 卡片正文色 */
  --light-blue-bg: #001c80;        /* 深背景内的浅蓝层 */
  --border-color: #002aa1;         /* 组件边框色 */

  /* City Blue 分层（更亮一点的主调） */
  --brand-950: #000c3a;            /* 极深：页脚 / 远景 */
  --brand-900: #001157;            /* 深品牌蓝（顶部） */
  --brand-800: #0b2a8f;            /* 城市蓝主色（背景） */
  --brand-700: #1643c7;            /* 高亮层 */
  --brand-600: #2a66f0;            /* 强调 / Focus */

  /* 彩虹渐变，可复用 */
  --rainbow: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
}

/* ---------- 基础排版 ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--brand-800);
  color: var(--text-color);
  margin: 0;
}

.page-main {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; text-align: center; margin-bottom: 40px; }
h3 { font-size: 1.8em; }

p { font-size: 1.1em; line-height: 1.7; }

a {
  color: #f0f8ff;
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

/* ---------- 顶部彩虹条 ---------- */
.rainbow-bar {
  height: 5px;
  background: var(--rainbow);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

/* ---------- Header / Nav ---------- */
.demo-header {
  padding: 26px 46px;                                  /* 增强气场 */
  background: linear-gradient(180deg, var(--brand-900), var(--brand-800));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
}

.demo-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.demo-nav .menu-items a {
  color: #fff;
  font-size: 1.1em;
  font-weight: 700;
  margin-left: 25px;
  position: relative;
  text-decoration: none;
}

/* 彩虹下划线（hover / focus 时出现），细腻一点 */
.demo-nav .menu-items a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 3px;
  background: var(--rainbow);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: center;
  transition: opacity .2s ease, transform .2s ease;
  border-radius: 2px;
}
.demo-nav .menu-items a:hover::after,
.demo-nav .menu-items a:focus::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Logo：放大 + 光晕 + 边缘柔化（方案B） */
.demo-nav .logo img {
  height: 95px;
  width: auto;
  display: block;
  transition: filter .35s ease, transform .35s ease;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.20));
  -webkit-mask-image: radial-gradient(circle at center, black 68%, transparent 100%);
  mask-image: radial-gradient(circle at center, black 68%, transparent 100%);
}
.demo-nav .logo img:hover {
  filter: drop-shadow(0 0 32px rgba(255,255,255,0.38));
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.demo-footer {
  text-align: center;
  padding: 40px 20px;
  background: var(--brand-950);
  margin-top: 60px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #aaa;
}

/* ---------- 白底内容卡片（统一风格） ---------- */
.result-item,
.timeline-content {
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.result-item h3,
.result-item a,
.timeline-content .keywords,
.timeline-content p { color: var(--card-text); }
.result-item h3 { color: var(--leiden-blue); }

/* 时间轴节点在深底上保持白边可见 */
.timeline-item::after { border: 5px solid var(--card-bg); }

/* ---------- 首页卡片与 FAQ（深色块） ---------- */
.data-viz-card {
  background: var(--light-blue-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 30px;
}
.data-viz-item span { color: #fff; }

.faq-item details {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  margin-bottom: 15px;
  background: linear-gradient(180deg, rgba(10,38,120,0.9), rgba(10,38,120,0.82));
}
.faq-item summary {
  padding: 20px;
  font-weight: 700;
  font-size: 1.2em;
  cursor: pointer;
}
.faq-item div {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--border-color);
  color: #eee;
  line-height: 1.8;
}

/* ---------- 数据库页：筛选侧栏 ---------- */
.db-filters {
  background: var(--light-blue-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 25px;
  align-self: flex-start;
}
.filter-group label { color: var(--text-color); }

/* 搜索框（数据库页） */
.db-search-input {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: #333;
  font-size: 1em;
}
.db-search-input::placeholder { color: #888; }

/* 结果卡片（数据库页） */
.result-item { transition: all 0.3s ease; }
.result-item.hidden { display: none; }
.result-item .meta {
  font-size: 0.9em; color: #555; font-weight: 600; margin-bottom: 15px;
}
.result-item .tag {
  display: inline-block;
  background: var(--leiden-blue);
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  font-weight: 700;
  margin-right: 10px;
}

/* 下载按钮（数据库页） */
.btn-download {
  display: inline-block;
  background: #28a745;
  color: #fff !important;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 15px;
}
.btn-download:hover { background: #218838; text-decoration: none; }

/* 无结果提示（数据库页） */
#no-results-message {
  display: none;
  background: var(--light-blue-bg);
  border: 1px solid var(--border-color);
  color: #eee;
  padding: 30px;
  text-align: center;
  font-size: 1.2em;
  border-radius: 8px;
}

/* ---------- “北京故事”列表页 ---------- */
.accent { color: #ff7a66; }

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}
.story-card {
  background: var(--card-bg);
  color: var(--card-text);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  line-height: 1.8;
  font-size: 1.1em;
  text-decoration: none; /* a.story-card 的下划线去除 */
}
.story-card.is-link { cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.story-card.is-link:hover,
.story-card.is-link:focus {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  outline: none;
}

/* 彩虹卡片（可选） */
.story-card.rainbow {
  background-image: linear-gradient(145deg, red, orange, yellow, green, blue);
  color: #fff;
}

/* 窄屏单列 */
@media (max-width: 800px) {
  .story-grid { grid-template-columns: 1fr; }
}

/* ---------- 彩虹工具：给任何卡片加“旗帜描边” ---------- */
/* 用法：给元素加 .has-rainbow-rim */
.has-rainbow-rim {
  border: 2px solid transparent;
  border-radius: 10px;
  background-clip: padding-box;
  position: relative;
}
.has-rainbow-rim::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 10px;
  background: var(--rainbow);
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* 也可以做顶部彩虹条（给元素加 .has-rainbow-topbar） */
.has-rainbow-topbar { position: relative; }
.has-rainbow-topbar::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0; height: 5px;
  background: var(--rainbow);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}