/* styles_newstier_core_default_ver(2.1).css — newstier website, phone-first. */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --ink: #16191d;
  --ink-soft: #5b6472;
  --line: #e4e7eb;
  --accent: #0b5cff;
  --accent-ink: #ffffff;
  --pos: #0a7d3c;
  --neg: #c62828;
  --neu: #8a94a3;
  --chip-bg: #eef1f6;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
body.no-scroll { overflow: hidden; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
}
.masthead .bar { display: flex; align-items: center; gap: 12px; }
.masthead h1 { font-size: 19px; letter-spacing: 2.5px; margin: 0; font-weight: 700; flex: 1; }
.masthead h1 a { color: #fff; }
.masthead .date { font-size: 12px; color: #b9c0ca; white-space: nowrap; }
.masthead .age { font-size: 11px; color: #9fb0c8; }
.masthead .age.warn { color: #ffb74d; }
.masthead .age.stale { color: #ff8a80; }

.masthead .statusbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 7px; font-size: 11px; color: #b9c0ca;
}
.masthead .statusbar .st { font-weight: 500; }
.masthead .statusbar #ns-status.on { color: #7ee2a0; font-weight: 600; }
.masthead .statusbar #ns-status.off { color: #ff8a80; font-weight: 600; }
.masthead .statusbar .welcome { font-weight: 400; }
.masthead .statusbar .welcome .vis { color: #7ee2a0; font-weight: 600; }
.masthead .statusbar .age { margin-left: auto; color: #9fb0c8; }
.masthead .statusbar .age.warn { color: #ffb74d; }
.masthead .statusbar .age.stale { color: #ff8a80; }

.menu-btn {
  background: none; border: 0; color: #fff; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  padding: 0; flex: 0 0 auto;
}
.menu-btn:hover { background: rgba(255,255,255,.12); }
.menu-btn span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- drawer (mobile nav) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 13, 18, .45);
  z-index: 40; opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 80%; max-width: 320px;
  background: var(--bg); z-index: 50;
  transform: translateX(-102%); opacity: 0;
  transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .28s ease;
  box-shadow: 8px 0 30px rgba(0,0,0,.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer.open { transform: translateX(0); opacity: 1; }
.drawer .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer .drawer-head .t { font-weight: 700; letter-spacing: 2px; font-size: 16px; }
.drawer .drawer-close {
  background: none; border: 0; font-size: 26px; line-height: 1; color: var(--ink-soft);
  cursor: pointer; padding: 0 4px;
}
.drawer a.nav-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 600;
}
.drawer a.nav-item .n { color: var(--accent); font-weight: 700; font-size: 13px; }
.drawer a.nav-item .ago { margin-left: auto; font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.drawer a.nav-item.home { background: var(--bg-soft); }

/* ---------- nav grid (home page) ---------- */
.navgrid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin: 14px 0 4px;
}
.catcard {
  display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px;
  background: var(--bg);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: fadeUp .35s ease both;
}
.navgrid.no-anim .catcard { animation: none; }
.catcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); border-color: var(--accent); }
.catcard .name { font-size: 15px; font-weight: 700; color: var(--ink); }
.catcard .count { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.catcard .ago { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 8px; }
.catcard.latest { background: var(--ink); border-color: var(--ink); }
.catcard.latest .name, .catcard.latest .count, .catcard.latest .ago { color: #fff; }
.catcard.latest .ago { color: #ffd54f; }

/* ---------- content ---------- */
.catstrip {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 0; margin: 4px 0;
  scrollbar-width: none;
}
.catstrip::-webkit-scrollbar { display: none; }
.catstrip a {
  white-space: nowrap; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
}
.catstrip a .n { color: var(--accent); font-weight: 700; }
.catstrip a:hover { color: var(--accent); border-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 64px; }
.hdr { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 0 8px; }
.hdr h2 { font-size: 18px; margin: 0; }
.hdr .sub { font-size: 12px; color: var(--ink-soft); }

.sec { }
.sec > h3 {
  font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px; margin: 0 0 6px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.sec > h3 a { color: var(--ink-soft); }
.sec > h3 .cnt { color: var(--accent); }

/* story */
.story { padding: 10px 0; border-bottom: 1px solid var(--line); animation: fadeUp .35s ease both; }
.story:last-child { border-bottom: 0; }
.story .meta { font-size: 12px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.story h4 { font-size: 16px; font-weight: 600; margin: 3px 0 3px; line-height: 1.3; }
.story h4 a:hover { color: var(--accent); }
.story .digest { font-size: 14px; color: var(--ink-soft); margin: 3px 0 6px; }
.src-link { color: var(--accent); font-weight: 700; font-size: 12px; white-space: nowrap; }
.src-link:hover { text-decoration: underline; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip-bg); color: var(--ink-soft); }
.chip.pri { background: var(--ink); color: #fff; }
.chip.sent-pos { background: #e3f4e8; color: var(--pos); }
.chip.sent-neg { background: #fbe5e5; color: var(--neg); }
.chip.sent-neu { background: #edf0f4; color: var(--neu); }

.symlink { font-size: 11px; font-weight: 700; color: var(--accent); }
.symlink:hover { text-decoration: underline; }

.empty { color: var(--ink-soft); font-size: 14px; padding: 24px 0; text-align: center; }

/* ---------- article (full view) ---------- */
.article h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 10px; }
.article .body {
  font-size: 16.5px; line-height: 1.6; color: #2a2f36;
  white-space: pre-wrap; margin-top: 14px;
}
.article .src-btn {
  display: inline-block; margin-top: 18px; padding: 10px 16px;
  background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.article .src-btn:hover { color: #fff; opacity: .9; }
.back-link { display: inline-block; margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }

/* ---------- footer ---------- */
footer {
  max-width: 760px; margin: 0 auto; padding: 12px 16px 40px;
  font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--line);
}

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-in { animation: fadeIn .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .11s; }
.stagger > *:nth-child(5) { animation-delay: .14s; }
.stagger > *:nth-child(6) { animation-delay: .17s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- desktop ---------- */
@media (min-width: 700px) {
  .masthead { padding: 14px 24px; }
  .masthead h1 { font-size: 26px; }
  main, footer { max-width: 900px; padding-left: 24px; padding-right: 24px; }
  .story h4 { font-size: 17px; }
  .navgrid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .article h1 { font-size: 30px; }
}
