/* ==========================================================================
   Meme Radar · shared chrome for 雷达 / 列表 / 重点监控
   Tokens (colors, fonts, radius) live in style.css :root — this file only
   adds the pieces every page shares: page tabs, Top3 strip, panels, header
   clock, and mobile guards.
   ========================================================================== */

/* never let a stray wide child create sideways page scroll on phones */
html, body { max-width: 100%; }
body { overflow-x: clip; }
img, svg, canvas, video, iframe { max-width: 100%; }

/* header clock (radar / focus) */
.hclock { font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.hclock b { color: var(--text); font-weight: 700; }
.hdate { font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); }

/* ---------- header nav: page tabs (chrome.js NAV_TABS) + language selector, one row ---------- */
.hdr-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.page-tabs { display: flex; align-items: center; gap: 4px; margin: 0; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, .03); }
.page-tab {
  height: 30px; padding: 0 12px; border-radius: 7px; border: 0;
  color: #9aa3b5; background: transparent;
  text-decoration: none; font-weight: 600; font-size: 13px; line-height: 1; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-tab:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .06); }
.page-tab.active { color: #fff; background: linear-gradient(135deg, #7c5cff, #4f8df5); }
.page-tab .pt-short { display: none; }
.hdr-nav .lang-select { height: 38px; padding-top: 0; padding-bottom: 0; }

/* ---------- Top3 strip (list page) ---------- */
.top3-strip { display: flex; gap: 8px; align-items: stretch; max-width: 1440px; margin: 8px auto 0; padding: 0 1.25rem; flex-wrap: wrap; }
.t3-lbl { align-self: center; font-weight: 700; font-size: 12px; color: #c9a8ff; letter-spacing: .5px; }
.t3-load { align-self: center; color: #7d8597; font-size: 12px; }
.t3-item { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1; max-width: 330px; text-align: left; cursor: pointer; padding: 7px 11px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); color: #cfd5e1; font: inherit; }
.t3-item:hover { border-color: #7c5cff; }
.t3-item.n1 { border-color: #7c5cff; background: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(79, 141, 245, .08)); }
.t3-item .t { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.t3-item b { font-size: 14px; color: #fff; }
.t3-item .rk { color: #a78bfa; font-weight: 700; font-size: 12px; }
.t3-item small { color: #7d8597; font-size: 11px; }
.t3-item .m { font-family: var(--mono); font-size: 11px; color: #9aa3b5; }
.t3-item .m i { font-style: normal; color: #34d399; }
.t3-pop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.t3-pop[hidden] { display: none; }
.t3-pop .bx { background: #0f1320; border: 1px solid #7c5cff; border-radius: 12px; padding: 16px; max-width: 460px; width: 100%; color: #cfd5e1; font-size: 13px; }
.t3-pop code { display: block; word-break: break-all; background: #07090f; padding: 8px; border-radius: 6px; margin: 8px 0; font-size: 12px; }
.t3-pop button, .t3-pop a { background: #7c5cff; color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; text-decoration: none; font: inherit; margin-right: 6px; display: inline-flex; align-items: center; }

/* ---------- shared panels (radar / focus) ---------- */
.page-main { max-width: 1440px; margin: 0 auto; padding: 1rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.pnl { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; min-width: 0; }
.pt { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-bottom: 0.65rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.pt > span:first-child { color: var(--text-muted); }
.pt .r { color: var(--text-dim); font-family: var(--mono); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 0.75rem; }
.pt .mut { color: var(--text-dim); font-weight: 500; }
.footer a.footer-radar { color: var(--text-muted); font-weight: 600; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  /* header: row 1 = brand + last-scan time, row 2 = page tabs + language selector */
  .app-header .header-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand time" "nav nav" "badge badge"; align-items: center; gap: 0.45rem 0.6rem; flex-wrap: nowrap; }
  .app-header .header-meta { display: contents; }
  .app-header .brand { grid-area: brand; gap: 0.5rem; min-width: 0; }
  .app-header .scan-time { grid-area: time; width: auto; justify-self: end; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 0.7rem; }
  .app-header .demo-badge { grid-area: badge; justify-self: start; }
  .hdr-nav { grid-area: nav; width: 100%; gap: 6px; }
  .page-tabs { flex: 1 1 auto; min-width: 0; padding: 2px; gap: 2px; }
  .page-tab { flex: 1 1 0; min-width: 0; height: 34px; padding: 0 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .hdr-nav .lang-switcher { order: 0; flex: 0 0 auto; }
  .hdr-nav .lang-select { height: 40px; min-height: 40px; min-width: 0; width: auto; max-width: 7.6rem; padding: 0 1.7rem 0 0.6rem; font-size: 16px; }
  .top3-strip { padding: 0 0.85rem; }
  .t3-item { min-width: 0; max-width: none; flex: 1 1 100%; min-height: 44px; padding: 9px 12px; }
  .t3-pop button, .t3-pop a { min-height: 40px; margin-top: 6px; }
  .page-main { padding: 0.75rem 0.85rem 1.25rem; gap: 0.75rem; }
  .pnl { padding: 0.8rem 0.8rem; }
}
/* 4 tabs + language selector: switch tabs with a short label to it a bit earlier on phones */
@media (max-width: 480px) {
  .page-tab.has-short .pt-full { display: none; }
  .page-tab.has-short .pt-short { display: inline; }
}
@media (max-width: 400px) {
  .page-tab { padding: 0 4px; font-size: 12.5px; }
  .hdr-nav .lang-select { max-width: 6.6rem; padding-right: 1.5rem; }
}

/* i18n: scan-data prose that has no translation is shown in its source language with a small badge */
[data-src="scan"][data-orig]::before {
  content: attr(data-orig);
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border: 1px solid var(--border, #1e2a3d);
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-dim, #8b9bb4);
  vertical-align: 1px;
  font-style: normal;
}
