/* ============================================================
     命伴 · 星轨长卷（暖炭 + 墨阶）
     底 #17150F（暖炭）· 阶 #1E1B14（墨阶卡）· 纸白 #F3F1EA
     灰 #B3AFA5 · 茶金 #E3C383
     月相 / 星轨 / 细线 / 圆点 / 微弱粒子。纯 CSS。
     ============================================================ */
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    background: #1C1913;
    color: #F3F1EA;
    font-family: "Noto Sans SC", "PingFang SC", sans-serif;
    font-weight: 300;
    letter-spacing: .05em;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: rgba(227,195,131,.32); }
  button, input, select, textarea { font-family: inherit; }
  a { color: inherit; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important } }

  /* 粒子 */
  .dust i {
    position: fixed; border-radius: 50%; background: #E3C383; opacity: 0;
    animation: drift 16s linear infinite; pointer-events: none; z-index: 0;
  }
  @keyframes drift {
    0% { opacity: 0; transform: translateY(0) }
    8% { opacity: .3 }
    50% { opacity: .16; transform: translateY(-50px) }
    92% { opacity: .1 }
    100% { opacity: 0; transform: translateY(-90px) }
  }

  .gold { color: #E3C383; }
  .mute { color: #B3AFA5; }
  .kicker { font-size: 11px; letter-spacing: .34em; color: #B3AFA5; }
  .serif { font-family: "Noto Serif SC", serif; }

  /* 顶栏 */
  header.top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: baseline; gap: 20px;
    padding: 20px 36px 14px;
    background: rgba(28,25,19,.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(243,241,234,.07);
  }
  .brand { font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 600; letter-spacing: .3em; }
  .brand small { font-size: 10px; color: #B3AFA5; letter-spacing: .24em; margin-left: 10px; font-family: "Noto Sans SC", sans-serif; }
  header.top nav { margin-left: auto; display: flex; gap: 22px; }
  header.top nav button {
    background: none; border: 0; cursor: pointer;
    color: #B3AFA5; font-size: 12px; letter-spacing: .22em; padding: 6px 0;
    border-bottom: 1px solid transparent; transition: color .2s;
  }
  header.top nav button.now { color: #E3C383; border-bottom-color: #E3C383; }
  header.top nav button:hover { color: #F3F1EA; }

  /* 主区 */
  main { max-width: 720px; margin: 0 auto; padding: 0 24px 140px; position: relative; z-index: 1; }

  /* ============ 今日封面 ============ */
  .hero { text-align: center; padding: 64px 0 40px; }
  .phase {
    width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%;
    border: 1px solid rgba(227,195,131,.55); position: relative; overflow: hidden;
  }
  .phase::after {
    content: ""; position: absolute; top: -2px; left: 50%;
    width: 72px; height: 72px; border-radius: 50%;
    box-shadow: inset 5px 0 0 0 rgba(227,195,131,.85);
  }
  .hero .greet { font-size: 15px; color: #B3AFA5; margin: 14px 0 0; }
  .hero .word {
    font-family: "Noto Serif SC", serif; font-size: 108px; font-weight: 700;
    letter-spacing: .14em; line-height: 1.1; margin: 8px 0 12px;
    text-shadow: 0 0 60px rgba(227,195,131,.18);
  }
  .hero .word small { font-size: 24px; font-weight: 400; color: #B3AFA5; margin-right: 12px; }
  .hero .copy { color: #B3AFA5; font-size: 14px; max-width: 30em; margin: 0 auto; }

  /* 星轨过渡 */
  .track { margin: 26px auto 30px; }
  .track svg { display: block; width: 100%; height: 46px; }

  /* 今日状态四格 */
  .states { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .st {
    background: #242017; border: 1px solid rgba(243,241,234,.07);
    padding: 14px; font-size: 12px; color: #B3AFA5; cursor: pointer;
    transition: border-color .2s;
  }
  .st:hover { border-color: rgba(227,195,131,.4); }
  .st b {
    display: block; font-family: "Noto Serif SC", serif;
    font-size: 30px; font-weight: 600; color: #F3F1EA; margin: 2px 0 4px;
  }
  .st i { display: block; height: 1px; background: rgba(243,241,234,.12); margin: 8px 0; position: relative; }
  .st i::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: var(--v, 60%); background: #E3C383; }
  .st .fit { display: none; font-size: 11px; margin-top: 6px; line-height: 1.6; }
  .st.open .fit { display: block; }

  /* 章节头 */
  .chapter-head { margin: 56px 0 6px; display: flex; align-items: center; gap: 16px; }
  .chapter-head h2 { font-family: "Noto Serif SC", serif; font-size: 16px; letter-spacing: .3em; color: #E3C383; margin: 0; font-weight: 600; }
  .chapter-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(227,195,131,.4), transparent); }

  /* ============ 画像页 ============ */
  .portrait-key { font-family: "Noto Serif SC", serif; font-size: 48px; font-weight: 600; letter-spacing: .1em; margin: 18px 0 8px; }
  .portrait-sum { color: #B3AFA5; max-width: 34em; }
  .card {
    background: #242017; border: 1px solid rgba(243,241,234,.07);
    padding: 22px 24px; margin: 16px 0;
  }
  .card h3 { font-family: "Noto Serif SC", serif; font-size: 15px; font-weight: 600; letter-spacing: .18em; margin: 0 0 8px; }
  .card h3 em { font-style: normal; color: #E3C383; margin-right: 10px; font-size: 12px; }
  .card p { margin: 0; color: #B3AFA5; font-size: 14px; }
  .basis-row { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 0; border-top: 1px solid rgba(243,241,234,.07); }
  .basis-row:first-child { border-top: 0; }
  .basis-row b { font-family: "Noto Serif SC", serif; color: #F3F1EA; font-weight: 400; letter-spacing: .1em; }

  /* ============ 年表（星轨） ============ */
  .orbit { position: relative; padding-left: 26px; }
  .orbit::before {
    content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 1px; background: linear-gradient(180deg, #E3C383, rgba(227,195,131,.15));
  }
  .ev { position: relative; padding: 16px 0 18px; }
  .ev .node {
    position: absolute; left: -26px; top: 26px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #E3C383; box-shadow: 0 0 14px rgba(227,195,131,.6);
  }
  .ev .node.hollow { background: #17150F; border: 1px solid rgba(227,195,131,.55); box-shadow: none; }
  .ev .yr { font-size: 11px; color: #E3C383; letter-spacing: .24em; }
  .ev strong { font-family: "Noto Serif SC", serif; font-weight: 600; font-size: 19px; display: block; margin: 3px 0 2px; letter-spacing: .08em; }
  .ev p { margin: 0; color: #B3AFA5; font-size: 13px; }
  .ev .del { background: none; border: 0; color: rgba(168,164,155,.5); font-size: 11px; cursor: pointer; letter-spacing: .14em; padding: 0; margin-top: 6px; }
  .ev .del:hover { color: #C96A5E; }

  /* ============ 档案（墨阶卡） ============ */
  .form-card { background: #242017; border: 1px solid rgba(243,241,234,.07); padding: 26px 28px; margin: 18px 0; }
  .form-card label { display: block; font-size: 12px; color: #B3AFA5; letter-spacing: .16em; margin: 14px 0 6px; }
  .form-card input, .form-card select {
    width: 100%; background: rgba(28,25,19,.7); border: 1px solid rgba(243,241,234,.12);
    color: #F3F1EA; padding: 10px 12px; font: inherit; font-size: 14px; outline: none;
  }
  .form-card input:focus, .form-card select:focus { border-color: rgba(227,195,131,.55); }
  .form-card input[type='checkbox'] { width: auto; }
  .segs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
  .seg {
    border: 1px solid rgba(243,241,234,.14); background: none; color: #B3AFA5;
    padding: 7px 14px; font-size: 12px; letter-spacing: .14em; cursor: pointer;
  }
  .seg.on { border-color: #E3C383; color: #E3C383; background: rgba(227,195,131,.07); }
  .btn {
    display: inline-block; background: #E3C383; color: #1C1913; border: 0;
    padding: 11px 26px; font-size: 13px; letter-spacing: .24em; font-weight: 500;
    cursor: pointer; margin-top: 16px;
  }
  .btn.ghost { background: none; color: #E3C383; border: 1px solid rgba(227,195,131,.4); }
  .list-btns { margin: 8px 0; }
  .list-btns button {
    display: flex; width: 100%; justify-content: space-between; align-items: center;
    background: none; border: 0; border-bottom: 1px solid rgba(243,241,234,.07);
    color: #F3F1EA; font-size: 14px; padding: 13px 2px; cursor: pointer; letter-spacing: .1em;
  }
  .list-btns button small { color: #B3AFA5; font-size: 11px; letter-spacing: .14em; }
  .list-btns button:hover { color: #E3C383; }
  .danger { color: #C96A5E !important; }

  /* ============ 守夜人浮条（陪伴） ============ */
  .watch {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: min(680px, calc(100% - 36px)); z-index: 30;
    border: 1px solid rgba(227,195,131,.35);
    background: rgba(36,32,23,.92); backdrop-filter: blur(14px);
    border-radius: 2px; overflow: hidden;
    box-shadow: 0 12px 44px rgba(0,0,0,.5);
  }
  .watch .head { display: flex; align-items: center; gap: 10px; padding: 11px 16px 0; }
  .watch .dot { width: 7px; height: 7px; border-radius: 50%; background: #E3C383; box-shadow: 0 0 10px rgba(227,195,131,.7); }
  .watch .head span { color: #B3AFA5; font-size: 11px; letter-spacing: .2em; }
  .watch .head .toggle { margin-left: auto; background: none; border: 0; color: #E3C383; font-size: 11px; letter-spacing: .18em; cursor: pointer; }
  .watch .panel { display: none; max-height: 300px; overflow: auto; padding: 10px 16px; }
  .watch.open .panel { display: block; }
  .watch .wb { font-size: 13px; padding: 9px 12px; margin: 7px 0; border: 1px solid rgba(243,241,234,.09); max-width: 86%; line-height: 1.7; }
  .watch .wb.me { margin-left: auto; border-color: rgba(227,195,131,.45); background: rgba(227,195,131,.06); }
  .watch .compose { display: flex; gap: 8px; padding: 10px 12px 12px; }
  .watch .compose input {
    flex: 1; background: rgba(28,25,19,.7); border: 1px solid rgba(243,241,234,.14);
    color: #F3F1EA; padding: 9px 12px; font-size: 13px; outline: none;
  }
  .watch .compose input:focus { border-color: rgba(227,195,131,.5); }
  .watch .compose button {
    background: #E3C383; color: #1C1913; border: 0; padding: 0 16px;
    font-size: 12px; letter-spacing: .2em; cursor: pointer;
  }

  /* toast */
  #toast {
    position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px);
    background: #F3F1EA; color: #1C1913; padding: 8px 16px; font-size: 12px;
    letter-spacing: .14em; opacity: 0; pointer-events: none; transition: .25s; z-index: 60;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* 空状态 */
  .empty { text-align: center; padding: 30px 0; }
  .empty .node { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(227,195,131,.5); margin: 0 auto 14px; }
  .empty p { color: #B3AFA5; font-size: 13px; }

  /* ============ 陪伴 · 独立主打页 ============ */
  .chat-segs { display: flex; flex-wrap: wrap; gap: 8px; }
  .chat-segs .seg { font-size: 12px; padding: 6px 13px; }

  .chat-room {
    background: rgba(36,32,23,.5);
    border: 1px solid rgba(243,241,234,.07);
    min-height: 380px;
    max-height: 52dvh;
    overflow: auto;
    padding: 20px 18px;
    margin: 14px 0 0;
    scroll-behavior: smooth;
  }
  .chat-empty { text-align: center; padding: 44px 0 30px; }
  .chat-empty .segs { justify-content: center; }

  .chat-row { display: flex; margin: 10px 0; }
  .chat-row.me { justify-content: flex-end; }
  .chat-bubble {
    max-width: 78%;
    padding: 11px 15px;
    font-size: 14px;
    line-height: 1.75;
    border: 1px solid rgba(243,241,234,.1);
    background: #242017;
    white-space: pre-wrap;
    letter-spacing: .04em;
  }
  .chat-row.me .chat-bubble {
    border-color: rgba(227,195,131,.5);
    background: rgba(227,195,131,.08);
  }
  .chat-bubble.thinking { color: #B3AFA5; font-size: 12px; letter-spacing: .2em; }

  .chat-composer { display: flex; gap: 10px; margin-top: 16px; }
  .chat-composer input {
    flex: 1;
    background: rgba(28,25,19,.7);
    border: 1px solid rgba(243,241,234,.14);
    color: #F3F1EA;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    letter-spacing: .04em;
  }
  .chat-composer input:focus { border-color: rgba(227,195,131,.55); }
  .chat-composer input::placeholder { color: #6E6A61; }
  .chat-composer button {
    background: #E3C383; color: #1C1913; border: 0;
    padding: 0 22px; font-size: 13px; letter-spacing: .24em;
    font-weight: 500; cursor: pointer;
  }
  .chat-composer button:disabled { opacity: .45; cursor: default; }

  /* 顶栏陪伴入口微强调 */
  header.top nav button.chat-nav { color: rgba(227,195,131,.85); }
  header.top nav button.chat-nav.now { color: #E3C383; border-bottom-color: #E3C383; }

  @media (max-width: 640px) {
    header.top { padding: 16px 20px 12px; gap: 12px; }
    header.top nav { gap: 14px; }
    header.top nav button { font-size: 11px; letter-spacing: .14em; }
    .brand small { display: none; }
    .hero { padding: 44px 0 28px; }
    .hero .word { font-size: 76px; }
    .states { grid-template-columns: repeat(2, 1fr); }
    main { padding: 0 18px 150px; }
  }