/* ===========================================================
   全局设计令牌（延续原 index.php 跟读页的紫色系风格，扩展出
   底部导航、渐变卡片、聊天气泡等新组件所需的变量）
   =========================================================== */
:root{
  --purple:#8b5cf6;
  --purple-dark:#7c3aed;
  --purple-light:#ede9fe;
  --navy:#1e2433;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e2e4ec;
  --bg:#f4f5f9;
  --green:#16a34a;
  --green-bg:#dcfce7;
  --orange:#d97706;
  --orange-bg:#fef3c7;
  --red:#dc2626;
  --red-bg:#fee2e2;
  --teal:#06b6d4;
  --pink:#ff6b9d;

  --grad-purple-blue: linear-gradient(135deg,#a78bfa,#5aa8ff);
  --grad-pink: linear-gradient(135deg,#ff9ac9,#ff6b9d);
  --grad-teal: linear-gradient(135deg,#5eead4,#06b6d4);
  --grad-blue: linear-gradient(135deg,#93c5fd,#3b82f6);
  --grad-gold: linear-gradient(135deg,#fde68a,#f59e0b);
  --grad-dark: linear-gradient(135deg,#334155,#0f172a);

  --nav-h: 60px;
  --shell-w: 480px; /* 手机宽度外壳的宽度上限，宽屏时在媒体查询里改大 */
}
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-tap-highlight-color:transparent;
}
a{ color:inherit; }
button{ font-family:inherit; }

/* ---------- 手机宽度外壳（宽屏下由媒体查询把 --shell-w 改大，实现响应式） ---------- */
.app-shell{
  max-width:var(--shell-w);
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
  position:relative;
  padding-top:calc(var(--nav-h) + env(safe-area-inset-top));
  /*padding-bottom:calc(14px + env(safe-area-inset-bottom));*/
}
.page-pad{padding-left:15px;padding-right:15px;padding-bottom:20px; }

/* ---------- 顶部状态条（对话页：连击/时长/钻石/对话次数） ---------- */
.stat-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px 4px;
  font-size:13px;
  font-weight:600;
  color:var(--navy);
}
.stat-bar .stat-item{ display:flex; align-items:center; gap:4px; }

/* ---------- 卡片 & 按钮通用 ---------- */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:0 8px 24px rgba(20,20,40,.05);
}
.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:999px;
  padding:12px 18px;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease;
}
.btn:active{ transform:scale(.97); }
.btn-grad{
  border:none;
  color:#fff;
  background:var(--grad-purple-blue);
  box-shadow:0 8px 18px rgba(124,58,237,.25);
}
.btn-block{ width:100%; display:block; text-align:center; }
.pill{
  display:inline-flex; align-items:center; gap:4px;
  border-radius:999px; padding:2px 10px; font-size:11px; font-weight:700;
}
.pill-free{ background:var(--green-bg); color:var(--green); }
.pill-vip{ background:var(--grad-gold); color:#7c4a03; }

/* ---------- 头像 ---------- */
.avatar-circle{
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff; font-weight:700; overflow:hidden; flex-shrink:0;
}

/* ---------- 顶部菜单栏 ---------- */
.top-nav{
  position:fixed; top:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:var(--shell-w); height:var(--nav-h);
  padding-top:env(safe-area-inset-top);
  display:flex; align-items:center; gap:10px;
  padding-left:10px; padding-right:10px;
  background:rgba(255,255,255,.92); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
  z-index:150;
}
.top-nav-btn{
  width:38px;height:38px; border-radius:12px; border:none; background:var(--bg);
  color:var(--navy); font-size:19px; display:flex;align-items:center;justify-content:center; cursor:pointer; flex-shrink:0;
}
.top-nav-title{ flex:1; text-align:center; font-size:16px; font-weight:800; color:var(--navy); }
/* 桌面端才显示的品牌名 + 横向导航链接，移动端默认隐藏（见页面顶部的媒体查询） */
.top-nav-brand{
  display:none; align-items:center; gap:8px; font-weight:800; font-size:17px; color:var(--navy); white-space:nowrap; flex-shrink:0;
}
.top-nav-links{ display:none; align-items:center; gap:4px; flex:1; }
.top-nav-link{
  padding:8px 16px; border-radius:999px; font-size:14.5px; font-weight:600; color:var(--muted); text-decoration:none; white-space:nowrap;
}
.top-nav-link:hover{ background:var(--bg); color:var(--navy); }
.top-nav-link.active{ background:var(--grad-purple-blue); color:#fff; }
.top-nav-avatar{ display:flex; align-items:center; text-decoration:none; position:relative; flex-shrink:0; }
.top-nav-avatar-circle{
  width:34px;height:34px;border-radius:50%; background:var(--grad-purple-blue); color:#fff;
  display:flex;align-items:center;justify-content:center; font-size:16px;
}
.top-nav-vip-dot{
  position:absolute; right:-2px; bottom:-2px; width:16px;height:16px;border-radius:50%;
  background:var(--grad-gold); color:#7c4a03; font-size:9px; display:flex;align-items:center;justify-content:center;
  border:2px solid #fff;
}

/* ---------- 左侧滑出抽屉菜单 ---------- */
.drawer-mask{
  position:fixed; inset:0; background:rgba(15,15,25,.45);
  display:flex; align-items:stretch; justify-content:flex-start;
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index:250;height:100%;width:100%;

}
.drawer-mask.show{ opacity:1; pointer-events:auto; }
.drawer-panel{
  width:78%; max-width:300px; height:100%; background:#fff;
  padding:calc(20px + env(safe-area-inset-top)) 18px 20px;
  transform:translateX(-100%);
  transition:transform .22s ease;
  box-shadow:8px 0 24px rgba(20,20,40,.12);
  overflow-y:auto;
}
.drawer-mask.show .drawer-panel{ transform:translateX(0); }
.drawer-brand{ font-size:17px; font-weight:800; color:var(--navy); display:flex; align-items:center; gap:8px; margin-bottom:18px; }
.drawer-user{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:16px; background:var(--bg); margin-bottom:18px; }
.drawer-user-avatar{ width:42px;height:42px;border-radius:50%; background:var(--grad-purple-blue); color:#fff; display:flex;align-items:center;justify-content:center; font-size:19px; flex-shrink:0; }
.drawer-user-name{ font-weight:700; font-size:14.5px; color:var(--navy); }
.drawer-user-sub{ font-size:12px; color:var(--muted); text-decoration:none; }
.drawer-menu{ display:flex; flex-direction:column; gap:4px; }
.drawer-item{
  display:flex; align-items:center; gap:12px; padding:11px 10px; border-radius:14px;
  text-decoration:none; color:var(--text);
}
.drawer-item-icon{
  width:38px;height:38px;border-radius:12px; background:var(--bg); color:var(--muted);
  display:flex;align-items:center;justify-content:center; font-size:18px; flex-shrink:0;
}
.drawer-item-text{ display:flex; flex-direction:column; }
.drawer-item-label{ font-size:14.5px; font-weight:700; }
.drawer-item-desc{ font-size:11.5px; color:var(--muted); }
.drawer-item.active{ background:var(--purple-light); }
.drawer-item.active .drawer-item-icon{ background:var(--grad-purple-blue); color:#fff; }
.drawer-item.active .drawer-item-label{ color:var(--purple-dark); }

/* ---------- 弹层 / 模态 通用（沿用跟读页设置弹窗风格） ---------- */
.modal-mask{
  position:fixed; inset:0; background:rgba(15,15,25,.45);
  display:flex; align-items:flex-end; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
  z-index:200;
}
.modal-mask.show{ opacity:1; pointer-events:auto; }
.modal-sheet{
  width:100%; max-width:480px; background:#fff;
  border-radius:22px 22px 0 0;
  padding:20px 20px calc(20px + env(safe-area-inset-bottom));
  transform:translateY(16px);
  transition:transform .18s ease;
  max-height:80vh; overflow-y:auto;
}
.modal-mask.show .modal-sheet{ transform:translateY(0); }
.modal-mask.center{ align-items:center; }
.modal-card{
  width:88%; max-width:380px; background:#fff; border-radius:20px; padding:22px;
}

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:calc(var(--nav-h) + 24px);
  transform:translate(-50%,10px);
  background:rgba(20,20,30,.9); color:#fff;
  padding:10px 18px; border-radius:999px; font-size:13px;
  opacity:0; pointer-events:none; transition:all .25s ease; z-index:300;
  max-width:80%; text-align:center;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }

/* ---------- 场景/功能卡片 grid ---------- */
.tile{
  border-radius:18px; padding:16px; color:#fff; position:relative; overflow:hidden; min-height:96px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.tile .tile-title{ font-size:17px; font-weight:800; }
.tile .tile-tag{ align-self:flex-start; background:rgba(255,255,255,.25); border-radius:999px; padding:3px 10px; font-size:11px; margin-top:6px; }
.tile .tile-sub{ font-size:12px; opacity:.85; margin-top:2px; }
.tile .tile-emoji{ position:absolute; right:10px; bottom:8px; font-size:34px; opacity:.9; }

.chip-row{ display:flex; gap:8px; overflow-x:auto; padding:2px 0 10px; scrollbar-width:none; }
.chip-row::-webkit-scrollbar{ display:none; }
.chip{ flex-shrink:0; padding:7px 14px; border-radius:999px; font-size:13px; font-weight:600; color:var(--muted); background:#fff; border:1px solid var(--border); white-space:nowrap; }
.chip.active{ background:var(--navy); color:#fff; border-color:var(--navy); }

.scenario-card{ background:#fff; border:1px solid var(--border); border-radius:18px; padding:14px; display:flex; flex-direction:column; gap:6px; }
.scenario-card .emoji{ font-size:30px; }
.scenario-card .title{ font-weight:700; font-size:15px; }
.scenario-card .level{ font-size:12px; color:var(--muted); }

/* ---------- 进度条 ---------- */
.progress-track{ background:#eef0f6; border-radius:999px; height:10px; overflow:hidden; position:relative; }
.progress-fill{ height:100%; border-radius:999px; background:var(--grad-teal); transition:width .3s ease; }

/* ---------- 表单 ---------- */
.form-field{ margin-bottom:14px; }
.form-field label{ display:block; font-size:13px; color:var(--muted); margin-bottom:6px; font-weight:600; }
.form-field input{ width:100%; border:1px solid var(--border); border-radius:12px; padding:12px 14px; font-size:15px; outline:none; }
.form-field input:focus{ border-color:var(--purple); }

.section-title{ font-size:16px; font-weight:800; color:var(--navy); margin:18px 0 10px; }
.muted{ color:var(--muted); }

.empty-state{ text-align:center; color:var(--muted); padding:30px 10px; font-size:13px; }

/* ===========================================================
   响应式：平板/PC 宽屏下切换成"网站"布局——外壳变宽、顶部导航从
   汉堡菜单+抽屉换成横向导航链接，其余组件（卡片/按钮/表单）本来
   就是相对单位，宽屏下自然跟着变宽，不需要逐个改。
   =========================================================== */
@media (min-width: 860px){
  :root{ --shell-w: 1080px; }
  body{ background:#eef0f5; }

  .top-nav{ justify-content:flex-start; padding-left:28px; padding-right:28px; gap:8px; }
  .top-nav-btn{ display:none; }
  .top-nav-title{ display:none; }
  .top-nav-brand{ display:flex; }
  .top-nav-links{ display:flex; }
  .top-nav-avatar{ margin-left:auto; }

  .page-pad{ padding-left:32px; padding-right:32px; }
}
