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

:root {
  --sea-deep: #075985;
  --sea-mid: #0ea5e9;
  --sea-light: #7dd3fc;
  --sand: #fef3c7;
  --wood: #92400e;
  --wood-light: #b45309;
  --danger: #dc2626;
  --ok: #16a34a;
  --ink: #0f172a;
  --paper: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
}

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

body {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 40%, #7dd3fc 60%, #38bdf8 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); }
.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, .35);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(2, 132, 199, .45); }
.btn-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, .3);
}
.btn-ghost {
  background: #fff;
  color: var(--sea-deep);
  border: 1.5px solid #bae6fd;
}
.btn-ghost:hover { background: #f0f9ff; }
.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: #475569; 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(14, 165, 233, .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(2, 132, 199, .08);
  border: 1px solid rgba(186, 230, 253, .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(15, 23, 42, .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(22, 163, 74, .94); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .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: #64748b; 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: #e2e8f0;
}

/* 顶部栏 */
.pt-top {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(148,163,184,.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: #f1f5f9;
  letter-spacing: 1px; text-decoration: none; white-space: nowrap;
  text-shadow: 0 0 18px rgba(56,189,248,.35);
}
.pt-search {
  flex: 1; display: flex; gap: 8px; max-width: 460px;
}
.pt-search input {
  flex: 1; border: 1.5px solid rgba(148,163,184,.3); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; outline: none;
  background: rgba(255,255,255,.07); color: #e2e8f0; font-family: inherit;
}
.pt-search input::placeholder { color: #64748b; }
.pt-search input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.pt-search .btn { background: #0ea5e9; border: none; color: #fff; }
.pt-user { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.pt-user-btn {
  border: 1.5px solid rgba(148,163,184,.35); color: #cbd5e1;
  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: #38bdf8; color: #fff; }
.pt-user-btn.primary { background: linear-gradient(135deg, #0ea5e9, #0284c7); border-color: transparent; color: #fff; }
.pt-user-btn.ghost { background: rgba(255,255,255,.06); }
.pt-user-name { color: #7dd3fc; font-weight: 700; 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,#6d5bf0,#9d4edd); 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(148,163,184,.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: 12px; color: #64748b; 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: #94a3b8; font-size: 16px; text-decoration: none;
  font-weight: 600; transition: .15s;
}
.pt-nav a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.pt-nav a.active { background: linear-gradient(135deg, rgba(14,165,233,.22), rgba(2,132,199,.18)); color: #7dd3fc; box-shadow: inset 0 0 0 1px rgba(56,189,248,.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: 18px; 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, #0c4a6e 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(56,189,248,.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: #bae6fd; 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(125,211,252,.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(148,163,184,.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: #7dd3fc; }
.pt-stat-lab { font-size: 12px; color: #94a3b8; }

/* 卡片 */
.pt-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(148,163,184,.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: #e2e8f0; display: flex; align-items: center; gap: 8px; }
.pt-more { color: #38bdf8; 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: 400px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.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(148,163,184,.16);
  border-radius: 12px; padding: 14px 12px; text-align: center;
}
.pt-study-item .num { font-size: 20px; font-weight: 800; color: #7dd3fc; }
.pt-study-item .lab { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.pt-study-user { margin-top: 14px; font-size: 13px; color: #94a3b8; }
.pt-study-user b { color: #e2e8f0; }

/* 船长榜 */
.pt-rank-table { width: 100%; border-collapse: collapse; }
.pt-rank-table td { padding: 9px 6px; border-bottom: 1px solid rgba(148,163,184,.12); font-size: 14px; }
.pt-rank-table tr:last-child td { border-bottom: none; }
.pt-rank-no { width: 30px; font-weight: 800; color: #64748b; }
.pt-rank-no.top { color: #fbbf24; }
.pt-rank-name { color: #e2e8f0; font-weight: 600; }
.pt-rank-num { text-align: right; color: #7dd3fc; font-family: Consolas, monospace; }

/* 空状态 / 页头 */
.pt-empty { text-align: center; color: #94a3b8; font-size: 14px; padding: 24px 0; line-height: 1.8; }
.pt-empty a { color: #38bdf8; }
.pt-page-head h2 { font-size: 22px; color: #f1f5f9; }
.pt-page-head p { color: #94a3b8; 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(148,163,184,.14);
  position: relative;
}
.pt-cal-day.on { background: linear-gradient(135deg, #0ea5e9, #0284c7); border-color: #38bdf8; }
.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: #64748b; }

/* 会员中心 */
.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, #0ea5e9, #0369a1);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 3px rgba(56,189,248,.3);
}
.pt-member-name { font-size: 20px; font-weight: 800; color: #f1f5f9; }
.pt-member-sub { font-size: 13px; color: #94a3b8; margin-top: 3px; }
.pt-sec-title { font-size: 15px; color: #e2e8f0; 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: #cbd5e1; line-height: 1.9;
}

/* 页脚 */
.pt-foot {
  text-align: center; color: #475569; font-size: 12px;
  padding: 18px 20px 26px; border-top: 1px solid rgba(148,163,184,.12);
}

/* 页脚合规链接（隐私政策 / 用户协议） */
.ft-links { margin-top: 6px; font-size: 12px; }
.ft-links a { color: #64748b; text-decoration: none; margin: 0 6px; }
.ft-links a:hover { color: #0284c7; text-decoration: underline; }
.ft-links .ft-dot { color: #cbd5e1; margin: 0 2px; }
html.dark .ft-links a { color: #94a3b8; }
html.dark .ft-links a:hover { color: #7dd3fc; }
html.dark .ft-links .ft-dot { color: #475569; }

/* 弹窗注册协议提示 */
.am-agree { margin-top: 8px; font-size: 12px; color: #64748b; text-align: center; line-height: 1.6; }
.am-agree a { color: #0284c7; text-decoration: none; }
.am-agree a:hover { text-decoration: underline; }
html.dark .am-agree { color: #94a3b8; }
html.dark .am-agree a { color: #7dd3fc; }

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

/* ============ 全局登录/注册弹窗（auth-modal） ============ */
.auth-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(2, 20, 35, .62);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-modal {
  background: #fff; border-radius: 22px; padding: 30px 32px;
  width: min(94vw, 400px); box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  position: relative; max-height: 92vh; overflow: auto;
}
.am-close {
  position: absolute; top: 12px; right: 14px;
  border: none; background: transparent; font-size: 20px;
  cursor: pointer; color: #94a3b8; line-height: 1; padding: 4px;
}
.am-close:hover { color: #475569; }
.am-head { text-align: center; font-size: 21px; font-weight: 800; color: #0c4a6e; }
.am-sub { text-align: center; color: #64748b; font-size: 13px; margin: 4px 0 18px; }
.am-tabs { display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.am-tab {
  flex: 1; border: none; background: transparent; padding: 9px 0;
  font-size: 15px; font-weight: 700; color: #64748b; cursor: pointer;
  border-radius: 9px; font-family: inherit; transition: .15s;
}
.am-tab.on { background: #fff; color: #0c4a6e; box-shadow: 0 2px 8px rgba(2,132,199,.15); }
.am-form .am-field { margin-bottom: 13px; }
.am-form label { font-size: 13px; color: #334155; display: block; margin-bottom: 5px; }
.am-form input {
  width: 100%; box-sizing: border-box; padding: 11px 13px;
  border: 1px solid #cbd5e1; border-radius: 11px;
  font-size: 15px; outline: none; background: #f8fafc; font-family: inherit;
}
.am-form input:focus { border-color: #0284c7; background: #fff; }
.am-submit { width: 100%; margin-top: 6px; }
.am-err { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }
.am-tip { color: #94a3b8; font-size: 12px; text-align: center; margin-top: 14px; line-height: 1.6; }
/* 导航分隔（固定功能入口与管理栏目之间） */
.pt-nav-sep { height: 1px; background: rgba(186,230,253,.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: #64748b; }
.pg-size { padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; 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: #0284c7; font-size: 18px; }

/* ---------- 全局：深色 → 阳光天空 ---------- */
.portal-body {
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 30%, #f0f9ff 55%, #7dd3fc 100%);
  background-attachment: fixed;
}
.portal { color: #0f172a; }

/* 天空装饰云 */
.sky-deco { position: relative; height: 0; z-index: 1; }
.sky-deco .cloud { position: absolute; width: 92px; animation: cloudDrift linear infinite; }
.sky-deco .c1 { top: 74px; left: 6%;  animation-duration: 70s; }
.sky-deco .c2 { top: 150px; left: 58%; animation-duration: 95s; animation-delay: -40s; width: 70px; }
.sky-deco .c3 { top: 46px; left: 80%;  animation-duration: 85s; animation-delay: -60s; width: 56px; }
@keyframes cloudDrift { from { transform: translateX(-120px); } to { transform: translateX(110vw); } }

/* ---------- 顶部栏 ---------- */
.pt-top {
  background: rgba(255,255,255,.72);
  border-bottom: 1.5px solid rgba(125,211,252,.55);
  backdrop-filter: blur(8px);
}
.pt-logo { color: #075985; 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(7,89,133,.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: #0f172a;
  border: 2px solid #bae6fd; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(2,132,199,.08);
}
.pt-search input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.pt-search .btn { border-radius: 999px; margin-left: 8px; }
.pt-install-btn {
  background: #075985; color: #fff; border: none; border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 0 #0c4a6e; font-family: inherit;
}
.pt-user-btn { border-color: #7dd3fc; color: #0369a1; background: rgba(255,255,255,.7); }
.pt-user-btn:hover { border-color: #0284c7; color: #075985; background: #fff; }
.pt-user-btn.primary { background: linear-gradient(135deg, #38bdf8, #0284c7); color: #fff; }
.pt-user-btn.ghost { background: rgba(255,255,255,.5); }
.pt-user-name { color: #0369a1; }

/* ---------- 左侧导航 ---------- */
.pt-side {
  background: rgba(255,255,255,.8);
  border: 1.5px solid rgba(125,211,252,.5);
  box-shadow: 0 4px 16px rgba(2,132,199,.08);
}
.pt-side-title { color: #0284c7; }
.pt-nav a { color: #475569; }
.pt-nav a:hover { background: rgba(125,211,252,.18); color: #075985; }
.pt-nav a.active {
  background: linear-gradient(135deg, rgba(56,189,248,.2), rgba(2,132,199,.14));
  color: #0369a1; box-shadow: inset 0 0 0 1.5px rgba(56,189,248,.45);
}
.pt-nav a.hot {
  background: linear-gradient(135deg, rgba(251,191,36,.3), rgba(180,83,9,.14));
  color: #b45309; box-shadow: inset 0 0 0 1.5px rgba(251,191,36,.6);
}
.pt-nav-sep { background: rgba(125,211,252,.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 {
  background: linear-gradient(180deg, #fcd34d, #fbbf24);
  color: #78350f; padding: 16px 38px; font-size: 19px;
  box-shadow: 0 6px 0 #b45309, 0 12px 24px rgba(180,83,9,.3);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.btn3d-sun:active { box-shadow: 0 2px 0 #b45309, 0 6px 12px rgba(180,83,9,.25); }
.btn3d-sun:hover { filter: brightness(1.06); }
.btn3d-ghost {
  background: #fff; color: #0369a1;
  box-shadow: 0 5px 0 #bae6fd, 0 10px 20px rgba(2,132,199,.14);
}
.btn3d-ghost:active { box-shadow: 0 1px 0 #bae6fd; }
.btn3d-ghost:hover { background: #f0f9ff; }
.btn3d-green {
  background: linear-gradient(180deg, #4ade80, #22c55e); color: #14532d;
  box-shadow: 0 5px 0 #15803d, 0 10px 20px rgba(21,128,61,.25);
}

/* ---------- Hero V2 ---------- */
.pt-hero.v2 {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 55%, #bae6fd 100%);
  border: 2.5px solid #fff;
  border-radius: 24px; padding: 34px 38px;
  box-shadow: 0 10px 30px rgba(2,132,199,.16);
  position: relative; overflow: hidden;
}
.pt-hero.v2 h1 {
  font-size: 34px; color: #075985; letter-spacing: 3px; white-space: nowrap;
  text-shadow: 0 3px 0 #bae6fd, 0 8px 18px rgba(7,89,133,.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: #0284c7; font-weight: 800; font-size: 15px; letter-spacing: 3px;
  margin: 10px 0 4px;
}
.pt-hero.v2 p { color: #475569; 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(125,211,252,.6);
  border-radius: 999px; padding: 9px 20px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 12px rgba(2,132,199,.1);
}
.pt-stats.v2 .pt-stat-icon { font-size: 20px; display: inline-flex; color: #0284c7; }
.pt-stat-num { font-size: 20px; font-weight: 800; color: #075985; }
.pt-stat-lab { font-size: 13px; color: #64748b; 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 #e0f2fe;
  box-shadow: 0 6px 0 #bae6fd, 0 14px 26px rgba(2,132,199,.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: #7dd3fc; box-shadow: 0 10px 0 #bae6fd, 0 18px 30px rgba(2,132,199,.16); }
.pm-card:active { transform: translateY(1px); box-shadow: 0 3px 0 #bae6fd; }
.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, #38bdf8, #0369a1); }
.pm-green  { background: linear-gradient(135deg, #4ade80, #16a34a); }
.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: #075985; letter-spacing: 1px; }
.pm-card > i { font-style: normal; font-size: 12px; color: #94a3b8; 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(125,211,252,.5);
  box-shadow: 0 4px 16px rgba(2,132,199,.08);
}
.pt-card-head h3 { color: #0f172a; }
.pt-more { color: #0284c7; }
.pt-rank-table td { border-bottom-color: rgba(125,211,252,.35); }
.pt-rank-no { color: #94a3b8; }
.pt-rank-no.top { color: #d97706; }
.pt-rank-name { color: #334155; }
.pt-rank-num { color: #0284c7; }
.pt-study-item { background: #f0f9ff; border: 1.5px solid #bae6fd; }
.pt-study-item .num { color: #0284c7; }
.pt-study-item .lab { color: #64748b; }
.pt-study-user { color: #64748b; }
.pt-study-user b { color: #0f172a; }
.pt-empty { color: #64748b; }
.pt-empty a { color: #0284c7; }
.pt-text-pre { color: #334155; }
.pt-page-head h2 { color: #0f172a; }
.pt-cal-day { background: #f0f9ff; border-color: #bae6fd; }
.pt-avatar { box-shadow: 0 0 0 3px rgba(56,189,248,.35); }
.pt-foot { color: #64748b; border-top-color: rgba(125,211,252,.4); }

/* ---------- 手机端 ---------- */
@media (max-width: 900px) {
  .pt-hero.v2 .pt-hero-art { display: none; }
}
@media (max-width: 768px) {
  .sky-deco .cloud { width: 60px !important; }
  .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: #0369a1;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.55); border: 1.5px dashed rgba(3,105,161,.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(2,132,199,.12), 0 2px 8px rgba(2,132,199,.06) !important;
  color: #0f172a !important;
  border: 2px solid #e0f2fe;
}
.pt-body .pi-avatar { background: linear-gradient(135deg,#38bdf8,#0284c7) !important; border-color: #e0f2fe !important; }
.pt-body .pi-sub { color: #64748b !important; }
.pt-body .pi-item { border-bottom: 1px solid #e2e8f0 !important; }
.pt-body .pi-item:last-child { border-bottom: none !important; }
.pt-body .pi-label { color: #64748b !important; }
.pt-body .pi-val { color: #0f172a !important; }
.pt-body .pi-val .muted { color: #94a3b8 !important; }
.pt-body .pi-thumb { background: #f1f5f9 !important; border: 1.5px dashed #cbd5e1; }
.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(15,23,42,.45) !important; }
.pt-body .pi-modal-box { background: #fff !important; color: #0f172a !important; border-radius: 18px !important; box-shadow: 0 20px 50px rgba(2,132,199,.25) !important; }
.pt-body .pi-modal-box input { background: #f8fafc !important; border: 1.5px solid #e2e8f0 !important; color: #0f172a !important; border-radius: 10px !important; }
.pt-body .pi-modal-box input:focus { outline: none; border-color: #38bdf8 !important; }
.pt-body .pi-cancel { background: #f1f5f9 !important; color: #475569 !important; border-radius: 10px !important; }
.pt-body .pi-ok { background: #0284c7 !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: #64748b; }     /* 原 #94a3b8 ≈2.7:1 → #64748b ≈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 #38bdf8;
  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(2, 132, 199, .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: #e2e8f0; }

  html.dark .pt-top {
    background: rgba(11, 18, 32, .85);
    border-bottom: 1px solid rgba(148, 163, 184, .16);
  }
  html.dark .pt-logo { color: #f1f5f9; }
  html.dark .pt-search input {
    background: rgba(255, 255, 255, .07); color: #e2e8f0;
    border: 1.5px solid rgba(148, 163, 184, .3);
  }
  html.dark .pt-user-btn { border-color: rgba(148, 163, 184, .35); color: #cbd5e1; background: transparent; }
  html.dark .pt-user-btn.primary { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
  html.dark .pt-user-btn.ghost { background: rgba(255, 255, 255, .06); }
  html.dark .pt-user-name { color: #7dd3fc; }

  html.dark .pt-side {
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(148, 163, 184, .14);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  }
  html.dark .pt-side-title { color: #64748b; }
  html.dark .pt-nav a { color: #94a3b8; }
  html.dark .pt-nav a:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
  html.dark .pt-nav a.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, .22), rgba(2, 132, 199, .18));
    color: #7dd3fc; box-shadow: inset 0 0 0 1.5px rgba(56, 189, 248, .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(148, 163, 184, .16); }

  html.dark .pt-hero.v2 {
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 55%, #155e75 100%);
    border: 1px solid rgba(56, 189, 248, .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: #bae6fd; }
  html.dark .pt-hero.v2 p { color: #bae6fd; }

  html.dark .pt-stats.v2 .pt-stat-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(148, 163, 184, .16);
  }
  html.dark .pt-stats.v2 .pt-stat-icon { color: #7dd3fc; }
  html.dark .pt-stat-num { color: #7dd3fc; }
  html.dark .pt-stat-lab { color: #94a3b8; }

  html.dark .pt-modes .pm-card {
    background: rgba(255, 255, 255, .05);
    border: 2.5px solid rgba(148, 163, 184, .16);
    box-shadow: 0 6px 0 rgba(148, 163, 184, .12), 0 14px 26px rgba(0, 0, 0, .3);
  }
  html.dark .pt-modes .pm-card:hover {
    border-color: rgba(56, 189, 248, .4);
    box-shadow: 0 10px 0 rgba(148, 163, 184, .12), 0 18px 30px rgba(0, 0, 0, .35);
  }
  html.dark .pm-card b { color: #f1f5f9; }
  html.dark .pm-card > i { color: #cbd5e1; }   /* 深色底上用更亮灰字，保证对比度 */
  html.dark .pm-card em { color: #fbbf24; }

  html.dark .pt-card { background: rgba(255, 255, 255, .05); border: 1.5px solid rgba(148, 163, 184, .16); }
  html.dark .pt-card-head h3 { color: #e2e8f0; }
  html.dark .pt-card-head h3 .gi { color: #38bdf8; }
  html.dark .pt-more { color: #38bdf8; }

  html.dark .pt-rank-table td { border-bottom-color: rgba(148, 163, 184, .12); }
  html.dark .pt-rank-no { color: #64748b; }
  html.dark .pt-rank-no.top { color: #fbbf24; }
  html.dark .pt-rank-name { color: #e2e8f0; }
  html.dark .pt-rank-num { color: #7dd3fc; }

  html.dark .pt-study-item { background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(148, 163, 184, .16); }
  html.dark .pt-study-item .num { color: #7dd3fc; }
  html.dark .pt-study-item .lab { color: #94a3b8; }
  html.dark .pt-study-user { color: #94a3b8; }
  html.dark .pt-study-user b { color: #e2e8f0; }

  html.dark .pt-empty { color: #94a3b8; }
  html.dark .pt-empty a { color: #38bdf8; }
  html.dark .pt-text-pre { color: #cbd5e1; }
  html.dark .pt-page-head h2 { color: #f1f5f9; }
  html.dark .pt-cal-day { background: rgba(255, 255, 255, .07); border-color: rgba(148, 163, 184, .14); }
  html.dark .pt-foot { color: #64748b; border-top-color: rgba(148, 163, 184, .12); }

  html.dark .pt-hero-note {
    color: #7dd3fc; background: rgba(255, 255, 255, .06);
    border: 1.5px dashed rgba(56, 189, 248, .3);
  }
  html.dark .pt-chest-entry {
    background: linear-gradient(135deg, rgba(56, 189, 248, .12), rgba(2, 132, 199, .16));
    border: 2px solid rgba(56, 189, 248, .35);
    box-shadow: 0 4px 0 rgba(2, 132, 199, .25), 0 8px 20px rgba(0, 0, 0, .3);
  }
  html.dark .pt-chest-entry .pc-tx b { color: #f1f5f9; }
  html.dark .pt-chest-entry .pc-tx i { color: #7dd3fc; }
  html.dark .pt-chest-entry .pc-go { color: #7dd3fc; }

/* ---------- P2-2b 顶栏主题切换按钮 ---------- */
.pt-theme-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1.5px solid rgba(125, 211, 252, .6);
  background: rgba(255, 255, 255, .7);
  color: #0369a1;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(2, 132, 199, .1);
  transition: transform .12s, background .15s, border-color .15s;
  font-family: inherit;
}
.pt-theme-btn:hover { background: #fff; border-color: #38bdf8; transform: translateY(-1px); }
.pt-theme-btn:active { transform: scale(.94); }
.pt-theme-btn:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; }
html.dark .pt-theme-btn {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(148, 163, 184, .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: #f8fafc;
  --set-surface: rgba(2, 132, 199, .05);
  --set-surface-2: rgba(2, 132, 199, .1);
  --set-line: rgba(2, 132, 199, .16);
  --set-text: #0f172a;
  --set-text-2: #475569;
  --set-text-3: #94a3b8;
  --set-accent: #0284c7;
  --set-accent-soft: rgba(14, 165, 233, .12);
  --set-accent-line: rgba(56, 189, 248, .55);
  --set-on: #16a34a;
  --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(148, 163, 184, .18);
  --set-text: #e6edf6;
  --set-text-2: #a6b6c9;
  --set-text-3: #6b7f96;
  --set-accent: #38bdf8;
  --set-accent-soft: rgba(56, 189, 248, .16);
  --set-accent-line: rgba(56, 189, 248, .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: var(--set-text-2);
  font-size: 15px; 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: var(--set-accent);
  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: #94a3b8; }
html.dark .pt-set-entry:hover { color: #7dd3fc; }

/* ---------- 面板容器 ---------- */
.set-mask {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, .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; }
.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, #e0f2fe);
  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(2,132,199,.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: 700; 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 #bae6fd;
  box-shadow: 0 14px 34px rgba(2,132,199,.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 #bae6fd; border-top: 1.5px solid #bae6fd;
  transform: rotate(45deg);
}
.pt-kefu-drop-title { font-size: 13px; font-weight: 700; color: #0c4a6e; }
.pt-kefu-drop img {
  width: 164px; height: 164px; display: block; margin: 7px auto 4px;
  border-radius: 8px; object-fit: cover; background: #f8fafc;
}
.pt-kefu-drop-tip { font-size: 12px; color: #64748b; }
.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: #1e293b; border-color: #334155; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
html.dark .pt-kefu-drop::before { background: #1e293b; border-color: #334155; }
html.dark .pt-kefu-drop-title { color: #e2e8f0; }
html.dark .pt-kefu-drop-tip { color: #94a3b8; }
@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(125,211,252,.18), rgba(253,224,71,.15));
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.pt-notice-tag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: #0369a1; background: rgba(125,211,252,.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: #0c4a6e; text-decoration: none; padding: 0 16px; }
a.pt-notice-item:hover { color: #0369a1; text-decoration: underline; }
.pt-notice-dot { color: rgba(3,105,161,.4); font-size: 12px; }
@keyframes ptNoticeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
html.dark .pt-notice-bar {
  background: linear-gradient(90deg, rgba(125,211,252,.08), rgba(253,224,71,.06));
  border-bottom-color: rgba(148,163,184,.12);
}
html.dark .pt-notice-tag { color: #7dd3fc; background: rgba(125,211,252,.12); }
html.dark .pt-notice-item { color: #bae6fd; }
html.dark .pt-notice-dot { color: rgba(125,211,252,.35); }

/* ============ 侧栏折叠（图标模式）：桌面宽度生效，状态由 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(125,211,252,.55); border-radius: 50%;
    background: #fff; color: #0369a1; font-size: 14px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(2,132,199,.18);
  }
  .pt-side-toggle:hover { background: #e0f2fe; }
  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(2,132,199,.3);
  }
  html.dark .pt-side-toggle { background: #0b1220; color: #7dd3fc; border-color: rgba(125,211,252,.35); }
  html.dark .pt-side-toggle:hover { background: #1e293b; }
}

/* ===== 前台导航图标支持图片 + 折叠态 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: #0284c7; color: #fff; border-color: #0284c7;
    box-shadow: 0 2px 10px rgba(2,132,199,.45);
    font-size: 15px; font-weight: 700;
  }
  body.pt-rail .pt-side-toggle:hover { background: #0369a1; }
  html.dark body.pt-rail .pt-side-toggle { background: #0369a1; color: #f0f9ff; border-color: #38bdf8; }
  html.dark body.pt-rail .pt-side-toggle:hover { background: #0284c7; }
}
/* 云朵装饰动画会飞出右边界，裁掉避免页面出现横向滚动条（clip 不影响 sticky） */
.portal { overflow-x: clip; }
