/* ==========================================================================
   俄罗斯电商情报站 — 主样式
   共用页面：index.html / ru|en/index.html / pages/*.html / ru|en/pages/*.html
   首屏关键样式（内联进 <head>）另见 assets/css/critical.css
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e5e8ec;
  --border-strong: #d4dae2;
  --text: #141b26;
  --text-2: #3d4756;
  --muted: #6b7684;

  --accent: #c0392b;
  --accent-soft: #fdeeec;
  --accent-2: #14507a;
  --accent-2-soft: #eaf1f7;
  --green: #1a7f47;
  --green-soft: #e6f5ec;
  --blue: #1f6fb2;
  --blue-soft: #e8f1fa;
  --amber: #8f6207;
  --amber-soft: #fbf2dc;
  --red: #c0392b;
  --red-soft: #fbeae8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .05);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .07), 0 14px 34px rgba(16, 24, 40, .09);

  --maxw: 1180px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto,
          Arial, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1b222c;
    --border: #262d38;
    --border-strong: #343d4a;
    --text: #e6edf3;
    --text-2: #c2ccd8;
    --muted: #8b97a6;

    --accent: #ff6b5e;
    --accent-soft: #3a1c1a;
    --accent-2: #7fbbea;
    --accent-2-soft: #16283a;
    --green: #56c98a;
    --green-soft: #133020;
    --blue: #6cb2e8;
    --blue-soft: #152736;
    --amber: #d9a441;
    --amber-soft: #33260f;
    --red: #ff6b5e;
    --red-soft: #3a1c1a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .42), 0 6px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- 顶部进度条 */
.top-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  transition: opacity .2s;
}
.top-progress.active {
  opacity: 1;
  animation: top-progress 1s linear infinite;
}
@keyframes top-progress {
  0%   { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* ------------------------------------------------------------------ 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo {
  flex: none;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), #a53024);
  box-shadow: 0 2px 6px rgba(192, 57, 43, .28);
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: -.2px; line-height: 1.3; }
.brand h1 a { color: inherit; text-decoration: none; }
.tagline { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lang-switch button {
  border: none;
  background: none;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.demo-banner {
  background: var(--amber-soft);
  border-bottom: 1px solid var(--border);
  color: var(--amber);
  padding: 8px 24px;
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------------ Tab */
.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  border: none;
  background: none;
  padding: 8px 16px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* -------------------------------------------------------------- 控制条 */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.controls label { color: var(--muted); font-size: 13.5px; }
#dateSelect {
  padding: 7px 32px 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b7684' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
#dateSelect:hover { border-color: var(--muted); }
.updated-at { color: var(--muted); font-size: 12.5px; }

.page-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; }
.page-nav a {
  color: var(--accent-2);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s, color .15s;
}
.page-nav a:hover { border-color: var(--accent-2); background: var(--accent-2-soft); }

/* -------------------------------------------------------------- 主体布局 */
.briefing {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px 48px;
}
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.sidebar { position: sticky; top: 78px; min-width: 0; }
.content { min-width: 0; }

/* -------------------------------------------------------------- 速览卡片 */
.overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.overview h2 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .3px;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.overview h2::before {
  content: "";
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--accent);
}
.overview ul { margin: 0; padding: 0; list-style: none; counter-reset: ov; }
.overview li {
  counter-increment: ov;
  position: relative;
  margin: 0 0 10px;
  padding-left: 26px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.overview li:last-child { margin-bottom: 0; }
.overview li::before {
  content: counter(ov);
  position: absolute;
  left: 0; top: 2px;
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

/* -------------------------------------------------------------- 汇率卡片 */
.rates {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.rates-head {
  flex: 1 0 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.rates-head b { color: var(--accent-2); font-size: 13.5px; font-weight: 600; }
.rates-head .rates-src {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}
.rates-grid {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rate-k { font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.rate-v,
.rate > strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.3px;
  line-height: 1.25;
}
/* 兼容旧版日报页（未重跑 build-pages.js 时）的行内写法：
   <strong>标题</strong>（日期）　<span class="rate">USD/RUB <strong>84.28</strong></span> */
.rates > strong { flex: 1 0 100%; color: var(--accent-2); font-size: 13.5px; font-weight: 600; }
.rates > .rate { flex: 1 1 84px; }

/* ------------------------------------------------------------------ 分节 */
.section { margin-bottom: 28px; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 0 0 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px; height: 15px;
  border-radius: 2px;
  background: var(--accent-2);
}

/* -------------------------------------------------------------- 情报条目 */
.item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.item::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--border-strong);
}
.item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.item[data-verify="dual"]::before     { background: var(--green); }
.item[data-verify="official"]::before { background: var(--blue); }
.item[data-verify="single"]::before   { background: var(--amber); }
.item[data-verify="rumor"]::before    { background: var(--red); }

.item-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  color: var(--text);
  letter-spacing: -.1px;
}
.item-toggle {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  transition: transform .18s;
}
.item-head[aria-expanded="true"] .item-toggle { transform: rotate(180deg); }
.item-body { display: none; margin-top: 10px; }
.item-summary { font-size: 14px; color: var(--text-2); margin: 0 0 10px; line-height: 1.7; }
.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
.item-meta a {
  color: var(--accent-2);
  text-decoration: none;
  display: inline-block;
  padding: 4px 7px;
  margin: -4px 0;
  border-radius: 6px;
  line-height: 1.3;
  border-bottom: 1px solid transparent;
}
.item-meta a:hover { background: var(--accent-2-soft); border-bottom-color: var(--accent-2); }

/* -------------------------------------------------------------- 核实徽章 */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-dual     { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge-official { color: var(--blue);  background: var(--blue-soft);  border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.badge-single   { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.badge-rumor    { color: var(--red);   background: var(--red-soft);   border-color: color-mix(in srgb, var(--red) 35%, transparent); }

/* -------------------------------------------------------------- 空态/错误 */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 56px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
}

/* -------------------------------------------------------------- 骨架屏 */
.sk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.sk {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.sk-h { height: 14px; width: 38%; margin-bottom: 14px; }
.sk-l { height: 11px; margin-bottom: 9px; }
.sk-l:last-child { margin-bottom: 0; }
.sk-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.sk-title { height: 14px; margin-bottom: 12px; }
.sk-meta { height: 10px; width: 46%; }
.sk-sec { height: 15px; width: 26%; margin: 0 0 14px; }
@keyframes sk-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton { animation: sk-fade .2s ease; }
@keyframes sk-fade { from { opacity: .6; } to { opacity: 1; } }

/* ------------------------------------------------------------------ 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom));
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.site-footer .muted { margin: 4px 0; }
.site-footer .trust { margin-top: 10px; font-size: 12px; opacity: .85; }

/* ------------------------------------------------------------------ 响应式 */
@media (min-width: 901px) {
  /* 桌面端摘要强制展开，隐藏折叠箭头 */
  .item-body { display: block !important; }
  .item-toggle { display: none; }
  .item-head { cursor: default; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; order: -1; }
  .sidebar .overview, .sidebar .rates { margin-bottom: 14px; }
  .rates-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .site-header, .tabs, .controls { padding-left: 14px; padding-right: 14px; }
  .site-header { padding-top: 10px; padding-bottom: 10px; }
  .briefing { padding: 16px 14px 36px; }
  .brand h1 { font-size: 16.5px; }
  .brand .logo { width: 36px; height: 36px; font-size: 18px; }
  .layout { gap: 0; }
  .item { padding: 13px 14px 13px 15px; }
  .item-title { font-size: 14.5px; }
  .item-meta { gap: 6px 12px; }
  .site-footer { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
