/* 极策略 · 推送时间轴 — 样式表（由 index.html 拆出） */
/* ============ 设计令牌 ============ */
  :root {
    /* 纸感中性色 */
    --paper: #f4f2ee;
    --surface: #fbfaf7;
    --surface-2: #f7f5f1;
    --ink: #16181d;
    --ink-2: #3a3f47;
    --ink-3: #6f747c;
    --ink-4: #a0a49f;
    --rule: #e3dfd7;
    --rule-2: #d2cdc3;

    /* 单一强调色：墨蓝 */
    --accent: #26456e;
    --accent-2: #3d6191;
    --accent-wash: #eaeef4;
    --accent-rule: #c2cede;

    --signal: #a8472f;
    --green: #2f6b4f;

    /* 排版 */
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

    /* 节奏 */
    --topbar-h: 61px;
    --r: 2px;

    /* 动效 */
    --ease-out: cubic-bezier(.25, 1, .5, 1);
    --ease-in: cubic-bezier(.7, 0, .84, 0);
    --ease-both: cubic-bezier(.65, 0, .35, 1);

    --shadow-hover: 0 1px 2px rgba(22, 24, 29, .05), 0 6px 18px -8px rgba(22, 24, 29, .14);
  }
  html[data-theme="dark"] {
    --paper: #14150f;
    --surface: #1a1c18;
    --surface-2: #202219;
    --ink: #e9e7e0;
    --ink-2: #c6c3ba;
    --ink-3: #8e8b81;
    --ink-4: #6e6b63;
    --rule: #2b2d26;
    --rule-2: #3a3d34;

    --accent: #9dbde0;
    --accent-2: #b6cfea;
    --accent-wash: #1e2a36;
    --accent-rule: #34475c;

    --signal: #d98a72;
    --green: #7bc0a0;
    --shadow-hover: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px -10px rgba(0,0,0,.6);
  }

  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "tnum" 0;
  }
  ::selection { background: var(--accent-wash); color: var(--ink); }
  button { font: inherit; color: inherit; cursor: pointer; }
  a { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid var(--accent-rule); }
  a:hover { border-bottom-color: var(--accent-2); }
  :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 2px; }

  /* ============ 顶栏 ============ */
  .topbar {
    position: sticky; top: 0; z-index: 40;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    height: var(--topbar-h);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--rule);
  }
  .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .mark {
    flex: none; width: 24px; height: 24px; border-radius: 2px;
    display: grid; place-items: center;
    background: var(--ink); color: var(--paper);
    font: 600 10.5px/1 var(--sans); letter-spacing: .04em;
  }
  .brand-name {
    font-family: var(--serif); font-size: 15px; font-weight: 600;
    letter-spacing: .02em; white-space: nowrap;
  }
  .brand-sub {
    font-size: 11px; color: var(--ink-4); letter-spacing: .02em;
    padding-left: 10px; margin-left: 1px; border-left: 1px solid var(--rule-2);
    white-space: nowrap;
  }
  .conn {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    font-size: 10.5px; letter-spacing: .02em; color: var(--ink-3);
    padding: 1px 7px 1px 6px; border: 1px solid var(--rule); border-radius: 999px;
    transition: color .2s var(--ease-out), border-color .2s var(--ease-out), background-color .2s var(--ease-out);
  }
  .conn i {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--ink-4); transition: background-color .2s, box-shadow .2s;
  }
  .conn.on { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, var(--rule)); }
  .conn.on i { background: var(--green); box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--green) 18%, transparent); }
  .conn.off { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 30%, var(--rule)); }
  .conn.off i { background: var(--signal); }

  .tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .search {
    flex: 1; min-width: 0; max-width: 300px;
    display: flex; align-items: center; gap: 8px;
    height: 32px; padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    transition: border-color .18s var(--ease-out), background-color .18s var(--ease-out);
  }
  .search:hover { border-color: var(--rule-2); }
  .search:focus-within { border-color: var(--accent-rule); background: var(--surface); }
  .search svg { flex: none; color: var(--ink-4); transition: color .18s; }
  .search:focus-within svg { color: var(--accent-2); }
  .search input {
    flex: 1; min-width: 0; height: 100%;
    border: 0; background: none; outline: none;
    color: var(--ink); font-size: 13px;
  }
  .search input::placeholder { color: var(--ink-4); }
  .search kbd {
    flex: none; font: 500 10px/1 var(--mono); color: var(--ink-4);
    border: 1px solid var(--rule); border-radius: 2px; padding: 2px 4px;
  }

  .ledger {
    display: flex; align-items: baseline; gap: 14px;
    font-size: 11px; color: var(--ink-3); letter-spacing: .01em;
    white-space: nowrap;
  }
  .ledger span { display: inline-flex; align-items: baseline; gap: 4px; }
  .ledger b {
    font: 500 13px/1 var(--mono);
    color: var(--ink); font-variant-numeric: tabular-nums;
  }
  .ledger .sep { color: var(--rule-2); }

  .icon-btn {
    flex: none; width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent; border: 1px solid var(--rule); border-radius: var(--r);
    color: var(--ink-3);
    transition: color .18s, border-color .18s, background-color .18s, transform .1s;
  }
  .icon-btn:hover { color: var(--accent-2); border-color: var(--accent-rule); background: var(--accent-wash); }
  .icon-btn:active { transform: scale(.95); }

  /* ============ 主体 ============ */
  main {
    max-width: 780px; margin: 0 auto;
    padding: 34px 24px calc(44px + env(safe-area-inset-bottom));
  }

  .timeline { position: relative; }
  .timeline::before {
    content: ""; position: absolute; left: 4px; top: 10px; bottom: 0; width: 1px;
    background: linear-gradient(180deg, var(--rule-2), var(--rule) 140px, var(--rule-2) 100%);
  }

  /* 日期分节 */
  .day { position: relative; }
  .day-head {
    position: sticky; top: var(--topbar-h); z-index: 10;
    display: flex; align-items: baseline; gap: 9px;
    margin: 0 -24px 4px; padding: 20px 24px 8px;
    background: linear-gradient(180deg, var(--paper) 72%, color-mix(in srgb, var(--paper) 0%, transparent));
  }
  .day:first-child .day-head { padding-top: 0; }
  .day-name {
    font-family: var(--serif); font-size: 17px; font-weight: 600;
    letter-spacing: .03em; color: var(--ink);
  }
  .day-date {
    font: 500 10.5px/1 var(--mono); letter-spacing: .06em;
    color: var(--ink-4); text-transform: uppercase;
  }
  .day-count {
    margin-left: auto; font: 500 10.5px/1 var(--mono); color: var(--ink-4);
  }

  /* 条目 */
  .entry {
    position: relative;
    margin: 0 0 2px 22px;
    padding: 16px 18px 14px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
  }
  .entry + .entry { margin-top: 6px; }
  .entry:hover {
    border-color: var(--rule-2);
    box-shadow: var(--shadow-hover);
  }
  /* 时间轴节点 */
  .entry::before {
    content: ""; position: absolute; left: -22px; top: 22px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--paper);
    border: 1.5px solid var(--rule-2);
    transition: border-color .25s var(--ease-out), background-color .25s var(--ease-out), box-shadow .25s;
  }
  .entry:hover::before { border-color: var(--accent-2); }
  .entry.unread::before {
    border-color: var(--accent-2);
    background: var(--accent-2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 15%, transparent);
  }

  .entry-head { display: flex; align-items: baseline; gap: 12px; }
  .entry-time {
    flex: none; padding-top: 3px;
    font: 500 11px/1 var(--mono); letter-spacing: .03em;
    color: var(--ink-4); font-variant-numeric: tabular-nums;
  }
  .entry-title {
    flex: 1; min-width: 0;
    margin: 0; font-size: 16px; font-weight: 650; line-height: 1.45;
    letter-spacing: -.005em; color: var(--ink);
    overflow-wrap: break-word;
  }
  .entry-title mark { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: inherit; padding: 0 1px; }

  .entry-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin: 9px 0 0 27px;
  }
  .tag {
    font: 500 10.5px/1.5 var(--mono); letter-spacing: .02em;
    color: var(--ink-3);
    padding: 1px 6px; border-radius: 2px;
    background: var(--surface-2);
    border: 1px solid var(--rule);
  }
  .tag.sec { color: var(--accent-2); background: var(--accent-wash); border-color: var(--accent-rule); }
  .tag.batch {
    color: var(--accent-2); background: var(--accent-wash);
    border-color: var(--accent-rule); font-weight: 650; letter-spacing: .03em;
  }

  /* 正文 */
  .body { margin: 11px 0 0 27px; }
  .prose {
    font-size: 15px; line-height: 1.78; color: var(--ink-2);
    max-width: 62ch;
    overflow-wrap: break-word;
  }
  .prose > *:first-child { margin-top: 0; }
  .prose > *:last-child { margin-bottom: 0; }
  .prose h3, .prose h4, .prose h5, .prose h6 {
    margin: 20px 0 7px;
    font-size: 12px; font-weight: 700; line-height: 1.5;
    letter-spacing: .06em; color: var(--ink-3);
    text-transform: uppercase;
  }
  .prose h3:first-child, .prose h4:first-child { margin-top: 0; }
  .prose p { margin: 0 0 .62em; }
  .prose ul { margin: .3em 0 .8em; padding-left: 1.05em; }
  .prose li { margin: .28em 0; padding-left: .1em; }
  .prose li::marker { color: var(--ink-4); font-size: .9em; }
  .prose hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
  .prose blockquote {
    margin: .8em 0; padding: .1em 0 .1em 12px;
    border-left: 2px solid var(--accent-rule); color: var(--ink-3);
  }
  .prose code {
    font: 12.5px/1.6 var(--mono);
    background: var(--surface-2); border: 1px solid var(--rule);
    border-radius: 2px; padding: .05em .3em;
  }
  .prose strong { color: var(--ink); font-weight: 650; }
  .prose h6.src {
    margin: 18px 0 4px;
    font: 600 11.5px/1.6 var(--mono); letter-spacing: .03em;
    color: var(--accent-2);
  }
  .prose h6.src::before { content: "§ "; color: var(--ink-4); }

  /* 折叠：grid-template-rows 实现高度动效 */
  .fold {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 420ms var(--ease-out);
  }
  .fold[data-open="true"] { grid-template-rows: 1fr; }
  .fold-inner { overflow: hidden; }
  .fold-inner > .prose { padding-top: 2px; }

  .entry-foot {
    display: flex; align-items: center; gap: 16px;
    margin: 10px 0 0 27px;
  }
  .link-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: 0; padding: 2px 0;
    font-size: 12px; font-weight: 550; letter-spacing: .01em;
    color: var(--accent-2);
    transition: color .15s, opacity .15s;
  }
  .link-btn:hover { color: var(--accent); }
  .link-btn.ghost { color: var(--ink-4); }
  .link-btn.ghost:hover { color: var(--ink-2); }
  .link-btn svg { transition: transform .3s var(--ease-out); }
  .link-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

  /* 入场动画 */
  @keyframes rise {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
  }
  .entry.enter {
    animation: rise 420ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 32ms);
  }
  @keyframes flash {
    0% { background: color-mix(in srgb, var(--accent-wash) 90%, var(--surface)); }
    100% { background: var(--surface); }
  }
  .entry.fresh { animation: flash 1200ms var(--ease-out) both; }
  .entry.fresh::before { animation: dot-pop 620ms var(--ease-out) both; }
  @keyframes dot-pop {
    0% { transform: scale(.4); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 40%, transparent); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-2) 0%, transparent); }
  }

  /* ============ 空状态 / 骨架 ============ */
  .empty {
    padding: 64px 24px 40px; text-align: center;
    max-width: 420px; margin: 0 auto;
  }
  .empty-mark {
    width: 38px; height: 38px; margin: 0 auto 18px;
    display: grid; place-items: center;
    color: var(--ink-3);
    border: 1px solid var(--rule-2); border-radius: 50%;
  }
  .empty h2 {
    margin: 0 0 8px; font-family: var(--serif); font-size: 17px; font-weight: 600;
    letter-spacing: .02em;
  }
  .empty p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--ink-3); }
  .empty code {
    font: 11.5px/1.6 var(--mono); color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; padding: .1em .35em;
  }

  .skeleton { display: none; }
  .skeleton.show { display: block; }
  .sk {
    margin: 0 0 8px 22px; padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  }
  .sk-line {
    height: 9px; border-radius: 2px;
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--rule) 45%, var(--surface-2) 90%);
    background-size: 220% 100%;
    animation: sweep 1.5s linear infinite;
  }
  .sk-line + .sk-line { margin-top: 9px; }
  @keyframes sweep { from { background-position: 120% 0; } to { background-position: -60% 0; } }

  /* ============ 赞助位 ============ */
  .sponsor-strip {
    max-width: 780px; margin: 0 auto;
    padding: 0 24px;
    display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .sp-card {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    background: var(--ink); color: #f2efe9;
    border-radius: 3px;
    text-decoration: none; border-bottom: 0;
    transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
    min-width: 0;
  }
  .sp-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); color: #fff; }
  .sp-card img {
    width: 26px; height: 26px; border-radius: 4px; background: #fff;
    object-fit: contain; flex: none; padding: 2px;
  }
  .sp-card > span:not(.sp-tag) { min-width: 0; overflow: hidden; }
  .sp-name { font-size: 12.5px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
  .sp-slogan { font-size: 11px; opacity: .72; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
  .sp-tag {
    margin-left: auto; flex: none;
    font: 600 9px/1 var(--mono); letter-spacing: .12em;
    padding: 4px 7px; border-radius: 2px;
    border: 1px solid rgba(255,255,255,.28); color: rgba(255,255,255,.75);
  }

  /* ============ 页脚 ============ */
  .site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--rule);
    background: var(--surface-2);
    padding: 30px 24px calc(26px + env(safe-area-inset-bottom));
    font-size: 12px; color: var(--ink-3); line-height: 1.8;
  }
  .foot-inner { max-width: 780px; margin: 0 auto; }
  .foot-brand { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 2px; }
  .foot-name { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
  .foot-en { font: 500 10px/1 var(--mono); letter-spacing: .08em; color: var(--ink-4); text-transform: uppercase; }
  .foot-legal {
    border-top: 1px dashed var(--rule-2); padding-top: 12px; margin-top: 14px;
    font-size: 11px; color: var(--ink-4);
  }
  .foot-legal p { margin: 0 0 2px; }
  .foot-copy {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
    margin-top: 12px; font-size: 11px; color: var(--ink-4);
  }
  .foot-copy a { color: var(--ink-3); }

  /* ============ 回到顶部 / Toast ============ */
  .to-top {
    position: fixed; right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 30;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: var(--surface); color: var(--ink-3);
    border: 1px solid var(--rule-2); border-radius: 50%;
    box-shadow: var(--shadow-hover);
    opacity: 0; transform: translateY(8px) scale(.94); pointer-events: none;
    transition: opacity .24s var(--ease-out), transform .24s var(--ease-out), color .2s;
  }
  .to-top.show { opacity: 1; transform: none; pointer-events: auto; }
  .to-top:hover { color: var(--accent-2); }

  .toast {
    position: fixed; left: 50%; z-index: 60;
    bottom: calc(28px + env(safe-area-inset-bottom));
    padding: 8px 14px;
    background: var(--ink); color: var(--paper);
    font-size: 12.5px; letter-spacing: .01em;
    border-radius: 3px;
    opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
    transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }

  /* ============ 口令门 ============ */
  .gate {
    position: fixed; inset: 0; z-index: 70;
    display: grid; place-items: center; padding: 24px;
    background: var(--paper);
  }
  .gate-card {
    width: min(380px, 100%); padding: 28px 26px 24px;
    background: var(--surface); border: 1px solid var(--rule-2); border-radius: 3px;
  }
  .gate-card .mark { margin-bottom: 16px; }
  .gate-card h2 {
    margin: 0 0 7px; font-family: var(--serif); font-size: 18px; font-weight: 600;
  }
  .gate-card > p { margin: 0 0 18px; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
  .gate-card input {
    width: 100%; height: 40px; padding: 0 12px;
    font-size: 14px; color: var(--ink);
    background: var(--paper); border: 1px solid var(--rule-2); border-radius: 2px;
    outline: none; transition: border-color .18s;
  }
  .gate-card input:focus { border-color: var(--accent-2); }
  .gate-submit {
    width: 100%; height: 40px; margin-top: 10px;
    background: var(--ink); color: var(--paper);
    border: 1px solid var(--ink); border-radius: 2px;
    font-size: 13.5px; font-weight: 550; letter-spacing: .02em;
    transition: opacity .15s, transform .1s;
  }
  .gate-submit:hover { opacity: .88; }
  .gate-submit:active { transform: scale(.99); }
  .gate-submit:disabled { opacity: .5; cursor: default; }
  .gate-err { margin: 12px 0 0; font-size: 12px; color: var(--signal); }

  .hidden { display: none !important; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }

  /* ============ 响应式 ============ */
  @media (max-width: 720px) {
    :root { --topbar-h: 112px; }
    .topbar {
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: 44px 44px 24px;
      gap: 0;
      padding: 0 16px;
      height: var(--topbar-h);
    }
    .brand { grid-column: 1; grid-row: 1; }
    .brand-name { font-size: 14px; }
    .brand-sub { display: none; }
    .tools { grid-column: 1 / -1; grid-row: 2; gap: 8px; }
    #btn-theme { grid-column: 2; grid-row: 1; }
    .search { max-width: none; height: 34px; }
    .search kbd { display: none; }
    .ledger {
      grid-column: 1 / -1; grid-row: 3;
      justify-content: space-between; gap: 8px;
      font-size: 10px;
    }
    .ledger .sep { display: none; }
    .ledger b { font-size: 11.5px; }
    .icon-btn { width: 34px; height: 34px; }

    main { padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); }
    .sponsor-strip { padding: 0 16px; }
    .site-footer { padding-left: 16px; padding-right: 16px; }
    .timeline::before { left: 2px; }
    .day-head { margin: 0 -16px; padding: 16px 16px 7px; }
    .day-name { font-size: 15.5px; }
    .entry { margin-left: 15px; padding: 14px 14px 12px; }
    .entry::before { left: -16px; top: 20px; width: 6px; height: 6px; }
    .entry-head { gap: 9px; }
    .entry-title { font-size: 15.5px; line-height: 1.5; }
    .entry-time { font-size: 10.5px; }
    .entry-meta, .body, .entry-foot { margin-left: 0; }
    .prose { font-size: 15px; line-height: 1.82; max-width: none; }
    .link-btn { padding: 8px 0; }
    .empty { padding: 48px 8px 32px; }
  }

  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .entry.enter, .entry.fresh { animation: none !important; }
    .fold { transition: none !important; }
    .to-top, .toast { transition: opacity .15s !important; }
  }
