/* ============ 玩ABC-游戏学英语 公共样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sea-deep: #14496e;
  --sea-mid: #1f6e9e;
  --sea-light: #c9b48f;
  --sand: #fef3c7;
  --wood: #92400e;
  --wood-light: #b45309;
  --danger: #dc2626;
  --ok: #1fa97f;
  --ink: #22303b;
  --paper: #faf6ee;
  --card: #ffffff;
  --line: #ede3d2;
  --coral: #ff6b57;
  --coral-deep: #e04b36;
  --kelp: #1fa97f;
  --tide: #3e9cc4;
  --paper-warm: #fbf6ec;
  --sand-line: #ede3d2;
}

html, body {
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
}

body {
  background: linear-gradient(180deg, #f6f0e2 0%, #eae0cb 40%, #c9b48f 60%, #3e9cc4 100%);
  overflow-x: hidden;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }
/* -- 全站按钮统一黄色（2026-10-30）：与首页「学习手账」格子 / 「继续学习」按钮同一款 -- */
.btn, .btn-primary, .btn-green {
  background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500);
  color: #4a2c00;
  border: 1.5px solid #d99400;
  box-shadow: 0 3px 0 rgba(150,84,0,.30);
}
.btn:hover, .btn-primary:hover, .btn-green:hover { filter: brightness(1.05); }
.btn:active, .btn-primary:active, .btn-green:active {
  transform: translateY(2px); box-shadow: 0 1px 0 rgba(150,84,0,.30);
}
/* 次要按钮：白底黄边，保持层级不抢主按钮 */
.btn-ghost {
  background: #fffdf5;
  color: #8a4b00;
  border: 1.5px solid #e0a400;
}
.btn-ghost:hover { background: #ffefc2; }
/* 夜间模式：黄底压深，避免刺眼 */
html.dark .btn, html.dark .btn-primary, html.dark .btn-green {
  background: linear-gradient(180deg,#f0b429,#d99507 52%,#b87500);
  color: #3a2200;
  border-color: #8a5200;
}
html.dark .btn-ghost { background: rgba(255,253,245,.08); color: #fcd34d; border-color: rgba(224,164,0,.45); }
.btn-danger-ghost { background: #fff; color: var(--danger); border: 1.5px solid #fecaca; }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: #4c5964; font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--sea-mid);
  box-shadow: 0 0 0 3px rgba(31,110,158, .15);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(20,73,110, .08);
  border: 1px solid rgba(234,224,203, .6);
}
.card h2 { font-size: 17px; margin-bottom: 14px; color: var(--sea-deep); display: flex; align-items: center; gap: 8px; }

/* ---------- 提示条 ---------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 520px);
}
.toast {
  background: rgba(34,48,59, .92); color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  animation: toastIn .25s ease; text-align: center;
}
.toast.err { background: rgba(220, 38, 38, .94); }
.toast.ok { background: rgba(31,169,127, .94); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(34,48,59, .55);
  display: flex; align-items: center; justify-content: center; z-index: 900;
  padding: 16px; animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; padding: 24px;
  width: min(94vw, 440px); box-shadow: 0 20px 50px rgba(0,0,0,.3);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 16px; color: var(--sea-deep); }
.modal .field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- 加载 ---------- */
.loading { text-align: center; color: #5f6b78; padding: 30px 0; font-size: 14px; }

/* ============ 门户框架（深色主题） ============ */
.portal-body {
  background: #0b1220;
  min-height: 100vh;
}
.portal {
  display: flex; flex-direction: column;
  min-height: 100vh;
  max-width: 100%; margin: 0 auto; padding: 0 20px;
  color: #ede3d2;
}

/* 顶部栏 */
.pt-top {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(110,124,136,.16);
  background: rgba(11,18,32,.85);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(8px);
}
.pt-logo {
  font-size: 20px; font-weight: 800; color: #f7f2e7;
  letter-spacing: 1px; text-decoration: none; white-space: nowrap;
  text-shadow: 0 0 18px rgba(62,156,196,.35);
}
.pt-search {
  flex: 1; display: flex; gap: 8px; max-width: 460px;
}
.pt-search input {
  flex: 1; border: 1.5px solid rgba(110,124,136,.3); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; outline: none;
  background: rgba(255,255,255,.07); color: #ede3d2; font-family: inherit;
}
.pt-search input::placeholder { color: #5f6b78; }
.pt-search input:focus { border-color: #3e9cc4; box-shadow: 0 0 0 3px rgba(62,156,196,.18); }
.pt-search .btn { background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500); border: 1.5px solid #d99400; color: #4a2c00; }
.pt-user { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.pt-user-btn {
  border: 1.5px solid rgba(110,124,136,.35); color: #d8cfc0;
  background: transparent; border-radius: 10px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  font-family: inherit; transition: .15s;
}
.pt-user-btn:hover { border-color: #3e9cc4; color: #fff; }
.pt-user-btn.primary { background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500); border-color: #d99400; color: #4a2c00; box-shadow: 0 3px 0 rgba(150,84,0,.30); }
.pt-user-btn.ghost { background: rgba(255,255,255,.06); }
.pt-user-name { color: #c9b48f; font-weight: 400; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; }
.pt-top-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; margin-right: 6px; flex-shrink: 0; background: linear-gradient(135deg,#14496e,#1f6e9e); color: #fff; font-size: 13px; font-weight: 700; }
.pt-top-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 主体布局 */
.pt-body {
  display: flex; flex: 1; gap: 18px; padding: 18px 20px;
}

/* 左侧导航 */
.pt-side {
  width: 204px; flex-shrink: 0;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(110,124,136,.14);
  border-radius: 16px; padding: 14px 10px;
  align-self: flex-start; position: sticky; top: 78px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.pt-side-title { font-size: 13px; color: #5f6b78; font-weight: 700; padding: 0 10px 8px; letter-spacing: 2px; }
.pt-nav { display: flex; flex-direction: column; gap: 1px; }
.pt-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: #5f6b78; font-size: 17px; text-decoration: none;
  font-weight: 400; transition: .15s;
}
.pt-nav a:hover { background: rgba(255,255,255,.06); color: #ede3d2; }
.pt-nav a.active { background: linear-gradient(135deg, rgba(31,110,158,.22), rgba(20,73,110,.18)); color: #c9b48f; box-shadow: inset 0 0 0 1px rgba(62,156,196,.25); }
.pt-nav a.hot { background: linear-gradient(135deg, rgba(251,191,36,.2), rgba(180,83,9,.16)); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(251,191,36,.35); }
.pt-nav-icon { font-size: 19px; width: 24px; text-align: center; }

/* 内容区 */
.pt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Hero */
.pt-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0e3552 0%, #0e7490 55%, #155e75 100%);
  border-radius: 20px; padding: 34px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid rgba(62,156,196,.25);
}
.pt-hero h1 {
  font-size: 38px; color: #fff; letter-spacing: 4px;
  text-shadow: 0 4px 0 rgba(2,44,84,.5);
}
.pt-hero p { color: #eae0cb; margin: 10px 0 22px; font-size: 15px; line-height: 1.7; }
.pt-hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pt-hero-btns .btn { padding: 12px 26px; font-size: 16px; }
.btn-lg { padding: 12px 26px; font-size: 16px; }
.pt-hero-art { position: relative; width: 220px; height: 150px; flex-shrink: 0; }
.pt-sun { position: absolute; top: 6px; right: 10px; font-size: 44px; animation: ptFloat 5s ease-in-out infinite; }
.pt-ship { position: absolute; bottom: 44px; left: 40px; font-size: 64px; animation: ptFloat 3.4s ease-in-out infinite; }
.pt-wave {
  position: absolute; left: -40px; right: -40px; bottom: 26px; height: 26px;
  background: radial-gradient(circle at 20px 50%, rgba(201,180,143,.7) 16px, transparent 17px) repeat-x 0 0 / 80px 26px;
  animation: ptWave 6s linear infinite;
  opacity: .6;
}
@keyframes ptFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ptWave { from { background-position-x: 0; } to { background-position-x: -80px; } }

/* 统计卡 */
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pt-stat-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(110,124,136,.16);
  border-radius: 14px; padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.pt-stat-icon { font-size: 26px; }
.pt-stat-num { font-size: 24px; font-weight: 800; color: #c9b48f; }
.pt-stat-lab { font-size: 12px; color: #5f6b78; }

/* 卡片 */
.pt-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(110,124,136,.16);
  border-radius: 16px; padding: 20px;
}
.pt-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pt-card-head h3 { font-size: 16px; color: #ede3d2; display: flex; align-items: center; gap: 8px; }
.pt-more { color: #3e9cc4; font-size: 13px; text-decoration: none; font-weight: 600; }
.pt-cols { display: flex; gap: 16px; align-items: flex-start; }
.pt-col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pt-side-col { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1180px) { .pt-side-col { width: 288px; } }
.pt-rank { width: 100%; flex-shrink: 0; }
@media (max-width: 900px) { .pt-cols { flex-direction: column; } .pt-rank { width: 100%; } .pt-side { width: 100%; position: static; max-height: none; } .pt-body { flex-direction: column; } .pt-hero-art { display: none; } }

/* 我的学习 */
.pt-study-body { }
.pt-study-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pt-study-item {
  background: rgba(255,255,255,.06); border: 1px solid rgba(110,124,136,.16);
  border-radius: 12px; padding: 14px 12px; text-align: center;
}
.pt-study-item .num { font-size: 20px; font-weight: 800; color: #c9b48f; }
.pt-study-item .lab { font-size: 12px; color: #5f6b78; margin-top: 4px; }
.pt-study-user { margin-top: 14px; font-size: 13px; color: #5f6b78; }
.pt-study-user b { color: #ede3d2; }

/* 船长榜 */
.pt-rank-table { width: 100%; border-collapse: collapse; }
.pt-rank-table td { padding: 9px 6px; border-bottom: 1px solid rgba(110,124,136,.12); font-size: 14px; }
.pt-rank-table tr:last-child td { border-bottom: none; }
.pt-rank-no { width: 30px; font-weight: 800; color: #5f6b78; }
.pt-rank-no.top { color: #fbbf24; }
.pt-rank-name { color: #ede3d2; font-weight: 600; }
.pt-rank-num { text-align: right; color: #c9b48f; font-family: Consolas, monospace; }

/* 空状态 / 页头 */
.pt-empty { text-align: center; color: #5f6b78; font-size: 14px; padding: 24px 0; line-height: 1.8; }
.pt-empty a { color: #3e9cc4; }
.pt-page-head h2 { font-size: 22px; color: #f7f2e7; }
.pt-page-head p { color: #5f6b78; font-size: 13px; margin-top: 4px; }

/* 打卡日历 */
.pt-cal { display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; margin-top: 6px; }
.pt-cal-day {
  aspect-ratio: 1; border-radius: 6px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(110,124,136,.14);
  position: relative;
}
.pt-cal-day.on { background: linear-gradient(135deg, #1f6e9e, #14496e); border-color: #3e9cc4; }
.pt-cal-day.on::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-weight: 800; }
.pt-cal-tip { margin-top: 10px; font-size: 12px; color: #5f6b78; }

/* 会员中心 */
.pt-member-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pt-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, #1f6e9e, #1b5e8a);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 3px rgba(62,156,196,.3);
}
.pt-member-name { font-size: 20px; font-weight: 800; color: #f7f2e7; }
.pt-member-sub { font-size: 13px; color: #5f6b78; margin-top: 3px; }
.pt-sec-title { font-size: 15px; color: #ede3d2; margin: 18px 0 4px; }
.pt-member-actions { display: flex; gap: 10px; margin-top: 20px; }

/* 栏目内容（text 型） */
.pt-text-body { }
.pt-text-pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 14px; color: #d8cfc0; line-height: 1.9;
}

/* 页脚 */
.pt-foot {
  text-align: center; color: #4c5964; font-size: 12px;
  padding: 18px 20px 26px; border-top: 1px solid rgba(110,124,136,.12);
}

/* 页脚合规链接（隐私政策 / 用户协议）：2026-11-08 起由独立一行改为并入页脚同一行 */
.ft-links { display: inline; margin-top: 0; font-size: 12px; }
.ft-links::before { content: '·'; color: #c9c0b2; margin: 0 5px 0 3px; }
.ft-links a { color: #5f6b78; text-decoration: none; margin: 0 4px; white-space: nowrap; }
.ft-links a:hover { color: #14496e; text-decoration: underline; }
.ft-links .ft-dot { color: #d8cfc0; margin: 0 2px; }
html.dark .ft-links a { color: #5f6b78; }
html.dark .ft-links a:hover { color: #c9b48f; }
html.dark .ft-links .ft-dot { color: #4c5964; }
html.dark .ft-links::before { color: #4c5964; }

/* 一行页脚：段落分隔点 + 公安备案链接（与正文同色，悬停变主题强调色） */
.pt-foot .ft-line { display: inline; line-height: 1.9; }
/* 每段整体不拆行（避免「黔ICP备 / 2026019547号」这种数字被切断），只在「·」处分行 */
.pt-foot .ft-item { white-space: nowrap; }
.pt-foot .ft-sep { color: #c9c0b2; margin: 0 5px; }
.pt-foot a.ft-police { color: #5f6b78; text-decoration: none; }
.pt-foot a.ft-police:hover { color: #14496e; text-decoration: underline; }
/* ICP 备案号链接：与公安备案同色，悬停变强调色 */
.pt-foot a.ft-icp { color: #5f6b78; text-decoration: none; }
.pt-foot a.ft-icp:hover { color: #14496e; text-decoration: underline; }
html.dark .pt-foot a.ft-icp { color: #5f6b78; }
html.dark .pt-foot a.ft-icp:hover { color: #c9b48f; }
/* 公安备案官方徽标：原图 36×40，等比缩到 16×18（再小就看不出国徽细节），vertical-align 微调与 12px 正文居中 */
.pt-foot .ft-police-ico {
  width: 16px; height: 18px; margin-right: 3px; vertical-align: -4px;
  border: 0; display: inline-block;
}
html.dark .pt-foot .ft-sep { color: #4c5964; }
html.dark .pt-foot a.ft-police { color: #5f6b78; }
html.dark .pt-foot a.ft-police:hover { color: #c9b48f; }

/* 手机端：字号略收；窄屏换行时用间距代替「·」，避免第二行以点开头 */
@media (max-width: 480px) {
  .pt-foot { font-size: 11px; padding: 14px 12px 20px; }
  .ft-links { font-size: 11px; }
  .pt-foot .ft-sep { display: none; }
  .pt-foot .ft-item { margin: 0 6px; }
  .ft-links::before { display: none; }
  .pt-foot .ft-police-ico { width: 14px; height: 16px; margin-right: 2px; vertical-align: -4px; }
}

/* VIP 标识 */
.tag-vip { display: inline-block; background: #fef3c7; color: #b45309; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* 导航分隔（固定功能入口与管理栏目之间） */
.pt-nav-sep { height: 1px; background: rgba(234,224,203,.25); margin: 8px 10px; }

/* 后台词库分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 0 4px; flex-wrap: wrap; }
.pg-info { font-size: 13px; color: #5f6b78; }
.pg-size { padding: 4px 8px; border: 1px solid #d8cfc0; border-radius: 8px; background: #fff; color: #36424c; font-size: 13px; font-family: inherit; }


/* ============ 手机端适配 ============ */
@media (max-width: 768px) {
  .portal { padding: 0 10px; }
  .pt-top { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .pt-logo { font-size: 16px; }
  .pt-search { max-width: 100%; order: 3; flex-basis: 100%; }
  .pt-top-right { gap: 8px !important; font-size: 13px !important; }
  .pt-cols { flex-direction: column; }
  .pt-side-col { width: 100% !important; }
  .pt-hero h1 { font-size: 26px !important; }
  .pt-hero p { font-size: 14px !important; }
  .pt-hero-btns .btn { padding: 10px 16px !important; font-size: 14px !important; }
  .pt-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .pt-stat { padding: 10px !important; }
  .pt-stat-num { font-size: 18px !important; }
  .pt-card { padding: 12px !important; }
  .pt-rank-table td { padding: 7px 4px; font-size: 13px; }
  .pt-rank-name { font-size: 13px; }
  .pt-book-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .pt-book-card { padding: 12px 8px !important; }
  .pt-book-card .name { font-size: 14px !important; }
  .pt-stage-tabs, .pt-book-tabs { gap: 6px !important; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .pt-stage-tabs button, .pt-book-tabs button { white-space: nowrap; padding: 6px 12px !important; font-size: 13px !important; }
  .pt-crumb { font-size: 12px !important; }
}

/* ============================================================
 * V2 主题层：「阳光港口 · 游戏大厅」2026-09-30
 * 追加在文件末尾，利用级联覆盖上方深色门户样式
 * ============================================================ */

/* ---------- 图标基础 ---------- */
.gi { width: 1em; height: 1em; display: inline-block; vertical-align: -0.13em; fill: none; }
.ic-slot { display: inline-flex; align-items: center; justify-content: center; }
.pt-card-head h3 .gi { color: #14496e; font-size: 18px; }

/* ---------- 全局：深色 → 阳光天空 ---------- */
.portal-body {
  background: linear-gradient(180deg, #fbf6ec 0%, #f7f2e7 45%, #f2ead9 100%);
  background-attachment: fixed;
}
.portal { color: #22303b; }

/* ---------- 顶部栏 ---------- */
.pt-top {
  background: rgba(255,255,255,.72);
  border-bottom: 1.5px solid rgba(201,180,143,.55);
  backdrop-filter: blur(8px);
}
.pt-logo { color: #14496e; display: flex; align-items: center; gap: 9px; }
.pt-logo-mark {
  width: 36px; height: 36px; border-radius: 11px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(20,73,110,.25);
  transform: rotate(-5deg);
  display: inline-flex;
}
.pt-logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.pt-search input {
  background: rgba(255,255,255,.9); color: #22303b;
  border: 2px solid #eae0cb; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(20,73,110,.08);
}
.pt-search input:focus { border-color: #3e9cc4; box-shadow: 0 0 0 3px rgba(62,156,196,.18); }
.pt-search .btn { border-radius: 999px; margin-left: 8px; }
.pt-install-btn {
  background: #14496e; color: #fff; border: none; border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 400; cursor: pointer;
  box-shadow: 0 3px 0 #0e3552; font-family: inherit;
}
.pt-user-btn { border-color: #e0a400; color: #8a4b00; background: #fffdf5; }
.pt-user-btn:hover { border-color: #d99400; color: #6b3a00; background: #ffefc2; }
.pt-user-btn.primary { background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500); color: #4a2c00; border-color: #d99400; }
.pt-user-btn.ghost { background: rgba(255,255,255,.5); }
.pt-user-name { color: #1b5e8a; }

/* ---------- 左侧导航 ---------- */
.pt-side {
  background: rgba(255,255,255,.8);
  border: 1.5px solid rgba(201,180,143,.5);
  box-shadow: 0 4px 16px rgba(20,73,110,.08);
}
.pt-side-title { color: #000; }
.pt-nav a { color: #000; }
.pt-nav a:hover { background: rgba(201,180,143,.18); color: #000; }
.pt-nav a.active {
  background: linear-gradient(135deg, rgba(62,156,196,.2), rgba(20,73,110,.14));
  color: #000; box-shadow: inset 0 0 0 1.5px rgba(62,156,196,.45);
}
.pt-nav a.hot {
  background: linear-gradient(135deg, rgba(251,191,36,.3), rgba(180,83,9,.14));
  color: #000; box-shadow: inset 0 0 0 1.5px rgba(251,191,36,.6);
}
.pt-nav-sep { background: rgba(201,180,143,.5); }

/* ---------- 3D 卡通按钮 ---------- */
.btn3d {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 800;
  border-radius: 16px; text-decoration: none; position: relative;
  transition: transform .08s, box-shadow .08s, filter .15s;
  padding: 14px 30px; font-size: 17px;
  white-space: nowrap;
}
.btn3d:active { transform: translateY(4px); }
.btn3d .gi { font-size: 1.15em; }
.btn3d-sun, .btn3d-green {
  background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500);
  color: #4a2c00; padding: 16px 38px; font-size: 19px;
  border: 1.5px solid #d99400;
  box-shadow: 0 6px 0 rgba(150,84,0,.45), 0 12px 24px rgba(150,84,0,.22);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.btn3d-sun:active, .btn3d-green:active { box-shadow: 0 2px 0 rgba(150,84,0,.45), 0 6px 12px rgba(150,84,0,.2); }
.btn3d-sun:hover, .btn3d-green:hover { filter: brightness(1.06); }
.btn3d-ghost {
  background: #fffdf5; color: #8a4b00; border: 1.5px solid #e0a400;
  box-shadow: 0 5px 0 #f0d089, 0 10px 20px rgba(224,164,0,.16);
}
.btn3d-ghost:active { box-shadow: 0 1px 0 #f0d089; }
.btn3d-ghost:hover { background: #ffefc2; }

/* ---------- Hero V2 ---------- */
.pt-hero.v2 {
  background: linear-gradient(135deg, #fbf6ec 0%, #f6f0e2 55%, #eae0cb 100%);
  border: 2.5px solid #fff;
  border-radius: 24px; padding: 34px 38px;
  box-shadow: 0 10px 30px rgba(20,73,110,.16);
  position: relative; overflow: hidden;
}
.pt-hero.v2 h1 {
  font-size: 34px; color: #14496e; letter-spacing: 3px; white-space: nowrap;
  text-shadow: 0 3px 0 #eae0cb, 0 8px 18px rgba(20,73,110,.14);
}
.pt-hero.v2 .pt-hero-text { flex: 1; min-width: 0; }
.pt-hero.v2 .pt-hero-art { flex-shrink: 0; }
.pt-hero.v2 .pt-hero-sub {
  color: #14496e; font-weight: 800; font-size: 15px; letter-spacing: 3px;
  margin: 10px 0 4px;
}
.pt-hero.v2 p { color: #4c5964; margin: 8px 0 22px; font-size: 15px; line-height: 1.75; }
.pt-hero.v2 .pt-hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.pt-hero-art { position: relative; width: 240px; height: 185px; flex-shrink: 0; }
.hero-boat { width: 100%; height: 100%; animation: heroBoat 4s ease-in-out infinite; }
@keyframes heroBoat { 0%,100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-9px) rotate(1.2deg); } }

/* ---------- 统计胶囊 V2 ---------- */
.pt-stats.v2 { display: flex; gap: 12px; flex-wrap: wrap; }
.pt-stats.v2 .pt-stat-card {
  background: rgba(255,255,255,.85);
  border: 1.5px solid rgba(201,180,143,.6);
  border-radius: 999px; padding: 9px 20px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 12px rgba(20,73,110,.1);
}
.pt-stats.v2 .pt-stat-icon { font-size: 20px; display: inline-flex; color: #14496e; }
.pt-stat-num { font-size: 20px; font-weight: 800; color: #14496e; }
.pt-stat-lab { font-size: 13px; color: #5f6b78; font-weight: 600; }

/* ---------- 五大玩法卡片 ---------- */
.pt-modes {
  display: grid; grid-template-columns: repeat(3, 1fr); /* 6 张玩法卡 3x2 排布 */
  gap: 14px;
}
.pm-card {
  position: relative; overflow: visible;
  background: #fff; border-radius: 20px;
  padding: 22px 14px 16px; text-align: center; text-decoration: none;
  border: 2.5px solid #f6f0e2;
  box-shadow: 0 6px 0 #eae0cb, 0 14px 26px rgba(20,73,110,.12);
  transition: transform .12s, border-color .12s, box-shadow .12s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pm-card:hover { transform: translateY(-5px); border-color: #c9b48f; box-shadow: 0 10px 0 #eae0cb, 0 18px 30px rgba(20,73,110,.16); }
.pm-card:active { transform: translateY(1px); box-shadow: 0 3px 0 #eae0cb; }
.pm-ic {
  width: 56px; height: 56px; border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; margin-bottom: 9px;
  box-shadow: 0 4px 0 rgba(2,44,84,.18), inset 0 1px 0 rgba(255,255,255,.4);
}
.pm-blue   { background: linear-gradient(135deg, #3e9cc4, #1b5e8a); }
.pm-green  { background: linear-gradient(135deg, #4ade80, #1fa97f); }
.pm-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.pm-pink   { background: linear-gradient(135deg, #f472b6, #db2777); }
.pm-gold   { background: linear-gradient(135deg, #fbbf24, #d97706); }
.pm-cyan   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.pm-card b { font-size: 16.5px; font-weight: 900; color: #14496e; letter-spacing: 1px; }
.pm-card > i { font-style: normal; font-size: 12px; color: #5f6b78; line-height: 1.55; margin-top: 5px; min-height: 32px; }
.pm-card em { font-style: normal; font-size: 12px; color: #f59e0b; letter-spacing: 2.5px; margin-top: 5px; }
.pm-tag {
  position: absolute; top: -11px; right: -6px;
  background: linear-gradient(135deg, #fb923c, #f97316); color: #fff;
  font-size: 11px; font-weight: 800; padding: 3px 12px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(249,115,22,.4);
  transform: rotate(4deg); white-space: nowrap; font-style: normal;
}
.pm-tag-new { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 3px 8px rgba(124,58,237,.4); }

/* ---------- 通用卡片：深 → 白 ---------- */
.pt-card {
  background: rgba(255,255,255,.88);
  border: 1.5px solid rgba(201,180,143,.5);
  box-shadow: 0 4px 16px rgba(20,73,110,.08);
}
.pt-card-head h3 { color: #22303b; }
.pt-more { color: #14496e; }
.pt-rank-table td { border-bottom-color: rgba(201,180,143,.35); }
.pt-rank-no { color: #5f6b78; }
.pt-rank-no.top { color: #d97706; }
.pt-rank-name { color: #36424c; }
.pt-rank-num { color: #14496e; }
.pt-study-item { background: #fbf6ec; border: 1.5px solid #eae0cb; }
.pt-study-item .num { color: #14496e; }
.pt-study-item .lab { color: #5f6b78; }
.pt-study-user { color: #5f6b78; }
.pt-study-user b { color: #22303b; }
.pt-empty { color: #5f6b78; }
.pt-empty a { color: #14496e; }
.pt-text-pre { color: #36424c; }
.pt-page-head h2 { color: #22303b; }
.pt-cal-day { background: #fbf6ec; border-color: #eae0cb; }
.pt-avatar { box-shadow: 0 0 0 3px rgba(62,156,196,.35); }
.pt-foot { color: #5f6b78; border-top-color: rgba(201,180,143,.4); }

/* ---------- 手机端 ---------- */
@media (max-width: 900px) {
  .pt-hero.v2 .pt-hero-art { display: none; }
}
@media (max-width: 768px) {
  .pt-hero.v2 { padding: 24px 20px !important; }
  .pt-hero.v2 h1 { font-size: 24px !important; letter-spacing: 2px !important; white-space: normal !important; }
  .pt-hero.v2 p { font-size: 14px !important; }
  .pt-hero.v2 .pt-hero-btns .btn3d { padding: 12px 22px !important; font-size: 15px !important; }
  .btn3d-sun { padding: 14px 28px !important; font-size: 17px !important; }
  .pt-modes { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .pm-card { padding: 16px 10px 12px !important; }
  .pm-ic { width: 48px !important; height: 48px !important; font-size: 25px !important; }
  .pm-card b { font-size: 14.5px !important; }
  .pt-stats.v2 { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; }
  .pt-stats.v2 .pt-stat-card { padding: 8px 12px !important; }
}

/* ===== V2.1 首页大厅微调 ===== */
.pt-hero-note {
  margin-top: 14px; font-size: 13.5px; color: #1b5e8a;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.55); border: 1.5px dashed rgba(27,94,138,.30);
  padding: 6px 14px; border-radius: 999px;
}
.pt-hero-note::before { content: '🧭'; font-size: 14px; }

/* ===== V2.2 首页宝箱入口 ===== */
.pt-chest-entry {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #fcd34d; border-radius: 16px;
  padding: 12px 16px; margin-bottom: 14px;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(217,119,6,.18), 0 8px 20px rgba(245,158,11,.14);
  transition: transform .12s, box-shadow .12s;
}
.pt-chest-entry:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(217,119,6,.18), 0 12px 24px rgba(245,158,11,.22); }
.pt-chest-entry .pc-gift { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(180,83,9,.3)); }
.pt-chest-entry .pc-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pt-chest-entry .pc-tx b { color: #92400e; font-size: 15px; }
.pt-chest-entry .pc-tx i { color: #b45309; font-size: 12px; font-style: normal; opacity: .85; }
.pt-chest-entry .pc-go { color: #d97706; font-size: 13px; font-weight: 700; white-space: nowrap; }

/* ===== V2.2 会员中心换肤（压过页面内深色样式） ===== */
.pt-body .pi-card {
  background: #fff !important;
  border-radius: 20px !important;
  padding: 28px 24px 20px !important;
  box-shadow: 0 10px 34px rgba(20,73,110,.12), 0 2px 8px rgba(20,73,110,.06) !important;
  color: #22303b !important;
  border: 2px solid #f6f0e2;
}
.pt-body .pi-avatar { background: linear-gradient(135deg,#3e9cc4,#14496e) !important; border-color: #f6f0e2 !important; }
.pt-body .pi-sub { color: #5f6b78 !important; }
.pt-body .pi-item { border-bottom: 1px solid #ede3d2 !important; }
.pt-body .pi-item:last-child { border-bottom: none !important; }
.pt-body .pi-label { color: #5f6b78 !important; }
.pt-body .pi-val { color: #22303b !important; }
.pt-body .pi-val .muted { color: #5f6b78 !important; }
.pt-body .pi-thumb { background: #f7f2e7 !important; border: 1.5px dashed #d8cfc0; }
.pt-body .pi-logout {
  background: #fb7185 !important; border-radius: 14px !important;
  box-shadow: 0 4px 0 #e11d48; transition: transform .1s, box-shadow .1s;
}
.pt-body .pi-logout:hover { background: #f43f5e !important; }
.pt-body .pi-logout:active { transform: translateY(3px); box-shadow: 0 1px 0 #e11d48; }
.pt-body .pi-modal { background: rgba(34,48,59,.45) !important; }
.pt-body .pi-modal-box { background: #fff !important; color: #22303b !important; border-radius: 18px !important; box-shadow: 0 20px 50px rgba(20,73,110,.25) !important; }
.pt-body .pi-modal-box input { background: #faf6ee !important; border: 1.5px solid #ede3d2 !important; color: #22303b !important; border-radius: 10px !important; }
.pt-body .pi-modal-box input:focus { outline: none; border-color: #3e9cc4 !important; }
.pt-body .pi-cancel { background: #f7f2e7 !important; color: #4c5964 !important; border-radius: 10px !important; }
.pt-body .pi-ok { background: #14496e !important; color: #fff !important; border-radius: 10px !important; }

/* ============================================================
 * V2.3 首页视觉增强层 —— P0 可访问性 + P1 表现力（2026-10-05）
 * 追加于文件末尾，以级联覆盖方式生效，不改动既有结构与逻辑
 * ============================================================ */

/* ---------- 设计 Token：统一圆角/间距，供后续复用 ---------- */
:root {
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;
  --gap: 14px;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------- P0-1 对比度修复（满足 WCAG AA 4.5:1） ---------- */
.pm-card > i { color: #5f6b78; }     /* 原 #5f6b78 ≈2.7:1 → #5f6b78 ≈4.5:1 */
.pm-card em { color: #d97706; }      /* 星级加深，提升存在感 */

/* ---------- P0-2 键盘焦点环（全站可访问性） ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.pm-card:focus-visible,
.pt-nav a:focus-visible {
  outline: 3px solid #3e9cc4;
  outline-offset: 2px;
  border-radius: inherit;
}

/* ---------- P1-1 Hero 强化：与天空背景拉开明度差，突出 CTA ---------- */
.pt-hero.v2 {
  background: linear-gradient(135deg, #ffffff 0%, #eaf6ff 55%, #d6efff 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 14px 40px rgba(20,73,110, .22);
}
.pt-hero.v2 h1 {
  white-space: normal;               /* 修复 769–900px 区间 nowrap 溢出风险 */
  font-weight: 800;
  letter-spacing: 2px;
}
.pt-hero.v2 .pt-hero-sub { letter-spacing: 2px; }

/* ---------- P1-2 标题字重/字体统一（展示型圆体字栈） ---------- */
.pt-logo,
.pt-hero.v2 h1,
.pm-card b,
.pt-card-head h3 {
  font-family: var(--font-display);
}

/* ============================================================
 * V2.4 体验增强层 —— P2 入场错峰动效 + 暗色模式（2026-10-05）
 * 追加于文件末尾，以级联覆盖方式生效，不改动既有结构与 JS 逻辑
 * ============================================================ */

/* ---------- P2-1 入场错峰动效（淡入 + 上滑） ---------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 用 backwards 填充：延迟期间保持“隐藏态”，动画结束后归还元素常态，
   从而不阻塞 .pm-card 等组件的 :hover 位移变换 */
.pt-hero.v2,
.pt-chest-entry,
.pt-stats.v2 .pt-stat-card,
.pt-modes .pm-card,
.pt-main > .pt-card,
.pt-side-col > .pt-card {
  animation: cardIn .55s cubic-bezier(.22,.61,.36,1) backwards;
}

/* 错峰延迟：让内容按“英雄 -> 宝箱 -> 统计 -> 玩法 -> 卡片”顺序依次入场 */
.pt-hero.v2          { animation-duration: .6s; }
.pt-chest-entry       { animation-delay: .08s; }
.pt-stats.v2 .pt-stat-card:nth-child(1) { animation-delay: .12s; }
.pt-stats.v2 .pt-stat-card:nth-child(2) { animation-delay: .18s; }
.pt-stats.v2 .pt-stat-card:nth-child(3) { animation-delay: .24s; }
.pt-stats.v2 .pt-stat-card:nth-child(4) { animation-delay: .30s; }
.pt-stats.v2 .pt-stat-card:nth-child(5) { animation-delay: .36s; }
.pt-modes .pm-card:nth-child(1) { animation-delay: .20s; }
.pt-modes .pm-card:nth-child(2) { animation-delay: .26s; }
.pt-modes .pm-card:nth-child(3) { animation-delay: .32s; }
.pt-modes .pm-card:nth-child(4) { animation-delay: .38s; }
.pt-modes .pm-card:nth-child(5) { animation-delay: .44s; }
.pt-modes .pm-card:nth-child(6) { animation-delay: .50s; }
.pt-main > .pt-card:nth-child(1),
.pt-side-col > .pt-card:nth-child(1) { animation-delay: .34s; }
.pt-main > .pt-card:nth-child(2),
.pt-side-col > .pt-card:nth-child(2) { animation-delay: .40s; }
.pt-main > .pt-card:nth-child(3),
.pt-side-col > .pt-card:nth-child(3) { animation-delay: .46s; }
.pt-main > .pt-card:nth-child(4),
.pt-side-col > .pt-card:nth-child(4) { animation-delay: .52s; }

/* 无障碍：用户偏好减少动态时关闭入场动效 */
@media (prefers-reduced-motion: reduce) {
  .pt-hero.v2,
  .pt-chest-entry,
  .pt-stats.v2 .pt-stat-card,
  .pt-modes .pm-card,
  .pt-main > .pt-card,
  .pt-side-col > .pt-card {
    animation: none !important;
  }
}

/* ---------- P2-2 暗色模式（手动切换 + 首访跟随系统） ----------
 * 由 html.dark 类驱动：浅色为默认基底，深色仅在 <html class="dark"> 时生效。
 * 首访若用户未手动选择则按系统偏好；之后以用户手动选择（localStorage）为准。
 * 切换为轻微侵入：仅新增一个顶栏按钮 + 一小段脚本，不改任何既有结构/逻辑。 */

  html.dark body { background: #0b1220; }
  html.dark .portal-body {
    background: linear-gradient(180deg, #0b1220 0%, #0f1f33 45%, #11263f 100%);
    background-attachment: fixed;
  }
  html.dark .portal { color: #ede3d2; }

  html.dark .pt-top {
    background: rgba(11, 18, 32, .85);
    border-bottom: 1px solid rgba(110,124,136, .16);
  }
  html.dark .pt-logo { color: #f7f2e7; }
  html.dark .pt-search input {
    background: rgba(255, 255, 255, .07); color: #ede3d2;
    border: 1.5px solid rgba(110,124,136, .3);
  }
  html.dark .pt-user-btn { border-color: rgba(110,124,136, .35); color: #d8cfc0; background: transparent; }
  html.dark .pt-user-btn.primary { background: linear-gradient(180deg,#f0b429,#d99507 52%,#b87500); color: #3a2200; border-color: #8a5200; }
  html.dark .pt-user-btn.ghost { background: rgba(255, 255, 255, .06); }
  html.dark .pt-user-name { color: #c9b48f; }

  html.dark .pt-side {
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(110,124,136, .14);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  }
  html.dark .pt-side-title { color: #5f6b78; }
  html.dark .pt-nav a { color: #5f6b78; }
  html.dark .pt-nav a:hover { background: rgba(255, 255, 255, .06); color: #ede3d2; }
  html.dark .pt-nav a.active {
    background: linear-gradient(135deg, rgba(31,110,158, .22), rgba(20,73,110, .18));
    color: #c9b48f; box-shadow: inset 0 0 0 1.5px rgba(62,156,196, .45);
  }
  html.dark .pt-nav a.hot {
    background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(180, 83, 9, .16));
    color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35);
  }
  html.dark .pt-nav-sep { background: rgba(110,124,136, .16); }

  html.dark .pt-hero.v2 {
    background: linear-gradient(135deg, #0e3552 0%, #0e7490 55%, #155e75 100%);
    border: 1px solid rgba(62,156,196, .25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
  html.dark .pt-hero.v2 h1 { color: #fff; text-shadow: 0 4px 0 rgba(2, 44, 84, .5); }
  html.dark .pt-hero.v2 .pt-hero-sub { color: #eae0cb; }
  html.dark .pt-hero.v2 p { color: #eae0cb; }

  html.dark .pt-stats.v2 .pt-stat-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(110,124,136, .16);
  }
  html.dark .pt-stats.v2 .pt-stat-icon { color: #c9b48f; }
  html.dark .pt-stat-num { color: #c9b48f; }
  html.dark .pt-stat-lab { color: #5f6b78; }

  html.dark .pt-modes .pm-card {
    background: rgba(255, 255, 255, .05);
    border: 2.5px solid rgba(110,124,136, .16);
    box-shadow: 0 6px 0 rgba(110,124,136, .12), 0 14px 26px rgba(0, 0, 0, .3);
  }
  html.dark .pt-modes .pm-card:hover {
    border-color: rgba(62,156,196, .4);
    box-shadow: 0 10px 0 rgba(110,124,136, .12), 0 18px 30px rgba(0, 0, 0, .35);
  }
  html.dark .pm-card b { color: #f7f2e7; }
  html.dark .pm-card > i { color: #d8cfc0; }   /* 深色底上用更亮灰字，保证对比度 */
  html.dark .pm-card em { color: #fbbf24; }

  html.dark .pt-card { background: rgba(255, 255, 255, .05); border: 1.5px solid rgba(110,124,136, .16); }
  html.dark .pt-card-head h3 { color: #ede3d2; }
  html.dark .pt-card-head h3 .gi { color: #3e9cc4; }
  html.dark .pt-more { color: #3e9cc4; }

  html.dark .pt-rank-table td { border-bottom-color: rgba(110,124,136, .12); }
  html.dark .pt-rank-no { color: #5f6b78; }
  html.dark .pt-rank-no.top { color: #fbbf24; }
  html.dark .pt-rank-name { color: #ede3d2; }
  html.dark .pt-rank-num { color: #c9b48f; }

  html.dark .pt-study-item { background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(110,124,136, .16); }
  html.dark .pt-study-item .num { color: #c9b48f; }
  html.dark .pt-study-item .lab { color: #5f6b78; }
  html.dark .pt-study-user { color: #5f6b78; }
  html.dark .pt-study-user b { color: #ede3d2; }

  html.dark .pt-empty { color: #5f6b78; }
  html.dark .pt-empty a { color: #3e9cc4; }
  html.dark .pt-text-pre { color: #d8cfc0; }
  html.dark .pt-page-head h2 { color: #f7f2e7; }
  html.dark .pt-cal-day { background: rgba(255, 255, 255, .07); border-color: rgba(110,124,136, .14); }
  html.dark .pt-foot { color: #5f6b78; border-top-color: rgba(110,124,136, .12); }

  html.dark .pt-hero-note {
    color: #c9b48f; background: rgba(255, 255, 255, .06);
    border: 1.5px dashed rgba(62,156,196, .3);
  }
  html.dark .pt-chest-entry {
    background: linear-gradient(135deg, rgba(62,156,196, .12), rgba(20,73,110, .16));
    border: 2px solid rgba(62,156,196, .35);
    box-shadow: 0 4px 0 rgba(20,73,110, .25), 0 8px 20px rgba(0, 0, 0, .3);
  }
  html.dark .pt-chest-entry .pc-tx b { color: #f7f2e7; }
  html.dark .pt-chest-entry .pc-tx i { color: #c9b48f; }
  html.dark .pt-chest-entry .pc-go { color: #c9b48f; }

/* ---------- P2-2b 顶栏主题切换按钮 ---------- */
.pt-theme-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1.5px solid rgba(201,180,143, .6);
  background: rgba(255, 255, 255, .7);
  color: #1b5e8a;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(20,73,110, .1);
  transition: transform .12s, background .15s, border-color .15s;
  font-family: inherit;
}
.pt-theme-btn:hover { background: #fff; border-color: #3e9cc4; transform: translateY(-1px); }
.pt-theme-btn:active { transform: scale(.94); }
.pt-theme-btn:focus-visible { outline: 3px solid #3e9cc4; outline-offset: 2px; }
html.dark .pt-theme-btn {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(110,124,136, .4);
  color: #fbbf24;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
html.dark .pt-theme-btn:hover { background: rgba(255, 255, 255, .14); }

/* 主题切换平滑过渡（不影响入场动效的 transform/opacity） */
html.dark body, html.dark .portal-body, html.dark .pt-top,
html.dark .pt-card, html.dark .pt-side, html.dark .pt-hero.v2,
html.dark .pm-card, html.dark .pt-stats.v2 .pt-stat-card,
html.dark .pt-chest-entry, html.dark .pt-user-btn, html.dark .pt-search input {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* ==========================================================================
 * P3 全站统一设置中心
 * 入口：左侧栏底部（由 app.js 注入到 #pt-nav 之后，所有门户页自动生效）
 * 存储：localStorage['swz_settings']，并兼容迁移 swz_game_settings / wanabc-theme
 * 作用域变量：仅 --set-* 前缀，避免影响任何既有样式
 * ========================================================================== */
:root {
  --set-bg: #ffffff;
  --set-bg-soft: #faf6ee;
  --set-surface: rgba(20,73,110, .05);
  --set-surface-2: rgba(20,73,110, .1);
  --set-line: rgba(20,73,110, .16);
  --set-text: #22303b;
  --set-text-2: #4c5964;
  --set-text-3: #5f6b78;
  --set-accent: #14496e;
  --set-accent-soft: rgba(31,110,158, .12);
  --set-accent-line: rgba(62,156,196, .55);
  --set-on: #1fa97f;
  --set-shadow: 0 24px 60px rgba(2, 44, 84, .28);
}
html.dark {
  --set-bg: #101d2e;
  --set-bg-soft: rgba(255, 255, 255, .04);
  --set-surface: rgba(255, 255, 255, .05);
  --set-surface-2: rgba(255, 255, 255, .09);
  --set-line: rgba(110,124,136, .18);
  --set-text: #e6edf6;
  --set-text-2: #a6b6c9;
  --set-text-3: #6b7f96;
  --set-accent: #3e9cc4;
  --set-accent-soft: rgba(62,156,196, .16);
  --set-accent-line: rgba(62,156,196, .45);
  --set-on: #4ade80;
  --set-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

/* ---------- 侧栏入口 ---------- */
.pt-set-sep { height: 1px; background: var(--set-line); margin: 8px 4px; }
.pt-set-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--set-line);
  background: var(--set-surface);
  color: #000;
  font-size: 16px; font-weight: 600; text-decoration: none;
  cursor: pointer; width: 100%; text-align: left;
  font-family: inherit; transition: .15s;
}
.pt-set-entry:hover {
  background: var(--set-surface-2); color: #000;
  border-color: var(--set-accent-line);
}
.pt-set-entry:active { transform: translateY(1px); }
.pt-set-entry .pt-nav-icon { color: var(--set-accent); flex-shrink: 0; }
html.dark .pt-set-entry { color: #5f6b78; }
html.dark .pt-set-entry:hover { color: #c9b48f; }

/* ---------- 面板容器 ---------- */
.set-mask {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(34,48,59, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadeIn .16s ease;
}
.set-panel {
  width: min(96vw, 560px); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--set-bg); color: var(--set-text);
  border: 1px solid var(--set-line); border-radius: 18px;
  box-shadow: var(--set-shadow); overflow: hidden;
}
.set-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--set-line);
  flex-shrink: 0;
}
.set-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.set-sub { font-size: 12px; color: var(--set-text-3); margin-top: 3px; font-weight: 400; }
.set-close {
  width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--set-line); background: transparent;
  color: var(--set-text-2); font-size: 15px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.set-close:hover { background: var(--set-surface-2); color: var(--set-text); }

.set-tabs {
  display: flex; gap: 2px; padding: 0 18px; flex-shrink: 0;
  border-bottom: 1px solid var(--set-line); overflow-x: auto;
}
.set-tab {
  padding: 10px 13px; font-size: 14px; font-weight: 600;
  border: none; background: transparent; cursor: pointer;
  color: var(--set-text-3); border-bottom: 2.5px solid transparent;
  font-family: inherit; white-space: nowrap; transition: .15s;
}
.set-tab:hover { color: var(--set-text-2); }
.set-tab.on { color: var(--set-accent); border-bottom-color: var(--set-accent); }

.set-body { padding: 6px 18px 18px; overflow-y: auto; flex: 1; }
.set-sec { display: none; }
.set-sec.on { display: block; }
.set-hint {
  font-size: 12px; color: var(--set-text-3);
  margin: 12px 0 8px; line-height: 1.6;
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--set-line);
}
.set-row:last-child { border-bottom: none; }
.set-key { font-size: 14px; color: var(--set-text); flex: 1; min-width: 0; }
.set-key i {
  display: block; font-style: normal; font-size: 12px;
  color: var(--set-text-3); margin-top: 2px; line-height: 1.5;
}
.set-val { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.set-num { font-size: 13px; color: var(--set-text-2); min-width: 42px; text-align: right; }
.set-link { font-size: 13px; color: var(--set-text-3); }

/* ---------- 控件 ---------- */
.set-range {
  width: 120px; accent-color: var(--set-accent); cursor: pointer;
}
.set-select, .set-input {
  border: 1px solid var(--set-line); border-radius: 9px;
  background: var(--set-bg-soft); color: var(--set-text);
  padding: 7px 10px; font-size: 13px; font-family: inherit; cursor: pointer;
}
.set-select:focus, .set-input:focus { outline: 2px solid var(--set-accent-line); outline-offset: 1px; }
.set-seg { display: flex; gap: 0; border: 1px solid var(--set-line); border-radius: 9px; overflow: hidden; }
.set-seg button {
  padding: 7px 12px; font-size: 13px; font-family: inherit; cursor: pointer;
  border: none; background: transparent; color: var(--set-text-2); transition: .15s;
  border-right: 1px solid var(--set-line);
}
.set-seg button:last-child { border-right: none; }
.set-seg button:hover { background: var(--set-surface); }
.set-seg button.on { background: var(--set-accent-soft); color: var(--set-accent); font-weight: 600; }

.set-sw { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.set-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.set-sw i {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: var(--set-surface-2); border: 1px solid var(--set-line); transition: .18s;
}
.set-sw i::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: var(--set-text-3); left: 2px; top: 2px; transition: .18s;
}
.set-sw input:checked + i { background: var(--set-accent-soft); border-color: var(--set-accent-line); }
.set-sw input:checked + i::before { transform: translateX(20px); background: var(--set-accent); }

.set-btn {
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--set-line); background: var(--set-surface);
  color: var(--set-text); cursor: pointer; font-family: inherit; transition: .15s;
}
.set-btn:hover { background: var(--set-surface-2); border-color: var(--set-accent-line); }
.set-btn.primary { background: var(--set-accent); border-color: var(--set-accent); color: #fff; }
.set-btn.primary:hover { filter: brightness(1.08); }
.set-btn.danger { color: var(--set-accent); }

.set-acct {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0 14px;
}
.set-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--set-accent-soft); color: var(--set-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.set-acct-name { font-size: 15px; font-weight: 600; }
.set-acct-sub { font-size: 12px; color: var(--set-text-3); margin-top: 2px; }
.set-foot {
  padding: 12px 18px; border-top: 1px solid var(--set-line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--set-text-3);
}

/* ---------- 分组标题 / 色块 / 快捷键行 ---------- */
.set-grp {
  font-size: 12px; font-weight: 700; color: var(--set-accent);
  margin: 15px 0 2px; letter-spacing: .3px;
}
.set-grp:first-child { margin-top: 6px; }
/* 色板触发按钮：船体皮肤 / 炮台配色 / 帆面文字颜色统一使用（4×4 小弹窗由 JS 生成，内联样式） */
.sw-open { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border: 1px solid var(--set-line, #ede3d2); border-radius: 999px; background: var(--set-bg, #fff); color: var(--set-fg, #36424c); font-size: 13px; line-height: 1; cursor: pointer; transition: .15s; }
.sw-open:hover { border-color: #5f6b78; }
.sw-open:active { transform: scale(.97); }
.sw-open-dot { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1.5px rgba(34,48,59,.16); }
.sw-open-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-open-ar { color: #5f6b78; font-size: 10px; }
body[data-theme="night"] .sw-open, html.dark .sw-open { background: #22303b; border-color: #4c5964; color: #ede3d2; }
body[data-theme="night"] .sw-open-dot, html.dark .sw-open-dot { box-shadow: 0 0 0 1.5px rgba(237,227,210,.28); }
.set-swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.set-swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  border: 2px solid var(--set-line); padding: 0; transition: .15s;
}
.set-swatch:hover { transform: scale(1.12); }
.set-swatch.on { border-color: var(--set-accent); box-shadow: 0 0 0 2px var(--set-accent-soft); }
.set-kms { margin: 2px 0 0; }
.set-km {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed var(--set-line);
}
.set-km:last-child { border-bottom: none; }
.set-km-name { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--set-text); }
.set-km-name i {
  display: block; font-style: normal; font-weight: 400; font-size: 11px;
  color: var(--set-text-3); margin-top: 2px;
}
.set-km-key {
  flex: 0 0 auto; min-width: 96px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--set-line); background: var(--set-bg-soft);
  color: var(--set-text); font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: .15s;
}
.set-km-key:hover { border-color: var(--set-accent-line); color: var(--set-accent); }
.set-km-key.cap { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
html.dark .set-km-key.cap { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.set-tip {
  font-size: 12px; color: var(--set-text-3); min-height: 15px;
  padding: 3px 0 2px; text-align: right; line-height: 1.5;
}

@media (max-width: 560px) {
  .set-panel { max-height: 92vh; }
  .set-range { width: 96px; }
  .set-key { font-size: 13px; }
  .set-km-key { min-width: 82px; }
}

/* ---------- 学习偏好：隐藏音标 / 自动朗读由各页脚本读取 ---------- */
html.set-hide-ph .v-ph,
html.set-hide-ph .vc-ph,
html.set-hide-ph .vocab-ph,
html.set-hide-ph .ld-ph { display: none; }

/* ---------- 减少动效 / 界面密度 ---------- */
html.set-no-motion *, html.set-no-motion *::before, html.set-no-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html.set-dense .pt-card { padding: 13px; }
html.set-dense .pt-card-head { margin-bottom: 9px; }
html.set-dense .pt-body { gap: 9px; }
html.set-dense .book-grid { gap: 10px; }
html.set-comfy .pt-card { padding: 26px; }
html.set-comfy .pt-card-head { margin-bottom: 18px; }

/* ---------- 右上角「客服咨询」入口（悬停下拉客服二维码） ---------- */
.pt-kefu {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none; white-space: nowrap; flex-shrink: 0;
  border: 1.5px solid rgba(244,114,182,.55); border-radius: 999px;
  padding: 4px 12px 4px 5px;
  background: linear-gradient(135deg, #ffe3ef, #f6f0e2);
  transition: box-shadow .18s ease, transform .18s ease;
}
.pt-kefu:hover { box-shadow: 0 4px 14px rgba(219,39,119,.28); transform: translateY(-1px); }
.pt-kefu-avatar {
  width: 27px; height: 27px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #fff; box-shadow: 0 1px 4px rgba(20,73,110,.28);
}
.pt-kefu-avatar svg { display: block; width: 100%; height: 100%; }
.pt-kefu-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pt-kefu-txt { font-size: 13px; font-weight: 400; color: #db2777; letter-spacing: .5px; }
.pt-kefu-drop {
  position: absolute; top: calc(100% + 11px); right: 0; z-index: 95;
  width: 196px; padding: 12px 14px 10px; border-radius: 14px; text-align: center;
  background: #fff; border: 1.5px solid #eae0cb;
  box-shadow: 0 14px 34px rgba(20,73,110,.22);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.pt-kefu-drop::before {
  content: ''; position: absolute; top: -6px; right: 30px;
  width: 10px; height: 10px; background: #fff;
  border-left: 1.5px solid #eae0cb; border-top: 1.5px solid #eae0cb;
  transform: rotate(45deg);
}
.pt-kefu-drop-title { font-size: 13px; font-weight: 700; color: #0e3552; }
.pt-kefu-drop img {
  width: 164px; height: 164px; display: block; margin: 7px auto 4px;
  border-radius: 8px; object-fit: cover; background: #faf6ee;
}
.pt-kefu-drop-tip { font-size: 12px; color: #5f6b78; }
.pt-kefu:hover .pt-kefu-drop,
.pt-kefu.open .pt-kefu-drop { opacity: 1; visibility: visible; transform: translateY(0); }
html.dark .pt-kefu { border-color: rgba(244,63,94,.42); background: rgba(244,63,94,.12); }
html.dark .pt-kefu-txt { color: #fda4af; }
html.dark .pt-kefu-drop { background: #2b3843; border-color: #36424c; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
html.dark .pt-kefu-drop::before { background: #2b3843; border-color: #36424c; }
html.dark .pt-kefu-drop-title { color: #ede3d2; }
html.dark .pt-kefu-drop-tip { color: #5f6b78; }
@media (max-width: 560px) {
  .pt-kefu { padding: 4px 9px 4px 5px; }
  .pt-kefu-txt { font-size: 12px; }
  .pt-kefu-drop { right: -40px; }
  .pt-kefu-drop::before { right: 60px; }
}

/* ============ 全站公告跑马灯（顶栏下方，app.js 组件化注入） ============ */
.pt-notice-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 20px; overflow: hidden;
  background: linear-gradient(90deg, rgba(201,180,143,.18), rgba(253,224,71,.15));
  border-bottom: 1px solid rgba(110,124,136,.18);
}
.pt-notice-tag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: #1b5e8a; background: rgba(201,180,143,.3); border-radius: 999px; padding: 2px 12px;
}
.pt-notice-viewport { flex: 1; overflow: hidden; }
.pt-notice-track {
  display: inline-flex; align-items: center; white-space: nowrap; will-change: transform;
  animation: ptNoticeScroll 30s linear infinite;
}
.pt-notice-bar:hover .pt-notice-track { animation-play-state: paused; }
.pt-notice-group { display: inline-flex; align-items: center; }
.pt-notice-item { font-size: 13px; color: #0e3552; text-decoration: none; padding: 0 16px; }
a.pt-notice-item:hover { color: #1b5e8a; text-decoration: underline; }
.pt-notice-dot { color: rgba(27,94,138,.4); font-size: 12px; }
@keyframes ptNoticeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
html.dark .pt-notice-bar {
  background: linear-gradient(90deg, rgba(201,180,143,.08), rgba(253,224,71,.06));
  border-bottom-color: rgba(110,124,136,.12);
}
html.dark .pt-notice-tag { color: #c9b48f; background: rgba(201,180,143,.12); }
html.dark .pt-notice-item { color: #eae0cb; }
html.dark .pt-notice-dot { color: rgba(201,180,143,.35); }

/* 公告栏内嵌顶栏形态（2026-10-24）：位于搜索框与用户区之间，宽度自适应占满剩余空间 */
.pt-top .pt-search { flex: 0 1 460px; min-width: 180px; }   /* 固定基准宽，不与公告栏抢剩余空间（修「搜索」竖排换行） */
.pt-top .pt-user { flex-shrink: 0; white-space: nowrap; }   /* 用户区不换行 */
.pt-top .pt-install-btn { flex-shrink: 0; }
.pt-notice-bar.pt-notice-inline {
  flex: 1 1 0; min-width: 160px;
  padding: 0 14px; height: 38px;
  background: rgba(255,255,255,.6);
  border: 1.5px solid rgba(201,180,143,.45);
  border-bottom-color: rgba(201,180,143,.45);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(20,73,110,.07);
}
.pt-notice-inline .pt-notice-item { padding: 0 10px; }
html.dark .pt-notice-bar.pt-notice-inline {
  background: rgba(255,255,255,.06);
  border-color: rgba(110,124,136,.28);
  box-shadow: none;
}
/* 中等宽度起公告栏独占一行，避免挤压搜索框与用户区 */
@media (max-width: 1100px) {
  .pt-top { flex-wrap: wrap; }
  .pt-top .pt-search { flex: 0 1 460px; min-width: 200px; }
  .pt-notice-bar.pt-notice-inline { flex: 0 0 100%; min-width: 0; order: 9; }
}
@media (max-width: 768px) {
  .pt-notice-bar.pt-notice-inline { flex-basis: 100%; min-width: 0; order: 9; height: 34px; }
}

/* ============ 侧栏折叠（图标模式）：桌面宽度生效，状态由 app.js 管理 ============ */
@media (min-width: 901px) {
  .pt-side-toggle {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%); z-index: 30;
    width: 24px; height: 24px; padding: 0; cursor: pointer;
    border: 1.5px solid rgba(201,180,143,.55); border-radius: 50%;
    background: #fff; color: #1b5e8a; font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(20,73,110,.18);
  }
  .pt-side-toggle:hover { background: #f6f0e2; }
  body.pt-rail .pt-side { width: 62px; padding: 14px 6px; overflow: visible; }
  body.pt-rail .pt-side-title, body.pt-rail .pt-nav-txt,
  body.pt-rail .pt-nav-sep, body.pt-rail .pt-set-sep { display: none; }
  body.pt-rail .pt-nav a { justify-content: center; padding: 10px 0; position: relative; }
  body.pt-rail .pt-set-entry { justify-content: center; padding: 10px 0; position: relative; }
  body.pt-rail .pt-nav a:hover::after, body.pt-rail .pt-set-entry:hover::after {
    content: attr(data-name); position: absolute; left: calc(100% + 16px); top: 50%;
    transform: translateY(-50%); background: #0b1220; color: #fff;
    font-size: 12px; font-weight: 600; white-space: nowrap; padding: 6px 11px;
    border-radius: 8px; z-index: 99; pointer-events: none;
    box-shadow: 0 6px 18px rgba(20,73,110,.3);
  }
  html.dark .pt-side-toggle { background: #0b1220; color: #c9b48f; border-color: rgba(201,180,143,.35); }
  html.dark .pt-side-toggle:hover { background: #2b3843; }
}

/* ===== 前台导航图标支持图片 + 折叠态 tooltip 修复（2026-10-21） ===== */
.pt-nav-icon img { display: block; width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }
/* 折叠成图标模式时抬高侧栏层级，悬停提示不再被主内容卡片盖住 */
body.pt-rail .pt-side { z-index: 90; }

/* ===== 折叠按钮：折叠态右移出栏体 + 醒目配色（2026-10-21） ===== */
@media (min-width: 901px) {
  body.pt-rail .pt-side-toggle {
    right: -13px; /* 移出侧栏右缘，不再压住导航图标 */
    background: #14496e; color: #fff; border-color: #14496e;
    box-shadow: 0 2px 10px rgba(20,73,110,.45);
    font-size: 15px; font-weight: 700;
  }
  body.pt-rail .pt-side-toggle:hover { background: #1b5e8a; }
  html.dark body.pt-rail .pt-side-toggle { background: #1b5e8a; color: #fbf6ec; border-color: #3e9cc4; }
  html.dark body.pt-rail .pt-side-toggle:hover { background: #14496e; }
}
/* 云朵装饰动画会飞出右边界，裁掉避免页面出现横向滚动条（clip 不影响 sticky） */
.portal { overflow-x: clip; }

/* ---------- 顶部「安装」按钮（PWA 原生安装弹窗） ---------- */
.pt-install-btn { margin-left: 4px; flex-shrink: 0; }
.pt-install-btn.ready { animation: ptInstPulse 1.6s ease infinite; }
@keyframes ptInstPulse {
  0%, 100% { box-shadow: 0 3px 0 #0e3552; }
  50% { box-shadow: 0 3px 0 #0e3552, 0 0 0 6px rgba(62,156,196, .25); }
}
.pt-inst-body { padding: 4px 22px 8px; overflow-y: auto; }
.pt-inst-os {
  background: rgba(201,180,143, .12); border: 1.5px solid rgba(201,180,143, .35);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  font-size: 14px; color: #22303b; line-height: 1.55;
}
.pt-inst-os b { color: #1b5e8a; }
.pt-inst-os ol { margin: 6px 0 0; padding-left: 22px; }
.pt-inst-os li { margin: 2px 0; }
.pt-inst-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 1300; background: #14496e; color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(20,73,110, .35);
  animation: fadeIn .16s ease; max-width: 86vw; text-align: center;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .pt-inst-os { background: rgba(62,156,196, .1); border-color: rgba(62,156,196, .3); color: #ede3d2; }
  html:not(.light) .pt-inst-os b { color: #c9b48f; }
}
html.dark .pt-inst-os { background: rgba(62,156,196, .1); border-color: rgba(62,156,196, .3); color: #ede3d2; }
html.dark .pt-inst-os b { color: #c9b48f; }
html.dark .pt-install-btn { background: #14496e; box-shadow: 0 3px 0 #14496e; }
.pt-inst-warn { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .55); }
.pt-inst-warn b { color: #b45309; }
.pt-inst-note { margin: 4px 0 6px; font-size: 13px; color: #5f6b78; }
.pt-inst-os code {
  background: rgba(34,48,59, .08); border-radius: 5px; padding: 1px 6px;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
}
.pt-inst-copy { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pt-inst-copy-btn {
  background: #fff; border: 1.5px solid #f59e0b; color: #b45309; border-radius: 8px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.pt-inst-copy-btn:hover { background: #f59e0b; color: #fff; }
html.dark .pt-inst-warn { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .4); }
html.dark .pt-inst-warn b { color: #fcd34d; }
html.dark .pt-inst-note { color: #5f6b78; }
html.dark .pt-inst-os code { background: rgba(237,227,210, .12); color: #ede3d2; }
html.dark .pt-inst-copy-btn { background: rgba(34,48,59, .6); }
html.dark .pt-inst-copy-btn:hover { background: #f59e0b; color: #1f2937; }

/* ============================================================
 * 手机端形态（html.m-phone 由服务端按 UA 注入，桌面端一行都不生效）
 * 侧栏 → 抽屉；顶栏紧凑；内容全宽
 * ============================================================ */
.pt-menu-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: 1.5px solid rgba(201,180,143,.6); background: rgba(255,255,255,.85); color: #14496e;
  border-radius: 11px; font-size: 19px; cursor: pointer; font-family: inherit; }
.pt-drawer-mask { display: none; position: fixed; inset: 0; background: rgba(34,48,59,.42); z-index: 120; }
.pt-drawer-head { display: none; }
html.m-phone .pt-top { padding: 10px 12px; gap: 10px; }
html.m-phone .pt-menu-btn { display: inline-flex; }
html.m-phone .pt-notice-bar { display: none !important; }
html.m-phone .pt-search { flex: 1; min-width: 0; }
html.m-phone .pt-search input { width: 100%; min-width: 0; }
html.m-phone .pt-body { padding: 12px 10px calc(24px + env(safe-area-inset-bottom)); gap: 0; }
html.m-phone .pt-main { width: 100%; min-width: 0; }
html.m-phone .pt-side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 184px; max-width: 53vw;
  z-index: 130; margin: 0; border-radius: 0 18px 18px 0; align-self: auto;
  transform: translateX(-103%); transition: transform .26s ease;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  overflow-y: auto; padding: 14px 10px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 0 40px rgba(20,73,110,.35);
}
body.pt-drawer-open .pt-side { transform: none; }
body.pt-drawer-open .pt-drawer-mask { display: block; }
html.m-phone .pt-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 12px; }
html.m-phone .pt-drawer-head b { font-size: 16px; color: #14496e; }
html.m-phone .pt-drawer-head span { margin-left: auto; font-size: 24px; color: #5f6b78; cursor: pointer; padding: 0 8px; line-height: 1; }
/* 抽屉内导航项加大触控区 */
html.m-phone .pt-nav a { padding: 12px 12px; font-size: 16px; border-radius: 12px; }
/* 桌面侧栏折叠开关（‹/›）在抽屉形态中用不上 */
html.m-phone .pt-side-toggle { display: none !important; }
html.m-phone .pt-side-title { padding: 10px 12px 6px; }
/* 卡片类内容在手机端统一单列 */
@media (max-width: 560px) {
  html.m-phone .pt-cols { gap: 12px; }
}

/* ============================================================
 * 阶段B：重点页面移动精修（words / sentences / ladder / courses / footprint / member）
 * 仅 html.m-phone（服务端按手机 UA 注入）生效，桌面端一行都不生效
 * ============================================================ */
/* ---- 通用：卡片更紧凑、页头缩小、触控区加大 ---- */
html.m-phone .pt-card { padding: 14px; border-radius: 14px; }
html.m-phone .pt-card-head h3 { font-size: 15px; }
html.m-phone .pt-card-head { margin-bottom: 10px; }
html.m-phone .pt-main { gap: 12px; }
html.m-phone .pt-page-head h2 { font-size: 19px; }
html.m-phone .pt-page-head p { font-size: 12.5px; }
html.m-phone .loading { padding: 26px 0; font-size: 13.5px; }
/* ---- 手机顶栏瘦身：logo 只留图标、「桌面」安装按钮隐藏、用户按钮缩小，避免横向溢出 ---- */
html.m-phone .pt-logo-tx { display: none; }
html.m-phone .pt-install-btn { display: none; }
html.m-phone .pt-top { gap: 8px; }
html.m-phone .pt-user { gap: 6px; }
html.m-phone .pt-user-btn { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
html.m-phone .pt-top-avatar { width: 24px; height: 24px; margin-right: 2px; }
html.m-phone .pt-user-name { font-size: 13px; }
/* 手机端搜索框与搜索图标融合：图标按钮内嵌进输入框右端，视觉上是一个控件 */
html.m-phone .pt-search { position: relative; order: 0; flex-basis: auto; max-width: none; }
html.m-phone .pt-search input { padding-right: 38px; }
html.m-phone #pt-search-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; min-width: 0; margin: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; box-shadow: none; font-size: 0;
}
html.m-phone #pt-search-btn::after { content: '🔍'; font-size: 15px; line-height: 1; }
/* 聚焦搜索时顶栏其他元素让位、输入框拉满（经典移动端搜索模式） */
html.m-phone .pt-top.pt-searching .pt-logo,
html.m-phone .pt-top.pt-searching .pt-kefu { display: none; }
html.m-phone .pt-top.pt-searching .pt-search { max-width: none; }
/* 手机端顶栏用户区（会员头像 / 登录按钮）已于 2026-10-29 恢复显示，
   完整样式见文件末尾「手机顶栏会员头像入口」段落；
   这里只声明它在单行顶栏中不参与收缩、不换行（配合末尾 .pt-top{flex-wrap:nowrap}） */
html.m-phone .pt-user { flex: 0 0 auto; flex-wrap: nowrap; gap: 0; margin-left: 0; }
/* 手机端客服入口只留头像图标（原 99px 文本块会挤爆顶栏） */
html.m-phone .pt-kefu { padding: 4px 5px; gap: 0; }
html.m-phone .pt-kefu-txt { display: none; }
html.m-phone .pt-kefu-drop { right: -8px; }
html.m-phone .pt-kefu-drop::before { right: 24px; }

/* ---------- 手机端顶栏「一键分享」按钮（客服右侧）：分享登录用户的推广链接 ---------- */
.pt-share {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 37px; height: 37px; flex-shrink: 0; cursor: pointer; user-select: none;
  border: 1.5px solid rgba(201,180,143,.75); border-radius: 999px;
  background: linear-gradient(135deg, #f6f0e2, #ede9fe);
  transition: box-shadow .18s ease, transform .18s ease;
}
.pt-share:hover { box-shadow: 0 4px 14px rgba(20,73,110,.26); transform: translateY(-1px); }
.pt-share.loading { opacity: .6; pointer-events: none; }
.pt-share-ico { display: block; width: 19px; height: 19px; color: #14496e; }
.pt-share-ico svg { display: block; width: 100%; height: 100%; }
/* 聚焦搜索时与客服一同让位，输入框拉满 */
html.m-phone .pt-top.pt-searching .pt-share { display: none; }

/* ---- Tab 行（学段/版本/册/课程分类/会员中心）：横向滚动不换行 ---- */
html.m-phone .grade-tabs,
html.m-phone .stage-tabs,
html.m-phone .book-tabs,
html.m-phone .ver-tabs,
html.m-phone .cs-tabs,
html.m-phone .mc-tabs {
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin-bottom: 10px; padding-bottom: 2px;
}
html.m-phone .grade-tabs::-webkit-scrollbar,
html.m-phone .stage-tabs::-webkit-scrollbar,
html.m-phone .book-tabs::-webkit-scrollbar,
html.m-phone .ver-tabs::-webkit-scrollbar,
html.m-phone .cs-tabs::-webkit-scrollbar,
html.m-phone .mc-tabs::-webkit-scrollbar { display: none; }
html.m-phone .grade-tabs a,
html.m-phone .stage-tabs a,
html.m-phone .book-tabs a,
html.m-phone .ver-tabs a,
html.m-phone .cs-tab,
html.m-phone .mc-tab { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; }
html.m-phone .grade-tabs a { font-size: 15px; padding: 6px 14px; }
html.m-phone .stage-tabs a,
html.m-phone .book-tabs a,
html.m-phone .ver-tabs a { font-size: 13.5px; padding: 6px 13px; }
html.m-phone .cs-tab { font-size: 14.5px; padding: 8px 16px; }
html.m-phone .mc-tab { font-size: 15px; padding: 9px 16px; }

/* ---- 面包屑：允许换行、字号缩小 ---- */
html.m-phone #breadcrumb,
html.m-phone .pt-bc-row { font-size: 12.5px; }
html.m-phone #breadcrumb a { padding: 2px 0; }

/* ---- words / sentences：书架卡片两列 ---- */
html.m-phone .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html.m-phone .book-grid.unit-mode { grid-template-columns: 1fr; }
html.m-phone .book-card { margin-bottom: 0; border-radius: 14px; }
html.m-phone .book-cover { font-size: 34px; }
html.m-phone .book-cover.no-cover { font-size: 42px; }
html.m-phone .book-body { padding: 10px 11px; }
html.m-phone .book-title { font-size: 13px; margin-bottom: 4px; }
html.m-phone .book-meta { font-size: 11.5px; }
html.m-phone .book-cleared { font-size: 10.5px; }

/* ---- 单元词汇表封面：三列改两行、按钮加大触控区 ---- */
html.m-phone .book-cover.vocab { min-height: 236px; padding: 12px 12px 10px; }
html.m-phone .vocab-acts { top: 8px; right: 8px; gap: 5px; }
html.m-phone .vocab-btn { font-size: 12.5px; padding: 9px 13px; }
html.m-phone .vocab-list { margin-top: 42px; }
html.m-phone .vocab-list li { flex-wrap: wrap; row-gap: 2px; padding: 9px 0; }
html.m-phone .v-en { flex: 1 1 100%; font-size: 15.5px; }
html.m-phone .v-ph { flex: 0 1 auto; font-size: 13px; }
html.m-phone .v-cn { flex: 1 1 auto; font-size: 13.5px; }
html.m-phone .v-acts { gap: 6px; }
html.m-phone .v-spk { padding: 8px 10px; font-size: 15px; }
html.m-phone .v-fav { padding: 8px 10px; font-size: 16px; }
html.m-phone .vf-title { font-size: 15.5px; }
html.m-phone .vf-meta { font-size: 13px; }
html.m-phone .vocab-more { font-size: 12.5px; }

/* ---- sentences：单元句子面板上下堆叠、练这一单元大按钮 ---- */
html.m-phone .tb-sent { flex-direction: column; gap: 2px; font-size: 14px; padding: 9px 0; }
html.m-phone .tb-sent .en,
html.m-phone .tb-sent .cn { flex: 1 1 auto; }
html.m-phone .tb-acts { gap: 8px; margin-top: 12px; }
html.m-phone .tb-act { flex: 1 1 100%; padding: 14px 10px; font-size: 15px; }
html.m-phone .tb-panel { margin-top: 12px; padding-top: 12px; }
html.m-phone .tb-back { padding: 4px 0; }

/* ---- ladder：hero 堆叠、单元两列 ---- */
html.m-phone .ld-main { padding: 12px 12px 36px; }
html.m-phone .ld-hero { flex-direction: column; gap: 12px; margin-bottom: 12px; }
html.m-phone .ld-hero-l { padding: 14px 15px; }
html.m-phone .ld-hero-l h1 { font-size: 19px; }
html.m-phone .ld-hero-l p { font-size: 13px; }
html.m-phone .ld-hero-r { flex: 1 1 100%; }
html.m-phone .ld-prog-card { padding: 14px 15px; }
html.m-phone .ld-step { font-size: 12px; padding: 5px 9px; }
html.m-phone .ld-level-row { gap: 8px; }
html.m-phone .ld-lv { padding: 10px 14px; font-size: 13px; }
html.m-phone .ld-sec-t { font-size: 14.5px; margin: 18px 0 8px; }
html.m-phone .ld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html.m-phone .ld-card { padding: 12px 12px 10px; border-radius: 13px; }
html.m-phone .ld-u-n { font-size: 13.5px; }
html.m-phone .ld-u-s { font-size: 12px; }
html.m-phone .ld-u-btn { padding: 10px 0; font-size: 12.5px; }
html.m-phone .ld-go { padding: 14px; font-size: 15px; }

/* ---- courses：课程广场两列、详情 hero 堆叠、单元行触控 ---- */
html.m-phone .mc-wrap { padding: 4px 0 32px; }
html.m-phone .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html.m-phone .cs-card { border-radius: 12px; }
html.m-phone .cs-body { padding: 8px 10px 10px; }
html.m-phone .cs-name { font-size: 12.5px; }
html.m-phone .cs-desc { font-size: 11px; }
html.m-phone .cs-meta { font-size: 11px; }
html.m-phone .cs-hero { flex-direction: column; padding: 14px; gap: 14px; }
html.m-phone .cs-hero-cover { width: min(52%, 168px); margin: 0 auto; }
html.m-phone .cs-hero-name { font-size: 17px; }
html.m-phone .cs-hero-desc { font-size: 12.5px; }
html.m-phone .cs-hstat b { font-size: 18px; }
html.m-phone .cs-hero-stats { gap: 16px; }
html.m-phone .cs-hero-actions { width: 100%; }
html.m-phone .cs-btn { width: 100%; padding: 13px; font-size: 14.5px; }
html.m-phone .cs-unit { padding: 12px 13px; gap: 11px; }
html.m-phone .cs-unit-no { width: 32px; height: 32px; font-size: 13px; }
html.m-phone .cs-unit-name { font-size: 13.5px; }
html.m-phone .cs-unit-meta { font-size: 11.5px; }
html.m-phone .cs-unit-btn { padding: 10px 14px; font-size: 12.5px; }
html.m-phone .cs-back { padding: 4px 0; }

/* ---- footprint：条目纵向堆叠、操作按钮整行加大 ---- */
html.m-phone .fp-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px; }
html.m-phone .fp-item .fp-path { white-space: normal; font-size: 14.5px; }
html.m-phone .fp-item .fp-sub { font-size: 12px; gap: 8px; }
html.m-phone .fp-item .fp-prog { max-width: none; }
html.m-phone .fp-item .fp-ops { width: 100%; }
html.m-phone .fp-item .fp-ops a,
html.m-phone .fp-item .fp-ops button { flex: 1; text-align: center; padding: 11px 14px; font-size: 14px; }
html.m-phone .fp-tip { font-size: 11.5px; }

/* ---- member：会员卡片、表格横滚、表单通栏 ---- */
html.m-phone .mc-card { padding: 14px 14px 13px; border-radius: 14px; }
html.m-phone .mc-card h3 { font-size: 14.5px; }
html.m-phone .mc-vip { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; }
html.m-phone .mc-vip-badge { width: 46px; height: 46px; font-size: 20px; }
html.m-phone .mc-vip-name { font-size: 17px; }
html.m-phone .mc-vip-sub { font-size: 12px; }
html.m-phone .mc-ben-grid { grid-template-columns: 1fr 1fr; }
html.m-phone .mc-ben-item { font-size: 12.5px; padding: 8px 9px; }
html.m-phone .mc-stats { grid-template-columns: 1fr 1fr; }
html.m-phone .mc-stat { padding: 11px 8px; }
html.m-phone .mc-stat .n { font-size: 18px; }
html.m-phone .mc-table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.m-phone .mc-table th,
html.m-phone .mc-table td { white-space: nowrap; }
html.m-phone .mc-row { flex-wrap: wrap; }
html.m-phone .mc-ref-code { font-size: 22px; letter-spacing: 2px; padding: 12px; }
html.m-phone .mc-ref-url { font-size: 11.5px; }
html.m-phone .mc-up { flex-direction: column; align-items: stretch; gap: 10px; }
html.m-phone .mc-up .mc-btn { width: 100%; padding: 12px; }
html.m-phone .mc-btn { padding: 11px 15px; font-size: 13px; }
html.m-phone .rc-field { min-width: 0; flex: 1 1 100%; }
html.m-phone .rc-agree { font-size: 12px; }
html.m-phone .rc-agree button { padding: 9px 13px; }
html.m-phone .pi-card { padding: 18px 16px 15px; border-radius: 16px; }
html.m-phone .pi-head { gap: 12px; margin-bottom: 16px; }
html.m-phone .pi-avatar { width: 54px; height: 54px; font-size: 24px; }
html.m-phone .pi-name { font-size: 17px; }
html.m-phone .pi-sub { font-size: 11.5px; }
html.m-phone .pi-item { padding: 12px 2px; font-size: 13.5px; }
html.m-phone .pi-label .ic { font-size: 15px; }
html.m-phone .pi-logout { padding: 13px; font-size: 15px; }
html.m-phone .pi-modal-box { width: min(92%, 380px); padding: 20px 18px; }

/* ================= 阶段 C：其余栏目页移动精修 ================= */
/* 学习手账 /notebook：区块标题内的「去闯关练习」按钮加大触控区 */
html.m-phone .nb-sec { padding: 13px 13px; }
html.m-phone .nb-sec h3 { flex-wrap: wrap; gap: 6px; }
html.m-phone .nb-sec h3 .btn { min-height: 34px; padding: 7px 14px; font-size: 13px; display: inline-flex; align-items: center; }
html.m-phone .nb-item { flex-wrap: wrap; }
html.m-phone .nb-item .ops button { min-height: 32px; padding: 6px 11px; font-size: 12.5px; }
html.m-phone .nb-pager { gap: 8px; }
html.m-phone .nb-pager .mc-btn { min-height: 36px; padding: 9px 14px; }

/* 金币商城 /mall：分类芯片触控区加大、搜索框拉满 */
html.m-phone .ml-chip { min-height: 34px; padding: 7px 14px; font-size: 13px; display: inline-flex; align-items: center; }
html.m-phone .ml-bar { gap: 7px; }
html.m-phone .ml-search { max-width: none; min-width: 0; flex: 1 1 100%; }
html.m-phone .ml-head { flex-direction: column; align-items: flex-start; gap: 10px; }
html.m-phone .ml-order-top { font-size: 12px; }
html.m-phone .ml-goods img { width: 48px; height: 48px; }
html.m-phone .ml-ops .mc-btn { min-height: 34px; padding: 8px 13px; }
html.m-phone .ml-addr { flex-direction: column; gap: 6px; }

/* 角色页 /role：菜单卡两列，避免竖排大卡占满首屏 */
html.m-phone .ro-menu { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
html.m-phone .ro-mcard { padding: 12px 6px 10px; border-radius: 14px; }
html.m-phone .ro-mcard .ic { font-size: 22px; }
html.m-phone .ro-mcard .nm { font-size: 12.5px; margin-top: 5px; }
html.m-phone .ro-mcard .sub { font-size: 10.5px; margin-top: 2px; min-height: 14px; }
html.m-phone .ro-card { padding: 16px 14px 14px; border-radius: 16px; }
html.m-phone .ro-title { font-size: 14px; margin-bottom: 12px; }
html.m-phone .ro-gender button { min-height: 38px; padding: 8px 16px; }
html.m-phone .hl-medal { width: calc(33.333% - 6px); }
html.m-phone .hl-badge { font-size: 21px; }
html.m-phone .hl-nm { font-size: 12px; }
html.m-phone .hl-ds { font-size: 10.5px; }

/* 学习计划 /plan：步骤卡与目标行紧凑化 */
html.m-phone .pl-steps { gap: 8px; }
html.m-phone .pl-step { padding: 12px; font-size: 13px; }
html.m-phone .pl-tpl { padding: 12px; }
html.m-phone .pl-name { font-size: 16px; }

/* 收藏 /favorites：条目操作按钮触控区 */
html.m-phone .fav-item { flex-wrap: wrap; gap: 8px; }
html.m-phone .fav-item .ops button,
html.m-phone .fav-item .ops a { min-height: 32px; padding: 6px 11px; font-size: 12.5px; }

/* 教材 /textbooks：课文行触控区 */
html.m-phone .tb-lesson { min-height: 44px; }


/* ============================================================
 * 手机顶栏防换行（2026-10-28）
 * 登录后才会多出「客服 + 分享」两个按钮，加上搜索框按内容宽占位，
 * 窄屏（≈390px 及以下）总宽超出即把分享挤到第二行。
 * 做法：顶栏强制单行；固定控件不收缩；搜索框基准宽归 0，独占剩余空间。
 * ============================================================ */
html.m-phone .pt-top { flex-wrap: nowrap; }
html.m-phone .pt-menu-btn,
html.m-phone .pt-logo,
html.m-phone .pt-kefu,
html.m-phone .pt-share { flex: 0 0 auto; }
html.m-phone .pt-search { flex: 1 1 0%; min-width: 0; }
html.m-phone .pt-search input { min-width: 0; }
/* 极窄屏（≤360px）让 logo 退场，保证搜索框仍有可用宽度 */
@media (max-width: 360px) {
  html.m-phone .pt-logo { display: none; }
}

/* ============================================================
 * 手机顶栏「☰ 栏目导航」按钮 → 黄色醒目款（2026-10-28）
 * MARKER: pt-menu-btn-yellow-20261028
 * 原来是浅蓝描边 + 半透明白底，在浅色顶栏里几乎看不见。
 * 改：琥珀黄渐变 + 深褐描边/图标 + 立体投影 + 高光文字。
 * 放文件末尾并用 html.m-phone 提升优先级，确保压过第 1432 行的基础样式。
 * ============================================================ */
html.m-phone .pt-menu-btn {
  background: linear-gradient(180deg, #ffe86b 0%, #ffd21e 42%, #f5a600 100%);
  border: 1.5px solid #cf8400;
  color: #4a2c00;
  font-size: 20px;
  line-height: 1;
  padding-bottom: 1px;
  box-shadow: 0 3px 0 rgba(146, 82, 0, .38), 0 4px 12px rgba(245, 158, 11, .5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
html.m-phone .pt-menu-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(146, 82, 0, .38), 0 2px 6px rgba(245, 158, 11, .45);
  filter: brightness(.96);
}
/* 抽屉展开时按钮做「按下」态，示意当前归属 */
html.m-phone body.pt-drawer-open .pt-menu-btn {
  box-shadow: inset 0 2px 6px rgba(120, 63, 0, .4), 0 1px 0 rgba(146, 82, 0, .3);
}
html.dark.m-phone .pt-menu-btn {
  border-color: #b87400;
  box-shadow: 0 3px 0 rgba(120, 63, 0, .5), 0 4px 16px rgba(245, 158, 11, .55);
}

/* ============================================================
 * 全站页面左右留白收窄到 10px（2026-10-29）
 * MARKER: site-gutter-10px-20261029
 * 原来内容离窗口边缘 40px：.portal 20px + .pt-top/.pt-body 各自 20px。
 * 现在只由 .portal 提供 10px 的唯一基准线，内层容器的左右内边距归零，
 * 让顶栏 / 公告栏 / 内容区 / 卡片全部对齐同一条边。
 * 选择器用 `html ` 前缀抬高一级优先级，压过各页面内联 <style> 里
 * 诸如 `.pt-body{padding:18px clamp(14px,2vw,32px)}` 的覆盖写法；
 * 只覆盖 left/right，纵向内边距沿用原规则。
 * ============================================================ */
html .portal { padding-left: 10px; padding-right: 10px; }
html .pt-top,
html .pt-body,
html .pt-notice-bar { padding-left: 0; padding-right: 0; }
html.m-phone .pt-top,
html.m-phone .pt-body { padding-left: 0; padding-right: 0; }

/* ============================================================
 * PC 端搜索按钮融合进输入框（2026-10-29）
 * MARKER: pc-search-fused-20261029
 * 原本 PC 是「输入框 + 独立的蓝色『搜索』文字按钮」，与手机端（图标内嵌）不一致。
 * 这里把 PC 也改成输入框右端内嵌的放大镜图标，视觉上合成一个控件。
 * 只改表现层：button 仍是 .pt-search 的子元素，所以 dict-card.js 里
 * closest('#pt-search-btn') / closest('.pt-search') 的判断逻辑完全不受影响。
 * 选择器加 html 前缀抬优先级，压过 .pt-search .btn（0,2,0）与 156/466 行的 input padding；
 * 数值与手机端那条 html.m-phone 规则保持一致，避免两端出现两份不同的缩进。
 * ============================================================ */
html .pt-search { position: relative; }
html .pt-search input { padding-right: 38px; }
html #pt-search-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; min-width: 0; margin: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; box-shadow: none; font-size: 0;
  border-radius: 999px; cursor: pointer;
}
html #pt-search-btn::after { content: '🔍'; font-size: 15px; line-height: 1; }
html #pt-search-btn:hover { background: rgba(31,110,158, .14); }
html.dark #pt-search-btn:hover { background: rgba(201,180,143, .16); }

/* ============================================================
 * 顶栏 LOGO 向右缩进 10px（2026-10-29）
 * MARKER: logo-indent-10px-20261029
 * 只作用于顶栏里的 brand logo，不影响 login.html 居中那颗（那里是 .auth-box .pt-logo）。
 * 限定 html:not(.m-phone)：手机端顶栏宽度是算好的一行预算（见「顶栏防换行」那段），
 * 再加 10px 会压缩搜索框，所以手机端保持原样。
 * ============================================================ */
html:not(.m-phone) .pt-top .pt-logo { margin-left: 10px; }
/* ============================================================
 * 手机顶栏会员头像入口（2026-10-29）
 *   · 已登录：圆形头像胶囊（36×36 触控区 / 30px 图标），点击打开会员面板
 *             （金币、段位、会员到期、用户中心、套餐、退出登录）
 *   · ≥420px 才补显示昵称（普通 390~414 机型顶栏放不下文字）
 *   · 未登录：只留「登录」胶囊，隐藏「注册」（登录页内有注册 tab，功能不丢）
 *   · 聚焦搜索框时与 logo / 客服 / 分享一起让位，输入框拉满
 * ============================================================ */
html.m-phone .pt-user-name {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0; border-radius: 999px;
  background: linear-gradient(135deg, #f6f0e2, #ede9fe);
  border: 1.5px solid rgba(201,180,143,.75);
  box-shadow: 0 2px 8px rgba(20,73,110,.16);
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
html.m-phone .pt-user-name:active { transform: scale(.93); box-shadow: 0 1px 4px rgba(20,73,110,.2); }
html.m-phone .pt-top-avatar { width: 30px; height: 30px; margin-right: 0; font-size: 14px; }
/* 窄屏只留头像；≥420px 追加昵称并做单行截断 */
html.m-phone #pt-user-nm { display: none; }
@media (min-width: 420px) {
  html.m-phone .pt-user-name { min-width: 0; padding: 0 11px 0 4px; }
  html.m-phone .pt-top-avatar { width: 26px; height: 26px; margin-right: 4px; }
  html.m-phone #pt-user-nm {
    display: inline; max-width: 92px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px; font-weight: 700; color: #1b5e8a;
  }
}
/* 未登录：单按钮形态 */
html.m-phone .pt-user-btn {
  padding: 7px 13px; font-size: 13px; font-weight: 700; border-radius: 999px;
  border: 1.5px solid #d99400; color: #4a2c00; background: linear-gradient(180deg,#ffe270,#ffc93c 52%,#f7b500);
  box-shadow: 0 2px 0 rgba(150,84,0,.28);
}
html.m-phone .pt-user-btn.primary { display: none; }
/* 聚焦搜索时用户区让位（与 logo / 客服 / 分享一致） */
/* 让位改用 .pt-searching（2026-10-30）：见 app.js 搜索框 focus/blur；
   原 :focus-within 会在点会员头像时把头像自己隐藏，导致点击失效 */
html.m-phone .pt-top.pt-searching .pt-user { display: none; }
/* 深夜模式 */
html.dark.m-phone .pt-user-name {
  background: rgba(62,156,196,.14); border-color: rgba(201,180,143,.45);
  box-shadow: none;
}
html.dark.m-phone #pt-user-nm { color: #c9b48f; }
html.dark.m-phone .pt-user-btn {
  background: linear-gradient(180deg,#f0b429,#d99507 52%,#b87500); color: #3a2200; border-color: #8a5200;
}

/* ============================================================
 * 窄屏（<=900px）首屏主列横向撑满（2026-10-29）
 * MARKER: cols-stretch-narrow-20261029
 * 实测：390×844 手机首页主列 #pt-main-content 只有 239px，右侧空 131px，
 * 观感就是「右边留白太多、和左边不对称」。
 * 原因：.pt-cols 自带 align-items:flex-start（style.css:260）。窄屏时它被改成
 * flex-direction:column，此时交叉轴是「横向」，flex-start 让子列不再拉伸、
 * 退化成 fit-content；而兄弟 .pt-side-col 另有 width:100%!important 是满的，
 * 于是两列不对称、右边空一大块。
 * 改：窄屏下 cross-axis 恢复 stretch，并给子列兜一个 width:100%/min-width:0。
 * PC（>900px）仍是 row + flex-start（侧栏顶部对齐），不受影响。
 * ============================================================ */
@media (max-width: 900px) {
  html .pt-cols { align-items: stretch; }
  html .pt-cols > * { width: 100%; min-width: 0; }
}

/* ============================================================
 * 手机端英语阶梯：游戏中隐藏课堂进度 HUD（2026-10-29）
 * MARKER: cls-hud-hidden-phone-20261029
 * #cls-hud 由 game.js clsHud() 动态创建，fixed 居中于顶部，内含
 * 「L1 萌芽 · U4 颜色与外形 / 第 2/5 关 · 打字默写 / 1—5 节点 / 退出课堂」。
 * 手机宽度不够，整条被挤成多行竖排，挡视野又难读 —— 手机端整体隐藏。
 * 退出课堂入口不会丢：clsInit() 里的 clsTakeover() 已把左上角 #btn-quit
 * 与顶栏 #quit-course 改成「退出课堂」并跳 /ladder，二者都在 #cls-hud 之外。
 * 仅 html.m-phone（服务端按 UA 注入）生效，PC 保留原样。
 * !important 用于压过元素上内联的 display:flex。
 * ============================================================ */
html.m-phone #cls-hud { display: none !important; }

/* ---------- 航海日志 · 夜间（深海夜航） ---------- */
html.dark .portal-body { background: linear-gradient(180deg, #0e2333 0%, #12293b 60%, #16324a 100%); }
html.dark .portal, html.dark .pt-main { color: #eaf4fb; }
html.dark .pt-top { background: rgba(14,35,51,.92); border-bottom-color: rgba(234,244,251,.14); }
html.dark .pt-side { background: rgba(22,50,74,.82); border-color: rgba(234,244,251,.14); }
html.dark .pt-side-title, html.dark .pt-nav a { color: #cfe2ef; }
html.dark .pt-nav a:hover { background: rgba(234,244,251,.08); color: #eaf4fb; }
html.dark .pt-nav a.active { background: linear-gradient(135deg, rgba(62,156,196,.28), rgba(31,110,158,.2)); color: #eaf4fb; box-shadow: inset 0 0 0 1.5px rgba(62,156,196,.45); }
html.dark .pt-card, html.dark .pt-resume { background: rgba(22,50,74,.88); border-color: rgba(234,244,251,.12); color: #eaf4fb; }
html.dark .pt-card-head h3 { color: #eaf4fb; }
html.dark .pt-search input { background: rgba(14,35,51,.9); color: #eaf4fb; border-color: rgba(234,244,251,.2); }
html.dark .pt-user-name { color: #9fd0ec; }
html.dark .pt-logo { color: #eaf4fb; }

/* ===== 语义色 token（航海日志 · 第四轮） ===== */
:root {
  --coral-ink: #b8371f;
  --coral-mist: #ffece8;
  --kelp: #1fa97f;
  --kelp-ink: #0f7a5c;
  --kelp-mist: #e6f7f1;
  --amber-ink: #8a5a00;
  --amber-mist: #fff6e0;
}

/* ===== 语义徽章：珊瑚=待巩固/错题，琥珀=进行中/不熟悉，海藻绿=已掌握 ===== */
.swz-tag {
  display: inline-block; border-radius: 999px; padding: 1px 9px;
  font-size: 11px; font-weight: 700; line-height: 1.65; white-space: nowrap;
  border: 1px solid transparent; vertical-align: 1px;
}
.swz-tag.coral { background: var(--coral-mist); color: var(--coral-ink); border-color: rgba(255, 107, 87, .45); }
.swz-tag.amber { background: var(--amber-mist); color: var(--amber-ink); border-color: rgba(217, 119, 6, .40); }
.swz-tag.kelp  { background: var(--kelp-mist);  color: var(--kelp-ink);  border-color: rgba(31, 169, 127, .40); }

html.dark .swz-tag.coral { background: rgba(255, 107, 87, .16); color: #ff9c8c; border-color: rgba(255, 107, 87, .50); }
html.dark .swz-tag.amber { background: rgba(245, 158, 11, .16); color: #fbbf24; border-color: rgba(245, 158, 11, .45); }
html.dark .swz-tag.kelp  { background: rgba(31, 169, 127, .18); color: #5fd6ae; border-color: rgba(31, 169, 127, .45); }

/* ===== 第五轮：手机端顶栏 ☰ 裸图标 + 学习手账去图标 ===== */
/* ============================================================
 * 手机端顶栏 ☰：只留图标，去掉按钮底 / 描边 / 立体阴影（2026-11-08）
 * MARKER: pt-menu-btn-bare-20261108
 * 必须放在样式表末尾（或页面内联 <style> 末尾），按源码顺序压过
 * pt-menu-btn-yellow-20261028 的同优先级规则；dark 变体单独列出，
 * 保证优先级不低于原 html.dark.m-phone .pt-menu-btn 规则。
 * ============================================================ */
html.m-phone .pt-menu-btn,
html.dark.m-phone .pt-menu-btn {
  background: transparent; border: 0; border-radius: 0;
  box-shadow: none; text-shadow: none; filter: none;
  transform: none; transition: none; padding-bottom: 0;
  color: #14496e; font-size: 20px; line-height: 1;
}
html.dark.m-phone .pt-menu-btn { color: #f6f0e2; }
html.m-phone .pt-menu-btn:active,
html.dark.m-phone .pt-menu-btn:active,
html.m-phone body.pt-drawer-open .pt-menu-btn {
  background: transparent; box-shadow: none; filter: none;
  transform: none; color: #0c447c;
}
html.dark.m-phone .pt-menu-btn:active,
html.dark.m-phone body.pt-drawer-open .pt-menu-btn { color: #cfe3f7; }
/* 学习手账四宫格：去掉 ❌ / 🤔 图标，只留数字、标题与「去练习」 */
html.m-phone .pt-nb-cell .nb-ic { display: none !important; }
