/* 智伴 · 视觉层
   定调：自然有机 / 暖纸感。陪伴长辈的产品做成冷冰冰的仪表盘是错的。
   陶土橙是唯一强调色，只给关键动作。 */

:root {
  --paper:        #FBF7F1;
  --paper-2:      #F4EDE3;
  --surface:      #FFFDFA;
  --text:         #2C2620;
  --text-soft:    #5B5248;
  --muted:        #8A8073;
  --faint:        #B4AA9C;
  --line:         #E4DACD;
  --line-soft:    #EFE7DC;

  --accent:       #C4622D;
  --accent-deep:  #9E4A1E;
  --accent-soft:  #F3DCCB;
  --on-accent:    #FFF9F3;

  --ok:           #5F7A4E;
  --ok-soft:      #E4EBDC;
  --warn:         #B4821B;
  --warn-soft:    #F7EACB;
  --alert:        #A8382C;
  --alert-soft:   #F6DDD8;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(60,45,30,.05), 0 8px 26px -12px rgba(60,45,30,.16);
  --shadow-lift: 0 2px 6px rgba(60,45,30,.06), 0 18px 44px -16px rgba(60,45,30,.24);

  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans:  "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(196,98,45,.05), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(95,122,78,.05), transparent 46%);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* 极细颗粒，避免大面积纯色的塑料感 */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .030;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 顶栏 ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(251,247,241,.86);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.mark {
  display: inline-flex; align-self: center;
  width: 32px; height: 32px; border-radius: 10px;
  align-items: center; justify-content: center;
  color: var(--on-accent);
  background: linear-gradient(150deg, #C96F35, #A94E1F);
  box-shadow: 0 4px 12px rgba(150,72,28,.28);
}
.bname { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .04em; }
.bsub { font-size: 12px; color: var(--muted); letter-spacing: .06em; }

/* 顶栏页内导航（PC 端习惯：常驻入口，窄屏隐藏） */
.topnav { display: flex; gap: 2px; margin-left: 18px; margin-right: auto; }
.topnav a {
  font-size: 13px; color: var(--muted);
  padding: 7px 13px; border-radius: 999px;
  transition: color .16s, background .16s;
}
.topnav a:hover { color: var(--accent-deep); background: var(--paper-2); }
@media (max-width: 940px) { .topnav { display: none; } }

.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background .25s; }
.conn.live .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: breathe 2.4s ease-in-out infinite; }
.conn.bad  .dot { background: var(--alert); box-shadow: 0 0 0 4px var(--alert-soft); }
.conn.live { color: var(--ok); }
.conn.bad  { color: var(--alert); }
@keyframes breathe { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ── 布局 ─────────────────────────────────── */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
  padding: 20px 26px 40px;
  align-items: start;
  max-width: 1280px; margin: 0 auto;
}
.col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ── 通话卡 ───────────────────────────────── */
.callcard { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 22px 26px; }
.who-name { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .02em; }
.who-meta { margin-top: 5px; font-size: 13px; color: var(--muted); }

.stage-line { margin: 14px 0 4px; }
.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; color: var(--accent-deep);
  background: var(--accent-soft); border: 1px solid rgba(196,98,45,.16);
}

.callbtn {
  position: relative;
  margin: 22px 0 6px;
  width: 148px; height: 148px;
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--on-accent);
  background: linear-gradient(158deg, #C96F35 0%, #A94E1F 100%);
  box-shadow: 0 14px 34px rgba(150,72,28,.30);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s;
  font-family: var(--sans);
}
.callbtn:hover  { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(150,72,28,.36); }
.callbtn:active { transform: scale(.97); }
.callbtn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.cb-label { font-size: 13px; letter-spacing: .08em; }

.callbtn .ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1.5px solid rgba(196,98,45,.35);
  opacity: 0;
}
.callbtn[data-state="live"] .ring { opacity: 1; animation: pulse 2s ease-out infinite; }
@keyframes pulse {
  0%   { transform: scale(.94); opacity: .7 }
  100% { transform: scale(1.22); opacity: 0 }
}
.callbtn[data-state="live"] { background: linear-gradient(158deg, #B8552A 0%, #8E3F16 100%); }

.meter { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.timer { font-family: var(--serif); font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--text); }
.level { width: 190px; height: 4px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.level i { display: block; height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #C96F35, #E0A063); transition: width .08s linear; }

.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); min-height: 18px; }
.hint.warn { color: var(--warn); }
.hint.err  { color: var(--alert); }

/* ── 转写 ─────────────────────────────────── */
.transcript { display: flex; flex-direction: column; min-height: 260px; }
.t-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; font-family: var(--serif); font-size: 15px; font-weight: 600; }
.t-sub { font-size: 12px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.bubbles { flex: 1; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.empty { color: var(--faint); font-size: 13px; padding: 18px 0; text-align: center; }

.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; line-height: 1.65; font-size: 14px; word-break: break-word; }
.bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; letter-spacing: .04em; }
.bubble.her  { align-self: flex-start; background: var(--paper-2); border-bottom-left-radius: 5px; }
.bubble.ai   { align-self: flex-end; background: var(--accent-soft); color: #6B3413; border-bottom-right-radius: 5px; }
.bubble.pending { opacity: .72; }

/* ── 设置 ─────────────────────────────────── */
.s-head { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.s-desc { margin: 0 0 16px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.fld > span { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }
.fld input, .fld select {
  font-family: var(--sans); font-size: 13.5px; color: var(--text);
  padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.fld input::placeholder { color: var(--faint); }
.fld input:focus, .fld select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(196,98,45,.12);
}

.btn-primary {
  width: 100%; margin-top: 8px; padding: 11px;
  border: none; border-radius: var(--r-md);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--on-accent); background: var(--accent);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(196,98,45,.26);
  transition: background .16s, transform .12s;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:active { transform: translateY(1px); }
.saved { margin-top: 8px; font-size: 12px; color: var(--ok); min-height: 16px; text-align: center; }

/* ── 日报 ─────────────────────────────────── */
.r-headline { font-family: var(--serif); font-size: 17px; line-height: 1.6; margin: 8px 0 10px; }
.r-mood { margin-bottom: 12px; }
.r-block { margin-bottom: 12px; }
.r-block .lbl { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; margin-bottom: 5px; }
.r-block li { font-size: 13.5px; line-height: 1.75; margin-left: -6px; }
.r-block ul { margin: 0; padding-left: 20px; }
.r-risk {
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--alert-soft); color: var(--alert);
  font-size: 13px; line-height: 1.6; margin-bottom: 12px;
}
.r-quote {
  margin: 0; padding: 10px 14px;
  border-left: 2px solid var(--accent);
  background: var(--paper);
  font-family: var(--serif); font-size: 14px; line-height: 1.7; color: var(--text-soft);
}

/* ── 事实 ─────────────────────────────────── */
.fact-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fact-list li { font-size: 13px; line-height: 1.55; padding: 8px 11px; background: var(--paper); border-radius: var(--r-sm); }
.fact-list .tag {
  display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 5px;
  font-size: 11px; background: var(--ok-soft); color: var(--ok);
}
.fact-list .tag.health { background: var(--ok-soft); color: var(--ok); }
.fact-list .tag.mood { background: #E7E3F0; color: #5B4E7A; }
.fact-list .tag.people { background: var(--accent-soft); color: var(--accent-deep); }
.fact-list .tag.interest { background: #DDE9E4; color: #3F6B58; }
.fact-list .tag.todo { background: var(--warn-soft); color: var(--warn); }
.fact-list .tag.risk { background: var(--alert-soft); color: var(--alert); }

/* ── Toast ────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 40;
  padding: 12px 20px; border-radius: var(--r-md);
  background: #3A2E24; color: #FFF6EC;
  font-size: 13.5px; box-shadow: var(--shadow-lift);
  animation: rise .22s ease-out;
}
.toast.alert { background: var(--alert); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ── 响应式 ───────────────────────────────── */
@media (max-width: 940px) {
  /* 窄屏还是要先看到"打电话"这个动作，设置往后放 */
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .callbtn { width: 128px; height: 128px; }
}

/* ── PC 宽屏增强（≥1200px：更宽的双栏、更大的通话按钮）── */
@media (min-width: 1200px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    max-width: 1440px;
    padding: 26px 36px 52px;
    gap: 22px;
  }
  .callbtn { width: 164px; height: 164px; }
  .callcard { padding: 36px 26px 30px; }
  .bubbles { max-height: 480px; }
  .card { padding: 26px; }
}
