/* ============================================================
   style.css —— 网站前台全局样式（和风手帐风）
   米黄纸底 + 墨色文字 + 朱红点缀，衬线标题，像一本日式手帐
   维护提示（2026-10-16）：本文件叠了三层主题，一层盖一层——
   ① 开头的和风主题（部分变量仍被后面两层使用，如 --font-serif、
      --accent-green、--paper-deep、--shadow-hover，共 77 处引用，勿删！）
   ② 「2026 白色主题重构」  ③ 「全站白色主题与紧凑布局（最终覆盖）」
   ④ 文件末尾「移动端修补」区块。
   改样式请追加在文件末尾，不要删前面的旧规则，否则会破坏现网白色主题。
   ============================================================ */

/* 原始和风主题变量层：并非死代码，--font-serif 等仍被后面的白色主题层使用，勿删 */
:root {
  --paper: #f6f1e7;        /* 纸底：暖米黄 */
  --paper-deep: #efe7d8;   /* 深一档的纸色（页脚、占位块） */
  --card: #fffdf8;         /* 卡片：暖白 */
  --border: #e2d8c4;       /* 细边框：浅茶色 */
  --ink: #3f3a33;          /* 正文：墨色 */
  --muted: #8a8072;        /* 次要文字：灰茶 */
  --accent: #b8502e;       /* 主色：朱红 */
  --accent-dark: #9a3f22;
  --accent-soft: #f6e5dc;  /* 朱红的浅色底 */
  --accent-pink: #f9e8e2;  /* 便签粉（日语按钮用） */
  --accent-green: #5e9c78; /* 抹茶绿（投稿入口用） */
  --radius: 10px;
  --shadow: 0 1px 4px rgba(90, 70, 40, 0.05);
  --shadow-hover: 0 8px 18px rgba(90, 70, 40, 0.12);
  --font-serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
}

/* ===== 学习循环：今日任务 / 错题 / 统计 / 通知 ===== */
.study-center-page,.vocab-study-page{width:min(1180px,calc(100vw - 340px));margin:0 auto;padding:34px 0 70px}
.study-center-head{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e7ebef;border-radius:16px;padding:14px 18px;margin-bottom:16px;box-shadow:0 6px 18px rgba(36,48,62,.045)}
.study-center-head span,.study-panel header span,.study-today-card header span,.vocab-study-head span{font-size:12px;letter-spacing:.18em;color:#c54d2d;font-weight:800}
.study-center-head h1,.vocab-study-head h1{font-size:25px;margin:2px 0;color:#202833}.study-center-head p{margin:0;color:#7b8490;font-size:13px;line-height:1.45}
.study-notice-button{border:1px solid #e2e6eb;background:#fff;border-radius:12px;padding:7px 10px;font-size:15px}.study-notice-button b{display:inline-grid;place-items:center;min-width:18px;height:18px;border-radius:20px;background:#eef1f4;color:#6c7480;font-size:11px}.study-notice-button.has-unread b{background:#c84e2b;color:#fff}
.study-login-gate,.vocab-study-login{background:#fff;border:1px solid #e6e9ed;border-radius:24px;text-align:center;padding:70px 24px}.study-login-gate>span{font-size:42px}.study-login-gate h2{margin:14px 0 6px}.study-login-gate p{color:#7c8591;margin:0 0 22px}
.study-today-card,.study-panel{background:#fff;border:1px solid #e5e9ed;border-radius:22px;padding:24px;box-shadow:0 10px 28px rgba(35,46,59,.045)}
.study-today-card{margin-bottom:20px}.study-today-card header,.study-panel header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.study-today-card h2,.study-panel h2{font-size:22px;margin:3px 0 0;color:#252d37}.study-today-card header button,.study-panel header a{border:0;background:none;color:#c44d2d;font-weight:700;text-decoration:none}
.study-task-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.study-task{display:block;border:1px solid #e7eaee;border-radius:17px;padding:18px;color:#232b34;text-decoration:none}.study-task>span{display:block;color:#737d88}.study-task>b{display:block;font-size:25px;margin:8px 0}.study-task>b small{font-size:13px;color:#9aa2ab}.study-task>i{display:block;height:7px;background:#eef1f4;border-radius:10px;overflow:hidden}.study-task>i em{display:block;height:100%;background:#c74e2c;border-radius:10px}.study-task>small{display:block;margin-top:8px;color:#89929d}
.study-dashboard-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:20px;margin-bottom:20px}.study-review-panel{grid-row:span 2}.study-review-item{border-top:1px solid #edf0f2;padding:16px 0}.study-review-item:first-child{border-top:0;padding-top:0}.study-review-item span{font-size:12px;color:#bd583b}.study-review-item h3{font-size:16px;margin:4px 0 12px}.study-review-item>div:last-child{display:flex;gap:8px;flex-wrap:wrap}.study-review-item a,.study-review-item button{padding:7px 11px;border:1px solid #dfe4e8;border-radius:9px;background:#fff;color:#555e67;text-decoration:none;font-size:12px}.study-review-item button:first-of-type{border-color:#c74e2c;color:#c74e2c}.study-empty{padding:32px 8px;color:#929aa3;text-align:center}
.study-stat-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.study-stat-grid>div{background:#f7f8fa;border-radius:14px;padding:14px}.study-stat-grid b{display:block;font-size:24px;color:#c34d2d}.study-stat-grid span{font-size:12px;color:#7e8791}.study-weak-row{display:grid;grid-template-columns:76px 1fr 82px;align-items:center;gap:9px;margin:13px 0;font-size:12px}.study-weak-row i{height:7px;border-radius:8px;background:#edf0f3;overflow:hidden}.study-weak-row em{display:block;height:100%;background:#d46a4d}.study-weak-row b{text-align:right;color:#747e88}
.study-trend{height:178px;display:flex;align-items:flex-end;gap:9px}.study-trend>div{height:100%;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.study-trend i{height:112px;width:22px;border-radius:8px;background:#f0f2f4;position:relative;overflow:hidden}.study-trend em{position:absolute;bottom:0;left:0;right:0;background:#c84e2b;border-radius:8px}.study-trend b{font-size:10px;margin-top:5px}.study-trend span{font-size:10px;color:#929aa3}.study-notice-panel{margin-bottom:20px}.study-notice{display:flex;justify-content:space-between;gap:20px;padding:16px 0;border-top:1px solid #edf0f2}.study-notice:first-child{border-top:0}.study-notice.unread h3:before{content:"";display:inline-block;width:7px;height:7px;background:#c84e2b;border-radius:50%;margin-right:8px}.study-notice span{font-size:11px;color:#9aa1a9}.study-notice h3{font-size:16px;margin:4px 0}.study-notice p{margin:0;color:#707984}.study-notice a,.study-notice button{align-self:center;white-space:nowrap;border:0;background:none;color:#c64e2d;text-decoration:none}
.study-plan-modal[hidden]{display:none}.study-plan-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center}.study-plan-backdrop{position:absolute;inset:0;border:0;background:rgba(25,31,38,.42)}.study-plan-modal>section{position:relative;background:#fff;width:min(420px,calc(100vw - 30px));padding:28px;border-radius:20px}.study-plan-close{position:absolute;right:16px;top:13px;border:0;background:none;font-size:25px}.study-plan-modal>section>span{color:#c54d2d;font-size:12px;letter-spacing:.15em;font-weight:800}.study-plan-modal h2{margin:6px 0 20px}.study-plan-modal label{display:flex;justify-content:space-between;align-items:center;margin:12px 0}.study-plan-modal input{width:110px;padding:9px;border:1px solid #dce1e6;border-radius:9px}
.vocab-detail-actions{display:flex;gap:10px;flex-wrap:wrap}.vocab-study-head{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e5e9ed;border-radius:22px;padding:22px 26px;margin-bottom:20px}.vocab-study-head>a{color:#777f89;text-decoration:none}.vocab-study-head h1{font-size:27px;margin:3px 0}.vocab-study-head>b{color:#c54e2d}.vocab-flash-stage{background:#fff;border:1px solid #e5e9ed;border-radius:24px;padding:28px;min-height:570px}.vocab-flash-progress{height:7px;background:#edf0f3;border-radius:10px;overflow:hidden}.vocab-flash-progress i{display:block;height:100%;background:#c84e2b;transition:width .25s}.vocab-flash-card{min-height:390px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;outline:none;cursor:pointer}.vocab-flash-card>span{font-size:12px;color:#b35a42}.vocab-flash-card h2{font-size:48px;margin:18px 0 8px}.vocab-flash-card>p{color:#929aa3}.vocab-flash-card #vocabFlashAnswer b{font-size:22px}.vocab-flash-card #vocabFlashAnswer p{font-size:23px}.vocab-flash-card #vocabFlashAnswer small{color:#777f88}.vocab-flash-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.vocab-flash-actions button{padding:13px;border:1px solid #dfe4e8;border-radius:12px;background:#fff}.vocab-flash-actions button:nth-child(2){border-color:#c84e2b;color:#c84e2b}.vocab-flash-actions button:nth-child(3){background:#c84e2b;color:#fff;border-color:#c84e2b}
.grammar-compare-add{border:1px solid #c84e2b!important;color:#c84e2b!important;background:#fff!important;border-radius:9px;padding:7px 11px}.grammar-compare-dock{position:fixed;right:24px;bottom:24px;z-index:80;display:flex;align-items:center;gap:18px;background:#fff;border:1px solid #e1e5e9;border-radius:16px;padding:13px 16px;box-shadow:0 14px 38px rgba(29,37,46,.16)}.grammar-compare-dock span{display:block;font-size:10px;letter-spacing:.14em;color:#c54e2d}.grammar-compare-dock b{font-size:13px}.grammar-compare-dock small{color:#8a929b}.grammar-compare-dock button{border:0;border-radius:10px;background:#c84e2b;color:#fff;padding:9px 13px}.grammar-compare-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px}.grammar-compare-shade{position:absolute;inset:0;border:0;background:rgba(25,31,38,.52)}.grammar-compare-modal>section{position:relative;width:min(1120px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:22px;padding:28px}.grammar-compare-modal header{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #e8ebee;padding-bottom:16px}.grammar-compare-modal header span{font-size:11px;letter-spacing:.16em;color:#c64e2d}.grammar-compare-modal h1{margin:4px 0;font-size:28px}.grammar-compare-close{border:0;background:none;font-size:28px}.grammar-compare-tip{color:#737c86}.grammar-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.grammar-compare-grid article{min-width:0;border:1px solid #e5e8eb;border-radius:16px;padding:20px}.grammar-compare-grid article h2{font-size:22px;margin:0 0 16px}.grammar-compare-grid article>a{display:inline-block;margin-top:14px;color:#c34e2d}
@media(max-width:900px){.study-center-page,.vocab-study-page{width:auto;padding:18px 14px 60px}.study-dashboard-grid{grid-template-columns:1fr}.study-task-grid{grid-template-columns:1fr}.study-center-head{padding:12px 14px}.study-center-head h1{font-size:22px}.study-center-head p{font-size:12px}.study-review-panel{grid-row:auto}.vocab-study-head{align-items:flex-start;gap:10px}.vocab-study-head h1{font-size:22px}.vocab-flash-card h2{font-size:38px}}

body.site-page, body.learning-page {
  background-image: var(--site-bg-image, none) !important;
  background-position: center top !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-y: scroll; scrollbar-gutter: stable; }

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background-color: var(--paper);
  /* 纸面细点纹理，很淡，模拟和纸颗粒 */
  background-image: radial-gradient(rgba(140, 120, 90, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  line-height: 1.7;
}

body.site-page, body.learning-page {
  background-image: var(--site-bg-image, none) !important;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; }

.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ============ 导航栏（固定在顶部，纸底细线） ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 231, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { color: var(--ink); }
/* 像一枚朱红印章 */
.logo-icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: var(--accent);
  color: #fffdf8;
  font-family: var(--font-serif);
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 248, 0.4);
}
.logo-text { font-family: var(--font-serif); font-size: 19px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.logo-text small { font-family: sans-serif; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 1px; }

.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 15px;
  transition: all 0.15s;
}
.nav-links a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.nav-links a.active { background: var(--accent); color: #fffdf8; }

/* 右上角一排入口：日语学习系统 + 投稿 + 语言切换 + 登录/头像 */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 日语学习系统（像一张便签贴纸） */
.jp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--accent-pink);
  border: 1px dashed #d9a48f;
  color: #a8482c !important;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s;
}
.jp-btn:hover { transform: translateY(-1px); }
.jp-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: #a8482c;
  padding: 0 7px;
  border-radius: 8px;
  font-weight: 400;
}

/* 投稿入口（绿色小按钮） */
.nav-share {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--accent-green);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s;
}
.nav-share:hover { transform: translateY(-1px); }

/* 语言切换按钮 */
.lang-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 6px;
  background: #fffdf8;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* 登录链接 */
.nav-login {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
}
.nav-login:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* 登录后的头像按钮（圆形小头像 / 昵称首字） */
.user-area { display: flex; align-items: center; }
.user-avatar-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  background: var(--accent-pink);
  color: #a8482c;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.user-avatar-btn:hover { transform: translateY(-1px); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ============ 轮播图（全宽，自动播放） ============ */
.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--paper-deep);
  height: clamp(170px, 24vw, 280px);
  margin-bottom: 20px;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 48px 24px 20px;
  background: linear-gradient(transparent, rgba(50, 40, 30, 0.55));
  color: #fffdf8;
}
.carousel-caption h2 { font-size: clamp(18px, 2.6vw, 28px); }

/* 没有轮播图时的欢迎占位 */
.welcome-slide {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: var(--paper-deep);
  color: var(--ink);
}
.welcome-slide h2 { font-size: clamp(26px, 4vw, 44px); }
.welcome-slide p { font-size: clamp(14px, 2vw, 18px); color: var(--muted); }
.welcome-slide::before {
  content: "こ";
  width: 72px; height: 72px;
  border-radius: 8px;
  background: var(--accent);
  color: #fffdf8;
  font-family: var(--font-serif);
  font-size: 40px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(63, 58, 51, 0.45);
  color: #fffdf8;
  font-size: 24px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 5;
}
.carousel-arrow:hover { background: rgba(63, 58, 51, 0.7); }
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.carousel-dots .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.55);
  cursor: pointer;
  transition: all 0.2s;
}
.carousel-dots .dot.active { background: var(--accent); width: 22px; border-radius: 5px; }

/* ============ 关于页意见箱 ============ */
.feedback-box {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feedback-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.feedback-mark { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.feedback-heading h2 { margin: 0 0 5px; font-size: 21px; color: var(--ink); }
.feedback-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.feedback-form { display: grid; gap: 8px; }
.feedback-form label { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.feedback-form label span { color: var(--muted); font-weight: 400; }
.feedback-form input, .feedback-form textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.feedback-form textarea { resize: vertical; min-height: 150px; line-height: 1.7; }
.feedback-form input:focus, .feedback-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feedback-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.feedback-actions > span { color: var(--muted); font-size: 12px; }
.feedback-actions .btn:disabled { opacity: .6; cursor: wait; }
.feedback-status { min-height: 20px; margin: 2px 0 0; font-size: 13px; }
.feedback-status.success { color: #2f7d4f; }
.feedback-status.error { color: #b0352b; }

/* ============ 首页时钟区：日期/时间在上，番茄钟在下（同一个框） ============ */
.clock-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  margin-bottom: 24px;
}
.clock-top { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 24px; }
.clock-date-block { display: flex; align-items: center; gap: 10px; }
.clock-date { font-size: 15px; font-weight: 600; color: var(--ink); }
.clock-week {
  font-size: 13px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #ecd3c5;
  padding: 1px 12px;
  border-radius: 12px;
}
.clock-time-block { display: flex; align-items: center; }
.clock-time {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

/* ============ 首页布局：主体 + 侧边栏 ============ */
.home-layout, .list-layout, .detail-layout {
  display: grid;
  /* minmax(0,1fr)：内容列允许收缩到 0，宽表格/长词不再把整页撑出横向滚动 */
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }

/* ============ 区块标题 ============ */
.section { margin-bottom: 32px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  line-height: 1.3;
}
.more-link { color: var(--muted); font-size: 14px; }
.more-link:hover { color: var(--accent); }

/* ---------- 番茄钟（时钟区紧凑版：日期时间下方，一行放不下自动换行） ---------- */
.pomo-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  width: 100%;
  padding: 10px 2px 0;
  border-top: 1px solid var(--border);
}
/* 紧凑版数字比大号版小一圈（38×56），滚动距离由 JS 按实际高度算，不受影响 */
.pomo-compact .pomo-display { flex: none; }
.pomo-compact .pomo-digit { width: 38px; height: 56px; }
.pomo-compact .pomo-strip span { width: 38px; height: 56px; font-size: 34px; }
.pomo-compact .pomo-sep { font-size: 26px; font-weight: 400; color: var(--muted); }
.pomo-compact .pomo-controls { flex: 0 1 auto; gap: 8px; }
.pomo-compact .pomo-actions .btn { padding: 6px 8px; font-size: 13px; }
.pomo-controls {
  flex: 1 1 190px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  justify-content: center;
}
.pomo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pomo-chip {
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.pomo-chip:hover { border-color: var(--accent); color: var(--accent); }
.pomo-chip.active { background: var(--accent); border-color: var(--accent); color: #fffdf8; font-weight: 600; }
.pomo-adjust { display: flex; align-items: center; gap: 10px; }
.pomo-btn {
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  transition: all 0.15s;
}
.pomo-btn:hover { background: var(--accent); border-color: var(--accent); color: #fffdf8; }
.pomo-total { font-size: 15px; font-weight: 700; color: var(--ink); min-width: 58px; text-align: center; }
.pomo-actions { display: flex; gap: 10px; }
.pomo-actions .btn { flex: 1; padding: 8px 10px; }

/* 4 位数字纵向滚动倒计时（mm:ss），每位是 0-9 滚动窗口 */
.pomo-display {
  flex: 1 1 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.pomo-digit {
  width: 46px;
  height: 68px;
  overflow: hidden;
}
.pomo-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease;
}
.pomo-strip span {
  width: 46px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
}
.pomo-sep { font-size: 34px; font-weight: 400; color: var(--muted); }
/* 时间到：数字变朱红闪烁（专注模式的深色皮肤另有自己的闪烁样式） */
.pomo-done:not(.focus-display) .pomo-strip span { animation: pomo-blink 0.8s ease-in-out infinite; }
@keyframes pomo-blink {
  0%, 100% { color: var(--accent); }
  50% { color: #e8a583; }
}
.pomo-done-tip {
  width: 100%;
  margin-top: -4px;
  text-align: center;
  font-size: 14px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px dashed #d9a48f;
  border-radius: 8px;
  padding: 8px 12px;
}

/* ============ 专注模式：全屏大字倒计时 + 学习统计 ============ */
.focus-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #2b2620;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 60px 20px 40px;
}
.focus-modal[hidden] { display: none; }
.focus-head {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.focus-mode-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #e8dfcc;
}
.focus-exit-btn {
  background: transparent;
  border: 1px solid #6b6255;
  color: #c9c0ae;
  border-radius: 16px;
  padding: 5px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.focus-exit-btn:hover { border-color: #e8a87c; color: #f6f1e6; }
.focus-label {
  margin: 0;
  font-size: 15px;
  letter-spacing: 6px;
  color: #a79d8a;
}
/* 全屏大字数字：90×130，深色皮肤 */
.focus-display .pomo-digit {
  width: 90px;
  height: 130px;
  border-radius: 14px;
  background: #3a342c;
  border-color: #4d463c;
}
.focus-display .pomo-strip span {
  width: 90px;
  height: 130px;
  font-size: 76px;
  color: #f6f1e6;
}
.focus-display .pomo-sep { font-size: 60px; color: #a79d8a; }
/* 时间到：深色版闪烁（覆盖浅色眨眼动画） */
.focus-display.pomo-done .pomo-digit { animation: focus-blink 0.8s ease-in-out infinite; }
@keyframes focus-blink {
  0%, 100% { background: #3a342c; border-color: #4d463c; }
  50% { background: #7a4a2c; border-color: #e8a87c; }
}
.focus-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.focus-stat {
  font-size: 15px;
  color: #e8dfcc;
  background: #3a342c;
  border: 1px solid #4d463c;
  border-radius: 18px;
  padding: 8px 18px;
}
.focus-actions { display: flex; gap: 14px; }
.focus-actions .btn { min-width: 130px; padding: 12px 20px; font-size: 16px; }
.focus-done-tip {
  background: transparent;
  border: 1px dashed #e8a87c;
  color: #f0b98a;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 15px;
}

/* ---------- 天数倒计时板块（独立于时钟区，没设置就不显示） ---------- */
.countdown-box {
  text-align: center;
  background: var(--card);
  border: 1px dashed #d9a48f;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 16px;
}
.countdown-main {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.countdown-target {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ============ 卡片 ============ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #d9c4a8;
  color: var(--ink);
}
.card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .card-cover img { transform: scale(1.04); }
.cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-deep);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 36px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.card-summary { font-size: 13px; color: var(--muted); flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #ecd3c5;
  padding: 1px 9px;
  border-radius: 9px;
  font-size: 12px;
}

/* ============ 文章列表页的横排条目 ============ */
.article-row {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.article-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #d9c4a8;
  color: var(--ink);
}
.row-cover { width: 180px; flex-shrink: 0; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--paper-deep); }
.row-cover img { width: 100%; height: 100%; object-fit: cover; }
.row-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.row-title { font-size: 17px; font-weight: 700; }
.row-summary { font-size: 13px; color: var(--muted); flex: 1; }
.author { color: var(--muted); }

/* ============ 视频卡片 ============ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.video-card { cursor: pointer; }
.video-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--paper-deep);
}
.video-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-cover img { transform: scale(1.05); }
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(50, 40, 30, 0.2);
  color: #fffdf8;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-card:hover .play-overlay { opacity: 1; }
.play-overlay::before {
  content: "";
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(50, 40, 30, 0.55);
  position: absolute;
}
.video-title { margin-top: 10px; font-family: var(--font-serif); font-size: 15px; font-weight: 700; }
.video-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============ 侧边栏小部件 ============ */
.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.widget-text { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.widget-list { list-style: none; }
.widget-list li { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--ink); display: block; }
.widget-list a:hover { color: var(--accent); }
.widget-list a.current { color: var(--accent); font-weight: 700; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fffdf8; }
.btn-primary:hover { background: var(--accent-dark); color: #fffdf8; }
.btn-outline { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-block { display: block; text-align: center; }

/* ============ 分页 ============ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.pagination .page, .pagination .page-nav {
  padding: 6px 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
}
.pagination .page:hover, .pagination .page-nav:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page.current { background: var(--accent); border-color: var(--accent); color: #fffdf8; }
.pagination .page-dots { color: var(--muted); }

/* ============ 文章详情 ============ */
.article-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.detail-title { font-size: 26px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; }
.detail-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
/* 打印按钮：放在作者右边，靠右的小圆角按钮 */
.detail-print-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.detail-print-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--paper-deep); }
.detail-cover {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.article-content { font-size: 15px; line-height: 1.9; word-break: break-word; }
.article-content h1, .article-content h2, .article-content h3 { margin: 22px 0 12px; }
.article-content h2 { padding-left: 10px; border-left: 4px solid var(--accent); }
.article-content p { margin: 10px 0; }
.article-content ul, .article-content ol { margin: 10px 0 10px 22px; }
.article-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; }
.article-content pre {
  background: #f4eddf;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  margin: 12px 0;
}
.article-content code {
  background: #f1ead9;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  color: #9a3f22;
}
.article-content pre code { background: none; padding: 0; color: var(--ink); }
.article-content blockquote {
  border-left: 4px solid #d9c4a8;
  padding: 6px 14px;
  color: var(--muted);
  margin: 12px 0;
  background: #faf6ec;
}
/* 假名标注：汉字上方的小字读音（文章正文和测验题目） */
.article-content ruby, .quiz-intro ruby { ruby-position: over; }
.article-content rt, .quiz-intro rt { font-size: 0.55em; color: var(--muted); }
.detail-back { margin-top: 28px; }

/* ============ 空状态 / 错误提示 ============ */
.empty-box {
  background: var(--card);
  border: 1px dashed #d9c4a8;
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty-box.big { padding: 70px 20px; }
.empty-box a:not(.btn) { color: var(--accent); }
.empty-box .btn { margin-top: 14px; }

.api-error {
  background: #fbf3d9;
  border: 1px solid #e8d491;
  color: #7d6520;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}
.api-error code { background: #f3e7b8; padding: 2px 6px; border-radius: 4px; }

/* ============ 视频播放弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 36, 25, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  position: relative;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.video-modal-box { width: min(860px, 94vw); }
.modal-title { padding: 14px 48px 0 20px; font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.modal-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 34px; height: 34px;
  border: none;
  background: var(--paper-deep);
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
}
.modal-close:hover { background: var(--border); }
.video-player-wrap { padding: 14px 20px 20px; }
.video-player-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  background: #000;
}
.video-player-wrap video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
}

/* ============ 个人中心弹窗（右上角头像点开） ============ */
.account-modal { width: min(420px, 94vw); padding-bottom: 18px; }
.acc-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 4px;
}
.acc-avatar-box {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent-pink);
  border: 2px solid var(--accent-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.acc-avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.acc-avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 0;
}
.acc-row label { flex-shrink: 0; color: var(--muted); font-size: 13px; }
.acc-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}
.acc-email { color: var(--ink); font-size: 14px; }
.acc-status {
  margin: 10px 20px 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fdf0d8;
  border: 1px solid #ecd3a4;
  color: #9a6b2a;
  font-size: 13px;
}
.acc-msg {
  margin: 8px 20px 0;
  color: var(--accent);
  font-size: 13px;
}
.acc-posts-title {
  margin: 16px 20px 4px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 4px;
}
.acc-posts { max-height: 180px; overflow-y: auto; margin: 0 20px; }
.acc-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--paper-deep);
  font-size: 14px;
}
.acc-post-item a { color: var(--ink); }
.acc-post-item a:hover { color: var(--accent); }
.acc-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.acc-badge.ok { background: #e2efe6; color: #3d7a52; }
.acc-badge.wait { background: #fdf0d8; color: #9a6b2a; }
.acc-badge.no { background: #fbe4e4; color: #b23b3b; }
.acc-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.acc-bottom {
  margin: 14px 20px 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: flex-end;
}
/* 学习中心页的头像（登录后显示用户头像图） */
.jp-user-avatar img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}

/* ============ 投稿页（前台分享入口） ============ */
.share-page { max-width: 720px; margin: 0 auto; }
.share-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.share-gate-icon { font-size: 36px; text-align: center; margin-bottom: 6px; }
.share-card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 8px;
}
.share-gate-tip { color: var(--muted); margin-bottom: 14px; }
.share-tip {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.share-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  margin-bottom: 12px;
}
.share-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  line-height: 1.7;
}
.share-file-area { margin: 12px 0; }
.share-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-file-name {
  color: var(--ink);
  font-size: 14px;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.share-file-remove {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--paper-deep);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.share-file-remove:hover { background: var(--border); }
.share-upload-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 4px;
  background: var(--paper-deep);
  overflow: hidden;
}
.share-upload-bar-inner {
  height: 100%;
  width: 0;
  background: var(--accent-green);
  border-radius: 4px;
  transition: width 0.2s;
}
.share-upload-pct { color: var(--muted); font-size: 13px; margin-top: 4px; }
.share-submit-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.share-msg { color: var(--accent); font-size: 14px; }
.share-msg.ok { color: var(--accent-green); }
.share-my-title {
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}
.share-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--paper-deep);
  font-size: 14px;
}
.share-post-item a { color: var(--ink); }
.share-post-item a:hover { color: var(--accent); }
.share-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.share-badge.ok { background: #e2efe6; color: #3d7a52; }
.share-badge.wait { background: #fdf0d8; color: #9a6b2a; }
.share-badge.no { background: #fbe4e4; color: #b23b3b; }
.share-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* ============ 日语学习入口页 ============ */
.jp-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 56px 48px;
  text-align: center;
  max-width: 520px;
}
.jp-icon { font-size: 56px; margin-bottom: 12px; }
.jp-title { font-size: 26px; margin-bottom: 10px; }
.jp-status {
  display: inline-block;
  background: var(--accent-pink);
  border: 1px dashed #d9a48f;
  color: #a8482c;
  padding: 5px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}
.jp-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* ============ 底部 ============ */
.site-footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--border);
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 40px;
}
.footer-sub { margin-top: 4px; font-size: 12px; }
.footer-sub a { color: var(--muted); text-decoration: underline; }

/* ============ 响应式（手机） ============ */
@media (max-width: 900px) {
  .home-layout, .list-layout, .detail-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .article-detail { padding: 20px; }
}
@media (max-width: 560px) {
  .video-grid { grid-template-columns: 1fr; }
  .row-cover { width: 120px; }
  .nav-links { order: 3; width: 100%; justify-content: center; margin-left: 0; }
  .nav-right { gap: 6px; }
  .nav-right .nav-share, .nav-right .jp-btn { padding: 7px 9px; font-size: 12px; }
  .row-summary { display: none; }
  .detail-title { font-size: 21px; }
}

/* ============ 文章附件（文档查阅区） ============ */
.doc-viewer {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.doc-label {
  background: var(--primary);
  color: #fffdf8;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}
.doc-name { font-weight: 600; word-break: break-all; }
.doc-download {
  margin-left: auto;
  color: var(--primary);
  font-size: 13px;
  text-decoration: underline;
}
.doc-download:hover { color: var(--primary-dark); }

.doc-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.doc-btn {
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.doc-btn:hover { background: var(--paper-deep); border-color: #d9c4a8; }

.doc-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f0eae0;
}
.doc-frame {
  display: block;
  width: 100%;
  height: 640px;
  border: none;
  transform-origin: top left;
  background: #fff;
}
/* 手机：iPhone 没法在页面里显示 PDF，所以放一个大按钮（点一下用手机阅读器打开）；
   Android 手机大多能直接显示下面的预览框，所以预览也留着 */
.doc-open-mobile { display: none; }
@media (max-width: 560px) {
  .doc-open-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fffdf8;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    margin: 4px 0 10px;
  }
  .doc-open-mobile:hover { background: var(--primary-dark); }
  .doc-frame { height: 420px; }
}

.doc-docx {
  background: var(--card);
  min-height: 300px;
  width: 100%;
  transform-origin: top left;
}
.doc-loading { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.doc-docx-paper {
  background: #fffdf8;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 40px;
  line-height: 1.9;
}
.doc-docx-paper img { max-width: 100%; }

.doc-audio, .doc-video { width: 100%; margin-top: 8px; }
.doc-image-wrap { text-align: center; }
.doc-image { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.doc-download-card {
  background: var(--paper);
  border: 1px dashed #d9c4a8;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.doc-download-card p { margin-bottom: 14px; }

/* 附件预览（文章页 + 投稿页共用）：图片、视频、音频 */
.att-preview-img { display: block; max-width: 100%; max-height: 320px; margin: 0 auto 6px; border-radius: 8px; border: 1px solid var(--border); }
.att-preview-media { display: block; width: 100%; max-width: 560px; margin: 0 auto 6px; border-radius: 8px; }
.att-preview-audio { display: block; width: 100%; max-width: 420px; margin: 0 auto 6px; }
.att-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-file-preview { margin-top: 12px; }
.share-cover-preview { margin-top: 12px; }
.share-cover-preview .att-preview-img { max-height: 200px; }

/* ============ 文章搜索框 ============ */
.search-form { display: flex; align-items: center; margin-left: auto; margin-right: 12px; }
.search-form input {
  background: var(--card);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 6px 12px;
  font-size: 13px;
  width: 170px;
  color: var(--ink);
  outline: none;
}
.search-form input:focus { border-color: #d9c4a8; }
.search-form button {
  background: var(--accent);
  color: #fffdf8;
  border: 1px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }
@media (max-width: 560px) {
  .search-form input { width: 110px; }
  .search-form { margin-right: 6px; }
}

/* ============ 首页课程表（一天一屏，左右箭头/滑动切换） ============ */
.timetable-day-wrap { touch-action: pan-y; }
.tt-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.tt-arrow {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tt-arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.tt-day-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; color: var(--ink); }
.tt-today-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}
/* display:inline-block 会把 hidden 属性盖掉，导致切到别的天还显示「今天」——这里补回来 */
.tt-today-badge[hidden] { display: none; }
.tt-day-panel { display: flex; flex-direction: column; gap: 10px; }
.tt-day-panel[hidden] { display: none; }
.tt-row { display: flex; align-items: stretch; gap: 12px; }
.tt-time {
  flex: 0 0 118px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.tt-period { font-weight: 700; color: var(--ink); font-size: 14px; }
.tt-clock { color: var(--muted); font-size: 12px; }
.tt-card {
  flex: 1;
  border-radius: var(--radius);
  border-left: 4px solid;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tt-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.tt-info { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* 课程颜色（后台可选，这里对应背景和左边条） */
.tt-blue   { border-left-color: #4a7fb5; background: #eaf2fa; }
.tt-green  { border-left-color: #4e9a6b; background: #eaf6ee; }
.tt-orange { border-left-color: #d98a3d; background: #fcf1e4; }
.tt-purple { border-left-color: #8a6ab5; background: #f2edf9; }
.tt-red    { border-left-color: #c05c4e; background: #faecea; }
.tt-teal   { border-left-color: #3e9aa0; background: #e9f5f6; }
.tt-pink   { border-left-color: #c96a8d; background: #faeef3; }
.tt-gray   { border-left-color: #8a8072; background: #f0ede7; }

@media (max-width: 560px) {
  .tt-time { flex: 0 0 96px; }
  .tt-card { padding: 10px 12px; }
}

/* ---------- 「查看整周」：7 天并排（纯 CSS，JS 加 .week-view 类） ---------- */
.timetable-day-wrap.week-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: start;
}
/* .tt-nav 是 wrap 的第一个子元素：周视图下占满整行（只留标题） */
.timetable-day-wrap.week-view .tt-nav { grid-column: 1 / -1; }
.timetable-day-wrap.week-view .tt-arrow,
.timetable-day-wrap.week-view .tt-today-badge { display: none; }
/* 特异性 (0,3,0) 压过 .tt-day-panel[hidden] (0,2,0)：7 个面板全部显示 */
.timetable-day-wrap.week-view .tt-day-panel { display: flex; }
/* 每天面板顶部的「周几 + 日期」标签，只在周视图显示 */
.tt-panel-label {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}
.timetable-day-wrap.week-view .tt-panel-label { display: block; }
/* 窄列里课程行竖着排：时间在上、卡片在下 */
.timetable-day-wrap.week-view .tt-row { flex-direction: column; gap: 8px; }
.timetable-day-wrap.week-view .tt-time { flex: none; }
.timetable-day-wrap.week-view .tt-card { padding: 10px 12px; }
.timetable-day-wrap.week-view .tt-name { font-size: 14px; }
.timetable-day-wrap.week-view .tt-info { font-size: 12px; }

@media (max-width: 900px) {
  .timetable-day-wrap.week-view { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 日语学习系统：登录/注册页 ============ */
.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 420px; text-align: center; }
.auth-icon { font-size: 44px; margin-bottom: 8px; }
.auth-title { font-size: 22px; margin-bottom: 4px; color: var(--ink); }
.auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.auth-tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 10px 0; border: none; background: var(--paper); color: var(--ink); font-size: 15px; cursor: pointer; }
.auth-tab.active { background: var(--accent); color: #fffdf8; font-weight: 600; }
.auth-form { text-align: left; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.auth-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; color: var(--ink); box-sizing: border-box; }
.auth-input:focus { outline: none; border-color: var(--accent); }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .auth-input { flex: 1; }
.auth-code-row .btn { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
.auth-msg { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.auth-msg.err { background: #faecea; color: #b0352b; border: 1px solid #ecc4bc; }
.auth-msg.ok { background: #eaf6ee; color: #2f7d4f; border: 1px solid #bfe3cc; }
.auth-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }
.auth-link-btn { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.auth-link-btn:hover { color: var(--accent-dark); }
.acc-password-box { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.acc-password-box summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; }
.acc-password-fields { display: grid; gap: 9px; margin-top: 12px; }
.acc-password-fields input { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 9px 11px; background: var(--card); color: var(--ink); box-sizing: border-box; }
.acc-password-fields .btn { justify-self: end; }

/* ================= 罗马字对战 ================= */
.rb-page { max-width: 1050px; margin: 0 auto; padding: 8px 0 34px; }
.rb-page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:20px; }
.rb-page-head h1 { font-family:var(--font-serif); margin:3px 0; font-size:clamp(26px,4vw,42px); }
.rb-page-head p { color:var(--muted); margin:0; }
.rb-kicker { color:var(--accent); font-size:11px; font-weight:800; letter-spacing:.22em; }
.rb-setup,.rb-arena,.rb-result { background:var(--card); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow); padding:clamp(18px,4vw,34px); }
.rb-mode-pick { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.rb-mode { border:1px solid var(--border); background:var(--paper); color:var(--ink); border-radius:11px; padding:16px; text-align:left; cursor:pointer; }
.rb-mode b,.rb-mode span { display:block; }.rb-mode span { color:var(--muted); font-size:13px; margin-top:5px; }
.rb-mode.active { border-color:var(--accent); background:var(--accent-soft); box-shadow:0 0 0 2px rgba(184,80,46,.12); }
.rb-settings { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:20px 0; }
.rb-settings label { color:var(--muted); font-size:13px; }.rb-settings select { width:100%; display:block; margin-top:6px; padding:9px; border:1px solid var(--border); border-radius:8px; background:var(--paper); color:var(--ink); }
.rb-start { min-width:180px; }.rb-load { display:inline; margin-left:12px; color:var(--muted); font-size:13px; }
.rb-online-actions { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }.rb-join { display:flex; gap:6px; }.rb-join input { width:130px; text-transform:uppercase; letter-spacing:.14em; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--paper); color:var(--ink); }.rb-room-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-8px 0 13px; }.rb-room-state { flex:1; text-align:center; color:var(--muted); font-size:13px; }.rb-room-state b { color:var(--accent); letter-spacing:.16em; font-size:16px; }.rb-leave { white-space:nowrap; }
.rb-fighters { display:grid; grid-template-columns:1fr auto 1fr; gap:20px; align-items:center; }
.rb-fighter-line { display:flex; justify-content:space-between; font-size:14px; margin-bottom:6px; }.rb-fighter.enemy .rb-fighter-line { flex-direction:row-reverse; }
.rb-hp { height:15px; background:#eadfd5; border-radius:99px; overflow:hidden; }.rb-hp i { display:block; width:100%; height:100%; background:linear-gradient(90deg,#4ca66a,#79c98f); transition:width .35s; }.rb-fighter.enemy .rb-hp i { margin-left:auto; background:linear-gradient(90deg,#e98b70,#c94e38); }
.rb-clock { text-align:center; min-width:54px; }.rb-clock b { display:block; font-size:28px; line-height:1; }.rb-clock span { color:var(--muted); font-size:11px; }
.rb-battlefield { display:grid; grid-template-columns:100px 1fr 100px; gap:22px; align-items:center; margin:24px 0 14px; }
.rb-avatar { width:86px; height:86px; border-radius:50%; display:flex; align-items:center; justify-content:center; font:700 34px var(--font-serif); background:#e5f2e8; color:#397a50; border:5px solid #fff; box-shadow:0 3px 16px rgba(0,0,0,.12); transition:transform .2s; }.rb-enemy-avatar { background:#f8e3dc; color:#a53f27; }.rb-avatar.hit { animation:rb-hit .36s; } @keyframes rb-hit { 40%{transform:translateX(-14px) rotate(-7deg);filter:brightness(1.2)} }
.rb-word-card { position:relative; text-align:center; min-height:210px; padding:20px; border:1px solid var(--border); border-radius:14px; background:linear-gradient(145deg,#fffdf8,#f8f0e2); }
.rb-level { color:var(--accent); font-size:12px; min-height:18px; }.rb-kanji { font:700 clamp(38px,7vw,66px) var(--font-serif); line-height:1.25; }.rb-kana { font-size:20px; letter-spacing:.08em; }.rb-meaning { color:var(--muted); margin-top:4px; }.rb-sound { border:0; background:none; font-size:20px; cursor:pointer; }.rb-romaji-hint { min-height:24px; color:var(--accent); font:600 14px monospace; letter-spacing:.08em; }
.rb-progress-row { display:grid; grid-template-columns:auto 1fr auto 1fr; align-items:center; gap:8px; color:var(--muted); font-size:12px; }.rb-progress { height:5px; border-radius:9px; background:#eee5d8; overflow:hidden; }.rb-progress i { display:block; height:100%; width:0; background:#4ca66a; transition:width .08s; }.rb-progress.enemy i { background:#d45c41; }
.rb-input-wrap { position:relative; margin:16px auto 12px; max-width:620px; min-height:58px; padding:13px 18px; border:2px solid var(--border); border-radius:12px; background:#fff; text-align:center; }
.rb-kana-input{display:block;width:100%;border:0;outline:0;background:transparent;color:var(--ink);text-align:center;font:700 25px/1.2 var(--font-serif);letter-spacing:.1em}.rb-kana-input::placeholder{color:#b9ae9e;font:400 16px sans-serif;letter-spacing:0}.rb-kana-input.good{color:#31905a}.rb-kana-input.bad{color:#d03d31}
.rb-typed { font:700 25px/1.2 monospace; letter-spacing:.08em; }.rb-typed .good { color:#31905a; }.rb-typed .bad { color:#d03d31; }.rb-typed .remain { color:#d7cec0; }.rb-typed .placeholder { color:#b9ae9e; font:400 16px sans-serif; }
.rb-lock { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; border-radius:10px; background:rgba(204,57,47,.92); color:#fff; font-weight:700; }
.rb-stats { display:flex; justify-content:center; flex-wrap:wrap; gap:10px 24px; color:var(--muted); font-size:13px; }.rb-stats b { color:var(--ink); }
.rb-keyboard { display:none; flex-wrap:wrap; justify-content:center; gap:5px; max-width:520px; margin:18px auto 0; }.rb-keyboard button { width:40px; height:42px; border:1px solid var(--border); border-radius:7px; background:var(--paper); color:var(--ink); font-weight:700; text-transform:uppercase; touch-action:manipulation; }.rb-keyboard .wide { width:76px; }.rb-help { color:var(--muted); text-align:center; font-size:12px; margin:10px 0 0; }
.rb-countdown { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; background:rgba(40,30,20,.55); color:#fff; font:800 clamp(70px,18vw,150px) var(--font-serif); text-shadow:0 8px 30px #000; }
.rb-countdown[hidden],.rb-lock[hidden],.rb-battlefield[hidden],.rb-progress-row[hidden],.rb-keyboard[hidden],.rb-waiting[hidden],.rb-arena[hidden],.rb-setup[hidden],.rb-result[hidden]{display:none!important}
.rb-waiting{max-width:560px;margin:38px auto;text-align:center;padding:34px 22px;border:1px dashed var(--accent);border-radius:14px;background:var(--accent-soft)}.rb-waiting b{display:block;font-size:20px;margin:10px 0 5px}.rb-waiting p{margin:0;color:var(--muted)}.rb-waiting-dot{display:inline-block;width:28px;height:28px;border:3px solid rgba(184,80,46,.22);border-top-color:var(--accent);border-radius:50%;animation:rb-waiting-spin .8s linear infinite}@keyframes rb-waiting-spin{to{transform:rotate(360deg)}}
.rb-result { text-align:center; }.rb-result-mark { width:80px; height:80px; display:flex; align-items:center; justify-content:center; margin:0 auto 8px; border-radius:50%; background:var(--accent); color:#fff; font:700 42px var(--font-serif); }.rb-result-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:22px 0; }.rb-result-grid div { padding:14px 8px; background:var(--paper); border-radius:10px; }.rb-result-grid b,.rb-result-grid span { display:block; }.rb-result-grid b { font-size:20px; }.rb-result-grid span { color:var(--muted); font-size:12px; margin-top:3px; }
.rb-mistakes { max-width:600px; margin:0 auto 20px; text-align:left; }.rb-mistakes h3 { font-size:15px; }.rb-mistakes div { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; padding:7px 10px; border-bottom:1px dashed var(--border); }.rb-mistakes span { color:var(--muted); }.rb-mistakes code { text-align:right; color:var(--accent); }
@media (max-width:700px) { .rb-page-head{align-items:flex-start;flex-direction:column}.rb-mode-pick,.rb-settings{grid-template-columns:1fr}.rb-battlefield{grid-template-columns:52px 1fr 52px;gap:8px}.rb-avatar{width:48px;height:48px;border-width:3px;font-size:20px}.rb-word-card{min-height:190px;padding:15px}.rb-keyboard{display:flex}.rb-help{display:none}.rb-result-grid{grid-template-columns:1fr 1fr}.rb-fighters{gap:8px}.rb-arena{padding:14px 10px}.rb-load{display:block;margin:10px 0 0}.rb-kanji{font-size:42px} }

/* ============ 日语学习系统：中心页 ============ */
.jp-hub { max-width: 860px; margin: 0 auto; }
.jp-hero { display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px 28px; margin-bottom: 18px; box-shadow: var(--shadow); }
.jp-hero-icon { font-size: 46px; }
.jp-hero-title { font-size: 24px; color: var(--ink); margin-bottom: 4px; }
.jp-hero-sub { font-size: 13px; color: var(--muted); }
.jp-user-card { background: var(--accent-pink); border: 1px dashed #d9a48f; border-radius: 12px; padding: 18px 22px; margin-bottom: 22px; }
.jp-user-tip { font-size: 14px; color: #a8482c; margin-bottom: 10px; }
.jp-user-btns { display: flex; gap: 10px; }
.jp-user-info { display: flex; align-items: center; gap: 14px; }
.jp-user-avatar { font-size: 34px; }
.jp-user-detail { flex: 1; }
.jp-user-name { font-size: 15px; color: var(--ink); }
.jp-user-email { font-size: 13px; color: #a8482c; margin-top: 2px; }
.jp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.jp-feature-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px 20px; text-align: center; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.jp-feature-card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--ink); }
.jp-feature-card.coming { opacity: .75; }
.jp-feature-icon { font-size: 44px; margin-bottom: 12px; }
.jp-feature-title { font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.jp-feature-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.jp-feature-go {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 5px 18px;
  transition: background .15s, color .15s;
}
.jp-feature-card:not(.coming):hover .jp-feature-go { background: var(--accent); color: #fffdf8; }
.jp-feature-card.coming .jp-feature-go { color: var(--muted); border-color: var(--border); font-weight: 400; }

/* 导航上的日语学习系统按钮：当前页时亮起来 */
.jp-btn.active { background: var(--accent); color: #fffdf8 !important; } /* .jp-btn 的文字色带 !important，这里也要带上 */

/* ============ 登录墙（单词本 / 评论区共用） ============ */
.words-gate, .comment-guest { background: var(--card); border: 1px dashed #d9c4a8; border-radius: 12px; padding: 44px 20px; text-align: center; }
.gate-icon { font-size: 40px; margin-bottom: 8px; }
.gate-title { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.gate-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.gate-btns { display: flex; gap: 10px; justify-content: center; }

/* ============ 单词本 + 记忆卡片 ============ */
.words-page { max-width: 860px; margin: 0 auto; }
.wcat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.wcat-tab { padding: 6px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: 13px; cursor: pointer; transition: all .15s; }
.wcat-tab:hover { border-color: var(--accent); color: var(--accent); }
.wcat-tab.active { background: var(--accent); border-color: var(--accent); color: #fffdf8; }

.wcard-stage { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.wcard-nav { flex: 0 0 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: 22px; cursor: pointer; transition: all .15s; }
.wcard-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 记忆卡片：3D 翻面 */
.wcard { flex: 1; height: 240px; perspective: 1000px; cursor: pointer; }
.wcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.wcard.flipped .wcard-inner { transform: rotateY(180deg); }
.wcard-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.wcard-back { transform: rotateY(180deg); background: var(--accent-soft); }
.wcard-word { font-size: 40px; color: var(--ink); margin-bottom: 8px; letter-spacing: 2px; word-break: break-word; }
.wcard-word-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.wcard-word-row .wcard-word { margin-bottom: 0; }
.wcard-pitch { font-size: 14px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; background: var(--paper); }
.wcard-audio { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 14px; line-height: 1.4; transition: all 0.15s; }
.wcard-audio:hover { background: var(--accent-soft); border-color: var(--accent); }
.wcard-example { margin-top: 14px; font-size: 14px; line-height: 1.8; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 8px; }
.wcard-ex-label { display: inline-block; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; color: var(--muted); }
.wcard-ex-jp { color: var(--ink); font-size: 15px; word-break: break-word; }
.wcard-ex-zh { flex-basis: 100%; margin-top: 4px; color: var(--muted); font-size: 13px; }
.wlist-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.wlist-page-info { color: var(--muted); font-size: 14px; }
.wlist-pager .btn:disabled { opacity: .45; cursor: not-allowed; }
.wcard-kana { font-size: 16px; color: var(--muted); margin-bottom: 16px; }
.wcard-hint { font-size: 12px; color: #b5ab9a; }
.wcard-meaning { font-size: 26px; color: var(--ink); margin-bottom: 14px; word-break: break-word; text-align: center; }
.wcard-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.wchip { font-size: 12px; padding: 3px 12px; border-radius: 12px; }
.wchip.part { background: #fff; border: 1px solid var(--border); color: var(--muted); }
.wchip.cat { background: var(--accent); color: #fffdf8; }

.wcard-bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 26px; }
.wcard-counter { font-size: 14px; color: var(--muted); }

.wlist-title { font-size: 15px; color: var(--ink); margin-bottom: 12px; padding-left: 10px; border-left: 3px solid var(--accent); }
.wlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.wlist-item { display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; transition: border-color .15s, background .15s; font-size: 14px; color: var(--ink); }
.wlist-item:hover { border-color: var(--accent); }
.wli-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wli-head > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.wli-word { font-weight: 700; font-size: 19px; word-break: break-word; }
.wli-kana { font-size: 13px; color: var(--muted); word-break: break-word; }
.wli-meaning { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.65; word-break: break-word; }
.wli-pitch { align-self: flex-start; padding: 2px 7px; border-radius: 6px; background: var(--paper); color: var(--muted); font-size: 12px; }
.wli-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wli-tags span { padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.wli-audio { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 7px; background: #fff; padding: 4px 8px; cursor: pointer; }
.wli-audio:hover { border-color: var(--accent); background: var(--accent-soft); }
.wli-example { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding-top: 9px; border-top: 1px dashed var(--border); line-height: 1.55; }
.wli-example b { font-weight: 500; }
.wli-example span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

/* ============ 评论区 ============ */
.comment-section { margin-top: 28px; }
.comment-title { font-size: 17px; color: var(--ink); margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--accent); }
.comment-form { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.comment-who { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.comment-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--ink); resize: vertical; box-sizing: border-box; font-family: inherit; }
.comment-input:focus { outline: none; border-color: var(--accent); }
.comment-form-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.comment-msg { font-size: 13px; color: #b0352b; }
.comment-guest { margin-bottom: 18px; }
.comment-none { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 0; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.comment-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }
.comment-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.comment-time { font-size: 12px; color: #b5ab9a; margin-left: auto; }
.comment-content { font-size: 14px; color: var(--ink); line-height: 1.7; word-break: break-word; }

/* ============ 评论回复 + 点赞 ============ */
.comment-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.comment-like-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; padding: 2px 4px; font-size: 13px; color: var(--muted); cursor: pointer; border-radius: 6px; font-family: inherit; }
.comment-like-btn:hover { color: var(--accent-dark); }
.comment-like-btn.liked { color: #d66a4a; font-weight: 700; }
.comment-reply-btn { border: none; background: none; padding: 2px 4px; font-size: 13px; color: var(--accent-dark); cursor: pointer; border-radius: 6px; font-family: inherit; }
.comment-reply-btn:hover { text-decoration: underline; }
.comment-reply-item { margin-left: 44px; margin-top: 10px; background: var(--bg); }
.comment-reply-to { font-size: 12px; color: var(--accent-dark); }
.comment-reply-box { margin-top: 8px; }
.comment-reply-form { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--bg); }
.comment-reply-who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 760px) {
  .comment-reply-item { margin-left: 20px; }
}

/* 文章正文里的表格（编辑器插入的表格） */
.article-content table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.article-content td, .article-content th { border: 1px solid var(--border); padding: 6px 10px; font-size: 14px; }

@media (max-width: 760px) {
  .jp-grid { grid-template-columns: 1fr; }
  .wcard { height: 260px; }
  .wcard-word { font-size: 30px; }
  .wcard-meaning { font-size: 22px; }
  /* 内容比卡片高时在卡片里滚动，不会溢出到框外（auto 边距保证短内容仍然居中） */
  .wcard-face { overflow-y: auto; justify-content: flex-start; }
  .wcard-face > * { margin-top: auto; margin-bottom: auto; }
  .wcard-stage { gap: 8px; }
  .wcard-nav { flex: 0 0 34px; height: 34px; font-size: 18px; }
}

/* ============ 学习中心页：手账风三张桌签 ============ */
/* 卡片像桌面上的便签：微微歪一点、贴上胶带、敬请期待用印章 */
.jp-grid { align-items: start; }
.jp-feature-card { position: relative; padding-top: 30px; }
.jp-card-tilt-l { transform: rotate(-0.8deg); }
.jp-card-tilt-r { transform: rotate(0.8deg); }
.jp-card-tilt-l:hover, .jp-card-tilt-r:hover { transform: rotate(0) translateY(-3px); }
.jp-feature-card.coming { cursor: default; }

/* 和纸胶带：横在卡片上缘 */
.jp-card-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px;
  height: 26px;
  opacity: .85;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.jp-tape-blue { background: rgba(122, 162, 197, .55); }
.jp-tape-pink { background: rgba(226, 156, 168, .55); }
.jp-tape-green { background: rgba(146, 178, 143, .55); }
.jp-tape-yellow { background: rgba(219, 190, 120, .55); }

/* 印章：筹备中（像盖在纸上的红章） */
.jp-seal {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border: 2px solid #b8502e;
  border-radius: 6px;
  color: #b8502e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  transform: rotate(-6deg);
  opacity: .8;
}

/* 中心页标题：书卷气一点 */
.jp-hero-title { font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif SC", "SimSun", serif; font-size: 26px; }

/* ============ 单词本：查词搜索框 ============ */
.wsearch {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  margin-bottom: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.wsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wsearch-icon { font-size: 16px; }
.wsearch-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}

/* ============ 词典查询页 ============ */
.dict-sub {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
  margin: 2px 0 14px;
}
.dict-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dict-search { flex: 1; min-width: 260px; margin-bottom: 0; position: relative; }
.dict-search .wsearch-input { min-width: 0; font-size: 16px; }
.dict-clear-btn { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 18px; line-height: 1; }
.dict-clear-btn:hover { color: var(--accent); background: var(--accent-soft); }
.dict-recent { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.dict-recent[hidden] { display: none; }
.dict-recent-label { color: var(--ink-soft); font-size: 13px; }
.dict-recent-chip { border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--ink); padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.dict-recent-chip:hover { border-color: var(--accent); color: var(--accent); }
.dict-recent-clear { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.dict-result-summary { margin: 2px 2px 12px; color: var(--ink-soft); font-size: 13px; }
/* 词典多选：按钮 + 下拉勾选面板 */
.dict-pick { position: relative; }
.dict-pick-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.dict-pick-btn:hover { border-color: var(--accent); }
.dict-pick-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 14px;
}
.dict-pick-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.dict-pick-all, .dict-pick-none {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.dict-pick-all:hover, .dict-pick-none:hover { border-color: var(--accent); color: var(--accent); }
.dict-pick-groups { max-height: 300px; overflow-y: auto; }
.dict-pick-group { margin-bottom: 10px; }
.dict-pick-gname {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.dict-pick-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.dict-pick-opt:hover { background: var(--accent-soft); }
.dict-pick-cnt { color: var(--ink-soft); font-size: 12px; }
.dict-pick-ok { width: 100%; margin-top: 10px; }
/* 总览：大区块 + 词典卡片 */
.dict-block-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.dict-box-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.dict-group { margin-bottom: 14px; }
.dict-group-name { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.dict-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dict-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg);
  transition: border-color .15s, transform .15s;
}
.dict-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.dict-card-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.dict-card-count { font-size: 12px; color: var(--accent); margin: 3px 0 6px; }
.dict-card-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.6; min-height: 38px; }
.dict-card-go { font-size: 12px; color: var(--accent); margin-top: 8px; font-weight: 700; }
/* 单本浏览：词典信息条 + 词条列表 + 翻页 */
.dict-browse-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dict-browse-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.dict-browse-count { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 10px; }
.dict-browse-desc { font-size: 13px; color: var(--ink-soft); }
.dict-browse-hint {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 12px;
}
.dict-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.dict-list-item {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.dict-list-item:hover { border-color: var(--accent); color: var(--accent); }
.dict-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.dict-pager-info { font-size: 13px; color: var(--ink-soft); }
/* 返回按钮 */
.dict-view-back { margin-bottom: 10px; }
.dict-back-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.dict-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 36px 16px;
  font-size: 14px;
}
/* 词条卡片（多本词典时上下堆叠） */
.dict-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
/* 前缀建议块 */
.dict-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 14px;
}
.dict-block-head {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.dict-block-name { font-size: 13px; font-weight: 700; color: var(--accent); }
.dict-entry-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.dict-entry-tools { margin-left: auto; display: flex; gap: 6px; }
.dict-copy-btn { border: 1px solid var(--border); background: var(--bg); color: var(--ink-soft); border-radius: 999px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.dict-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.dict-entry-word {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif SC", serif;
}
.dict-entry-source {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 10px;
}
/* 词条正文（mdx 转换来的 HTML，转换时已消毒） */
.dict-def {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.dict-def p { margin: 6px 0; }
.dict-def .hl { color: var(--accent); font-weight: 700; }
.dict-def b, .dict-def strong { color: #8a4f2d; }
.dict-def img { display: none; }
.dict-def a { color: var(--accent); pointer-events: none; }
/* 前缀建议 */
.dict-suggests { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.dict-suggest-tip { color: var(--ink-soft); font-size: 13px; margin-bottom: 12px; }
.dict-suggest-chip {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.dict-suggest-chip:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .dict-pick { width: 100%; }
  .dict-pick-btn { width: 100%; }
  .dict-pick-panel { width: 100%; }
  .dict-entry, .dict-block { padding: 14px 16px; }
}

/* ============ 问题（四选一文章）：文章页直接作答 ============ */
/* 「问题」小标签（首页卡片 / 文章页的信息条里） */
.quiz-badge {
  background: linear-gradient(145deg, #0a2b67, #18bfee);
  color: #fffdf8;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

/* 问题卡：暖纸色，和白色文章正文区分开，像一张便签 */
.quiz-card {
  background: #fdf6ea;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.quiz-intro { font-size: 15px; color: var(--muted); line-height: 1.9; margin-bottom: 18px; word-break: break-word; }
.quiz-intro p { margin-bottom: 8px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-options[hidden] { display: none; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-family: inherit;
  line-height: 1.7;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-option:disabled { cursor: default; opacity: .85; }
.quiz-option-label {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}
.quiz-option-text { flex: 1; word-break: break-word; }
.quiz-option-correct {
  background: #eaf6ee;
  border-color: #4e9a6b;
}
.quiz-option-correct .quiz-option-label { background: #4e9a6b; border-color: #4e9a6b; color: #fff; }
.quiz-option-chosen { border-style: dashed; border-color: var(--accent); }

/* 选完出现的答案解析 */
.quiz-result {
  margin-top: 20px;
  background: var(--accent-soft);
  border: 1px dashed #d9a48f;
  border-radius: 10px;
  padding: 16px 18px;
}
.quiz-answer-line { font-size: 14px; color: var(--accent-dark); margin-bottom: 8px; }
.quiz-explain-text { font-size: 14px; color: var(--ink); line-height: 1.8; word-break: break-word; }
.quiz-stats { margin-top: 8px; font-size: 13px; color: var(--muted); }

.quiz-listening-player { margin-bottom: 18px; }
.quiz-listening-label { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.quiz-listening-player audio { display: block; width: 100%; }
.quiz-listening-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.quiz-error { color: #a32b2b; font-size: 14px; line-height: 1.7; }
.quiz-listening-transcript { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.quiz-listening-transcript h3 { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.quiz-listening-transcript-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink); line-height: 1.9; }

/* 並び替え：碎片池 + 槽位，放满后点「确定」提交 */
.quiz-order-slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.quiz-order-slot { flex: 1; min-width: 90px; min-height: 44px; padding: 8px 12px; border: 2px dashed var(--border); border-radius: 8px; color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; word-break: break-word; box-sizing: border-box; }
.quiz-order-slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.quiz-order-pool { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-order-piece { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 14px; cursor: pointer; font-family: inherit; }
.quiz-order-piece:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-order-piece.used { opacity: .45; cursor: default; }
.quiz-order-piece-text { word-break: break-word; }
.quiz-order-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quiz-order-hint { font-size: 13px; color: var(--muted); }

/* 読解题干：阅读段落框，行距放宽 */
.quiz-reading-text { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; line-height: 2.1; }
.quiz-reading-questions { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.quiz-reading-question { border-top: 1px solid var(--border); padding-top: 18px; }
.quiz-reading-question h3 { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 16px; line-height: 1.7; }
.quiz-reading-question h3 > span { flex: none; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }

@media (max-width: 760px) {
  .quiz-card { padding: 18px 16px; }
  .quiz-order-slot { min-width: 60px; padding: 6px 8px; font-size: 13px; }
  .quiz-order-piece { padding: 6px 10px; font-size: 13px; }
}

/* JLPT 真题作答页：参考考试平台的信息结构，保留站点原有配色 */
.quiz-detail-layout { display: block; max-width: 1240px; }
.quiz-detail-layout > .detail-main { width: 100%; }
.quiz-detail-layout > .sidebar { display: none; }
.article-detail.quiz-exam-page { padding: 0; overflow: hidden; background: #f7f4ef; border: 1px solid #e8ded2; box-shadow: 0 14px 40px rgba(88, 63, 43, .08); }
.quiz-exam-head { min-height: 72px; padding: 0 26px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; background: #fff; border-bottom: 1px solid #eee5dc; }
.quiz-exam-head > div { display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.quiz-exam-head span { color: #a18e7c; font-size: 12px; letter-spacing: .08em; }
.quiz-exam-head strong { color: var(--ink); font-size: 16px; }
.quiz-exam-head em { justify-self: end; min-width: 66px; padding: 7px 12px; border-radius: 999px; background: #f8eee7; color: var(--accent); text-align: center; font-size: 13px; font-style: normal; font-weight: 700; }
.quiz-exam-back { color: #766a60; text-decoration: none; font-size: 13px; font-weight: 600; }
.quiz-exam-back:hover { color: var(--accent); }
.quiz-progress { height: 4px; background: #eee6de; }
.quiz-progress i { display: block; height: 100%; background: linear-gradient(90deg, #c4512d, #df8b67); border-radius: 0 999px 999px 0; }
.quiz-exam-grid { display: grid; grid-template-columns: minmax(0, 1fr) 248px; align-items: start; gap: 22px; padding: 26px; }
.quiz-exam-main { min-width: 0; padding: 28px 32px; border: 1px solid #e9dfd5; border-radius: 14px; background: #fff; }
.quiz-exam-main > .detail-title { position: relative; margin: 0 0 12px; padding: 0 0 0 48px; font-size: 22px; line-height: 1.65; }
.quiz-exam-main > .detail-title::before { content: "問"; position: absolute; top: 2px; left: 0; display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent); color: #fff; font: 700 15px/1 serif; }
.quiz-exam-main > .detail-meta { margin-left: 48px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid #eee5dc; }
.quiz-exam-main > .detail-meta .date,
.quiz-exam-main > .detail-meta .author,
.quiz-exam-main > .detail-meta .detail-print-btn { display: none; }
.quiz-exam-page .quiz-badge { background: #f5e9e1; color: var(--accent); }
.quiz-exam-page .quiz-card { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.quiz-exam-page .quiz-intro:not(.quiz-reading-text) { padding: 16px 18px; border-radius: 10px; background: #faf8f4; color: #6f6257; }
.quiz-exam-page .quiz-reading-text { margin-bottom: 24px; padding: 22px 24px; border-color: #e8ded2; border-radius: 12px; background: #fcfbf8; color: #4b443e; }
.quiz-exam-page .quiz-option { min-height: 58px; align-items: center; padding: 13px 16px; border-color: #e5ddd5; border-radius: 10px; background: #fff; }
.quiz-exam-page .quiz-option:hover:not(:disabled) { border-color: #ce6a48; background: #fff8f4; transform: translateX(2px); }
.quiz-exam-page .quiz-option-label { flex-basis: 34px; width: 34px; height: 34px; border-color: #d9cec4; background: #f8f5f1; }
.quiz-page-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid #eee5dc; }
.quiz-page-actions a { min-width: 96px; padding: 10px 16px; border: 1px solid #ded3c8; border-radius: 8px; color: #6e6258; text-align: center; text-decoration: none; font-size: 14px; }
.quiz-page-actions a:hover { border-color: var(--accent); color: var(--accent); }
.quiz-page-actions a.next { border-color: var(--accent); background: var(--accent); color: #fff; }
.quiz-sheet { position: sticky; top: 88px; padding: 20px; border: 1px solid #e9dfd5; border-radius: 14px; background: #fff; }
.quiz-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid #eee5dc; }
.quiz-sheet-head div { display: grid; gap: 3px; }
.quiz-sheet-head small { color: #a18e7c; font-size: 11px; letter-spacing: .12em; }
.quiz-sheet-head strong { color: var(--ink); font-size: 14px; }
.quiz-sheet-head > span { color: var(--accent); font-size: 12px; font-weight: 700; }
.quiz-sheet-legend { display: flex; align-items: center; gap: 6px; margin: 14px 0 10px; color: #9b8c7f; font-size: 11px; }
.quiz-sheet-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.quiz-sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; max-height: 430px; overflow-y: auto; padding-right: 2px; }
.quiz-sheet-grid a { display: inline-flex; aspect-ratio: 1; align-items: center; justify-content: center; border: 1px solid #e1d8cf; border-radius: 7px; background: #faf8f5; color: #74685d; text-decoration: none; font-size: 12px; }
.quiz-sheet-grid a:hover { border-color: #ce6a48; color: var(--accent); }
.quiz-sheet-grid a.active { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }

@media (max-width: 700px) {
  .quiz-exam-grid { grid-template-columns: 1fr; padding: 18px; }
  .quiz-sheet { position: static; order: -1; }
  .quiz-sheet-grid { grid-template-columns: repeat(11, 1fr); max-height: 124px; }
}
@media (max-width: 640px) {
  .quiz-exam-head { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .quiz-exam-head > div { grid-column: 1 / -1; grid-row: 1; justify-content: flex-start; }
  .quiz-exam-back { grid-row: 2; }
  .quiz-exam-head em { grid-row: 2; }
  .quiz-exam-grid { padding: 10px; }
  .quiz-exam-main { padding: 20px 16px; }
  .quiz-exam-main > .detail-title { padding-left: 42px; font-size: 18px; }
  .quiz-exam-main > .detail-meta { margin-left: 42px; }
  .quiz-sheet { padding: 15px; }
  .quiz-sheet-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ================= 将棋（shogi.php） ================= */
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-danger-outline { background: var(--card); color: #c0392b; border: 1px solid #c0392b; }
.btn-danger-outline:hover { background: #fbe9e7; }

/* ---- 大厅 ---- */
.shogi-head-actions { display: flex; gap: 10px; align-items: center; }
.shogi-need-login { text-align: center; padding: 48px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 16px; }
.shogi-need-login p { color: var(--muted); margin: 10px 0 18px; }
.shogi-lobby-icon { font-size: 42px; }
.shogi-lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.shogi-lobby-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.shogi-lobby-card .shogi-lobby-icon { display: block; margin-bottom: 8px; }
.shogi-lobby-title { font-family: var(--font-serif); font-size: 18px; margin-bottom: 6px; }
.shogi-lobby-desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.shogi-btn-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.shogi-join-row { display: flex; gap: 8px; justify-content: center; }
.shogi-join-row input {
  width: 130px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--paper); text-align: center; font-size: 16px; letter-spacing: 3px; text-transform: uppercase;
}
.shogi-msg { margin-top: 12px; font-size: 14px; color: var(--accent); }
.shogi-msg-err { color: #c0392b; }
.shogi-msg-gray { color: var(--muted); }
.shogi-myroom { display: flex; gap: 10px; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 14px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }
.shogi-sub-title { font-size: 14px; color: var(--muted); margin: 18px 0 8px; text-align: left; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.shogi-friend-add { display: flex; gap: 8px; margin-bottom: 10px; }
.shogi-friend-add input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); }
.shogi-friend-list { text-align: left; }
.shogi-friend-empty { color: var(--muted); font-size: 13px; text-align: center; }
.shogi-friend-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.shogi-friend-name { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.shogi-friend-ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.shogi-friend-ops { display: flex; gap: 6px; }
.shogi-outgoing { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.shogi-invites { text-align: left; }
.shogi-invite-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--border); font-size: 14px; flex-wrap: wrap; }

/* 邀请好友对局弹窗 */
.shogi-friend-pick-box { max-width: 380px; }
.shogi-friend-pick-list { padding: 8px 20px 16px; max-height: 55vh; overflow-y: auto; }
.shogi-friend-pick-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--border); font-size: 14px; }
.shogi-friend-pick-item:last-child { border-bottom: none; }
.shogi-friend-pick-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 10px 0; }

/* 好友聊天弹窗 */
.shogi-chat-box { max-width: 420px; }
.shogi-chat-list { padding: 8px 20px; height: 45vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.shogi-chat-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto; }
.shogi-chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.shogi-chat-mine { align-self: flex-end; align-items: flex-end; }
.shogi-chat-bubble { background: var(--card, #f5f5f7); border: 1px solid var(--border); border-radius: 12px; padding: 7px 12px; font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.shogi-chat-mine .shogi-chat-bubble { background: var(--accent); border-color: var(--accent); color: #fffdf8; }
.shogi-chat-time { color: var(--muted); font-size: 11px; margin: 2px 4px 0; }
.shogi-chat-err { color: #c0392b; font-size: 13px; text-align: center; }
.shogi-chat-input { display: flex; gap: 8px; padding: 10px 20px 16px; border-top: 1px solid var(--border); }
.shogi-chat-input input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); }

/* ---- 对局区 ---- */
.shogi-room-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.shogi-room-code { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shogi-room-code strong { font-size: 18px; letter-spacing: 4px; font-family: monospace; }
.shogi-label { color: var(--muted); font-size: 13px; }
.shogi-room-status { color: var(--muted); font-size: 14px; }
.shogi-room-actions { display: flex; gap: 8px; }

.shogi-waiting { text-align: center; padding: 40px 20px; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.shogi-waiting-icon { font-size: 40px; display: inline-block; }
.shogi-waiting-icon.spin { animation: shogi-spin 1.2s linear infinite; }
@keyframes shogi-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.shogi-waiting p { color: var(--muted); margin-top: 8px; }
.shogi-waiting p::after { content: ''; display: inline-block; width: 18px; text-align: left; animation: shogi-dots 1.5s steps(4) infinite; }
@keyframes shogi-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.shogi-proposal { background: var(--accent-pink); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.shogi-prop-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; padding: 3px 0; flex-wrap: wrap; }

/* ---- 持駒台 ---- */
.shogi-hand { display: flex; gap: 6px; justify-content: center; padding: 6px; min-height: 44px; }
.shogi-hand-top { margin-bottom: 8px; }
.shogi-hand-slot { width: 36px; height: 44px; position: relative; cursor: pointer; }
/* 持驹数量角标：显示在棋子右上角外面 */
.shogi-hand-count {
  position: absolute; top: -5px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  background: #c0392b; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 9px;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 2;
  pointer-events: none;
}
.shogi-hand-slot .shogi-hand-pc {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 18px; color: #2a140b; /* 先手：红木棋子墨字 */
  --piece-glow: rgba(45, 15, 5, 0.45);
  background:
    repeating-linear-gradient(88deg, rgba(90, 30, 10, 0.14) 0 1px, rgba(0, 0, 0, 0) 1px 5px),
    repeating-linear-gradient(92deg, rgba(60, 18, 5, 0.20) 0 2px, rgba(0, 0, 0, 0) 2px 11px),
    linear-gradient(170deg, #d4764f 0%, #c05534 42%, #a63c1f 72%, #8f2f15 100%);
  clip-path: polygon(50% 0%, 52% 3%, 57% 10%, 64% 20%, 72% 32%, 80% 46%, 87% 61%, 92% 75%, 95% 87%, 97% 96%, 96% 100%, 4% 100%, 3% 96%, 5% 87%, 8% 75%, 13% 61%, 20% 46%, 28% 32%, 36% 20%, 43% 10%, 48% 3%);
  box-shadow: inset 0 2px 3px rgba(255, 225, 190, 0.5), inset 0 -6px 8px rgba(60, 15, 0, 0.55), inset 2px 0 3px rgba(255, 190, 150, 0.25), inset -2px 0 3px rgba(60, 15, 0, 0.4);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)) drop-shadow(0 5px 3px var(--piece-glow));
  text-shadow: 0 1px 0 rgba(255, 205, 165, 0.45), 0 -1px 1px rgba(50, 10, 0, 0.75);
}
.shogi-hand-slot.empty { cursor: default; opacity: 0.35; }
.shogi-hand-slot.empty .shogi-hand-pc { font-size: 12px; color: var(--muted); }
.shogi-hand-slot.sel .shogi-hand-pc { filter: brightness(1.1) drop-shadow(0 0 0 2px #f9d976) drop-shadow(0 5px 3px var(--piece-glow)); }
.shogi-hand-slot.rot .shogi-hand-pc { transform: rotate(180deg); }
.shogi-hand-slot.dark .shogi-hand-pc {
  color: #efe6d4; /* 后手：黑檀棋子银字 */
  --piece-glow: rgba(0, 0, 0, 0.6);
  background:
    repeating-linear-gradient(88deg, rgba(255, 255, 255, 0.06) 0 1px, rgba(0, 0, 0, 0) 1px 5px),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.3) 0 2px, rgba(0, 0, 0, 0) 2px 10px),
    linear-gradient(170deg, #5b5348 0%, #453d33 42%, #322b23 72%, #26211b 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.16), inset 0 -6px 8px rgba(0, 0, 0, 0.7), inset 2px 0 3px rgba(255, 255, 255, 0.07), inset -2px 0 3px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), 0 -1px 1px rgba(0, 0, 0, 0.95);
}

/* ---- 棋盘 ---- */
.shogi-board-wrap { position: relative; display: flex; justify-content: center; }
.shogi-board {
  width: min(88vw, 560px);
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  aspect-ratio: 1;
  background:
    repeating-linear-gradient(90deg, rgba(140, 90, 30, 0.07) 0 2px, rgba(0, 0, 0, 0) 2px 26px),
    repeating-linear-gradient(0deg, rgba(255, 235, 190, 0.12) 0 1px, rgba(0, 0, 0, 0) 1px 14px),
    #d9a45b;
  border: 6px solid #b8823d;
  border-radius: 4px;
  box-shadow: var(--shadow-hover);
  padding: 4px;
  gap: 0;
}
.shogi-cell { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.shogi-cell::before { content: ''; position: absolute; inset: 0; border: 1px solid rgba(120, 72, 20, 0.5); pointer-events: none; }
.shogi-cell.sel::after { content: ''; position: absolute; inset: 0; background: rgba(249, 217, 118, 0.55); pointer-events: none; }
.shogi-cell.lastmove::after { content: ''; position: absolute; inset: 0; background: rgba(255, 240, 200, 0.45); pointer-events: none; }
.shogi-cell.lastmove.sel::after { background: rgba(249, 217, 118, 0.7); }
.shogi-piece {
  width: 93%; height: 97%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(15px, 4.2vw, 28px); color: #2a140b; /* 先手：红木棋子墨字 */
  --piece-glow: rgba(45, 15, 5, 0.45);
  background:
    repeating-linear-gradient(88deg, rgba(90, 30, 10, 0.14) 0 1px, rgba(0, 0, 0, 0) 1px 5px),
    repeating-linear-gradient(92deg, rgba(60, 18, 5, 0.20) 0 2px, rgba(0, 0, 0, 0) 2px 11px),
    linear-gradient(170deg, #d4764f 0%, #c05534 42%, #a63c1f 72%, #8f2f15 100%);
  clip-path: polygon(50% 0%, 52% 3%, 57% 10%, 64% 20%, 72% 32%, 80% 46%, 87% 61%, 92% 75%, 95% 87%, 97% 96%, 96% 100%, 4% 100%, 3% 96%, 5% 87%, 8% 75%, 13% 61%, 20% 46%, 28% 32%, 36% 20%, 43% 10%, 48% 3%);
  box-shadow: inset 0 2px 3px rgba(255, 225, 190, 0.5), inset 0 -6px 8px rgba(60, 15, 0, 0.55), inset 2px 0 3px rgba(255, 190, 150, 0.25), inset -2px 0 3px rgba(60, 15, 0, 0.4);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)) drop-shadow(0 5px 3px var(--piece-glow));
  text-shadow: 0 1px 0 rgba(255, 205, 165, 0.45), 0 -1px 1px rgba(50, 10, 0, 0.75);
  z-index: 1;
  cursor: pointer;
  user-select: none;
  transition: filter 0.15s;
}
/* 吃子动画：被吃的棋子飞向持驹台（JS 里用 Web Animations 驱动位移和渐隐） */
.shogi-piece.fly-cap {
  position: absolute;
  width: clamp(30px, 9vw, 52px); height: clamp(32px, 9.7vw, 56px);
  font-size: clamp(16px, 4.2vw, 28px);
  margin: 0;
  z-index: 30;
  pointer-events: none;
}
.shogi-piece:hover { filter: brightness(1.08) drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)) drop-shadow(0 5px 3px var(--piece-glow)); }
.shogi-piece.rot { transform: rotate(180deg); }
.shogi-piece.dark {
  color: #efe6d4; /* 后手：黑檀棋子银字 */
  --piece-glow: rgba(0, 0, 0, 0.6);
  background:
    repeating-linear-gradient(88deg, rgba(255, 255, 255, 0.06) 0 1px, rgba(0, 0, 0, 0) 1px 5px),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.3) 0 2px, rgba(0, 0, 0, 0) 2px 10px),
    linear-gradient(170deg, #5b5348 0%, #453d33 42%, #322b23 72%, #26211b 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.16), inset 0 -6px 8px rgba(0, 0, 0, 0.7), inset 2px 0 3px rgba(255, 255, 255, 0.07), inset -2px 0 3px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), 0 -1px 1px rgba(0, 0, 0, 0.95);
}
.shogi-piece.promo { color: #e3b13c; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.4), 0 -1px 1px rgba(40, 15, 0, 0.8), 0 0 4px rgba(227, 177, 60, 0.5); }
.shogi-piece.promo.dark { color: #e8c25a; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), 0 -1px 1px rgba(0, 0, 0, 0.95), 0 0 4px rgba(232, 194, 90, 0.45); }
.shogi-cell.sel .shogi-piece { filter: brightness(1.1) drop-shadow(0 0 0 2px #f2c94c) drop-shadow(0 5px 3px var(--piece-glow)); }
.shogi-cell.capdot .shogi-piece { opacity: 0.92; }
.shogi-dot {
  width: 26%; aspect-ratio: 1; border-radius: 50%;
  background: rgba(60, 110, 90, 0.75); z-index: 1; pointer-events: none;
}
.shogi-capdot {
  width: 30%; aspect-ratio: 1; border-radius: 50%;
  border: 3px solid rgba(176, 53, 42, 0.8); z-index: 1; pointer-events: none;
}

/* ---- 状态栏 / 操作 / 表情 ---- */
.shogi-turn { text-align: center; padding: 10px 0 4px; font-size: 15px; color: var(--muted); }
.shogi-turn-mine { color: var(--accent); font-weight: 700; }
.shogi-check { display: inline-block; margin-left: 10px; color: #fff; background: #c0392b; border-radius: 4px; padding: 2px 10px; font-size: 13px; animation: shogi-blink 1s steps(2) infinite; }
@keyframes shogi-blink { 50% { opacity: 0.55; } }
.shogi-actions { display: flex; gap: 10px; justify-content: center; padding: 8px 0; }
.shogi-emoji-bar { display: flex; gap: 4px; justify-content: center; padding: 6px 0; flex-wrap: wrap; }
.shogi-emoji-label { color: var(--muted); font-size: 13px; align-self: center; margin-right: 4px; }
.shogi-emoji-btn { font-size: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 3px 7px; cursor: pointer; transition: transform 0.15s; }
.shogi-emoji-btn:hover { transform: translateY(-3px) scale(1.12); }
.shogi-emoji-float {
  position: absolute; bottom: 12%; font-size: 42px; z-index: 20; pointer-events: none;
  animation: shogi-emoji-rise ease-out forwards;
}
@keyframes shogi-emoji-rise {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  15% { opacity: 1; transform: translateY(-14px) scale(1.15); }
  100% { transform: translateY(-260px) scale(1); opacity: 0; }
}

/* ---- 对局结束 ---- */
.shogi-gameover { text-align: center; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 20px; margin-top: 12px; box-shadow: var(--shadow-hover); }
.shogi-gameover-text { font-family: var(--font-serif); font-size: 20px; margin-bottom: 14px; }

/* ---- 成子弹窗 ---- */
.shogi-promote-box { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--card); border: 1.5px solid var(--accent); border-radius: var(--radius); padding: 20px 28px; z-index: 60; box-shadow: var(--shadow-hover); text-align: center; animation: shogi-promote-pop 0.18s ease-out; }
.shogi-promote-box p { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.shogi-promote-btns { display: flex; gap: 14px; justify-content: center; }
.shogi-promote-btns .btn { min-width: 110px; min-height: 52px; font-size: 18px; padding: 10px 22px; }
@keyframes shogi-promote-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---- 教程弹窗 ---- */
.shogi-tutorial-box { max-width: 520px; padding-bottom: 16px; }
.tut-step { color: var(--muted); font-size: 13px; padding: 2px 20px; }
.tut-body { padding: 8px 20px 4px; }
.tut-title { font-family: var(--font-serif); font-size: 17px; margin-bottom: 8px; }
.tut-text { font-size: 14px; line-height: 1.7; color: var(--ink); }
.tut-must { margin-top: 10px; font-size: 13px; color: #c0392b; }
.tut-nav { display: flex; gap: 10px; justify-content: center; padding: 12px 20px 0; }
.tut-diagram {
  width: 220px; margin: 0 auto 12px; display: grid; grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1; background: #d9a45b; border: 3px solid #b8823d; border-radius: 3px; padding: 2px;
}
.tut-cell { position: relative; display: flex; align-items: center; justify-content: center; }
.tut-cell::before { content: ''; position: absolute; inset: 0; border: 1px solid rgba(120, 72, 20, 0.5); pointer-events: none; }
.tut-piece {
  font-family: var(--font-serif); font-weight: 700; font-size: 16px; color: #2a140b; z-index: 1;
  width: 93%; height: 97%; display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(88deg, rgba(90, 30, 10, 0.14) 0 1px, rgba(0, 0, 0, 0) 1px 5px),
    repeating-linear-gradient(92deg, rgba(60, 18, 5, 0.20) 0 2px, rgba(0, 0, 0, 0) 2px 11px),
    linear-gradient(170deg, #d4764f 0%, #c05534 42%, #a63c1f 72%, #8f2f15 100%);
  clip-path: polygon(50% 0%, 52% 3%, 57% 10%, 64% 20%, 72% 32%, 80% 46%, 87% 61%, 92% 75%, 95% 87%, 97% 96%, 96% 100%, 4% 100%, 3% 96%, 5% 87%, 8% 75%, 13% 61%, 20% 46%, 28% 32%, 36% 20%, 43% 10%, 48% 3%);
  box-shadow: inset 0 2px 3px rgba(255, 225, 190, 0.5), inset 0 -6px 8px rgba(60, 15, 0, 0.55), inset 2px 0 3px rgba(255, 190, 150, 0.25), inset -2px 0 3px rgba(60, 15, 0, 0.4);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)) drop-shadow(0 5px 3px rgba(45, 15, 5, 0.45));
  text-shadow: 0 1px 0 rgba(255, 205, 165, 0.45), 0 -1px 1px rgba(50, 10, 0, 0.75);
}
.tut-cell.tut-dot::after { content: ''; position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: rgba(60, 110, 90, 0.7); }

/* ---- 小屏适配 ---- */
@media (max-width: 760px) {
  .shogi-lobby-grid { grid-template-columns: 1fr; }
  .shogi-room-top { flex-direction: column; align-items: flex-start; }
  .shogi-board { width: min(94vw, 520px); }
  .shogi-piece { font-size: clamp(13px, 4.4vw, 24px); }
  .shogi-emoji-btn { font-size: 18px; }
  .shogi-hand-slot { width: 30px; height: 38px; }
  .shogi-hand-slot .shogi-hand-pc { font-size: 15px; }
}

/* ============ 文章打印：只打正文（导航、侧栏、评论、按钮都隐藏） ============ */
@media print {
  .navbar, .sidebar, .comment-section, .detail-back, .site-footer,
  .modal-overlay, .quiz-options .btn, .detail-print-btn { display: none !important; }
  .detail-layout { display: block !important; }
  .detail-main { width: 100% !important; max-width: none !important; }
  body, .page-main { background: #fff !important; }
  .article-detail, .quiz-card { box-shadow: none !important; border: none !important; }
  .detail-cover, .att-preview-img { max-width: 100% !important; }
  .article-content, .quiz-intro { font-size: 15px !important; }
}

/* ============ 富文本编辑器（后台和投稿页共用，Word 风格工具栏） ============ */
.editor-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 14px; background: var(--card); }
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  background: #f4eddf;
  border-bottom: 1px solid var(--border);
}
.editor-toolbar button {
  border: 1px solid transparent;
  background: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.editor-toolbar button:hover { background: #e8dcc7; }
.editor-toolbar button:focus-visible, .editor-toolbar select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.et-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.editor-toolbar select {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  max-width: 96px;
}
.editor-toolbar select:hover { border-color: var(--accent); }
.et-color {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.et-color:hover { background: #e8dcc7; }
.et-color input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
}
.editor-content {
  min-height: 260px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px;
  outline: none;
  font-size: 14px;
  line-height: 1.8;
  background: var(--card);
}
.editor-content p, .editor-content div { margin: 0 0 .7em; }
.editor-content ruby { ruby-position: over; }
.editor-content rt { font-size: .55em; color: var(--ink-soft); }
/* 空编辑器时显示占位提示（placeholder 效果） */
.editor-content:empty::before { content: attr(data-ph); color: #a99c87; }
.editor-content img { max-width: 100%; border-radius: 6px; }
.editor-content table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.editor-content td, .editor-content th { border: 1px solid var(--border); padding: 6px 10px; font-size: 14px; }

/* ============ 投稿页：多附件列表（每个文件一条进度条） ============ */
.share-file-hint { color: #a99c87; font-size: 13px; }
.share-file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.share-file-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.share-file-icon { font-size: 18px; line-height: 1.4; }
.share-file-item-body { flex: 1; min-width: 0; }
.share-file-item-name {
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
  margin-bottom: 4px;
}
.share-file-item-preview { margin-top: 8px; }
.share-file-item .share-upload-pct { font-size: 12px; color: #a99c87; margin-top: 2px; }
.share-file-item .share-upload-pct.fail { color: #c0392b; }
.share-file-item .share-file-remove {
  flex: none;
  border: none;
  background: none;
  color: #a99c87;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.share-file-item .share-file-remove:hover { color: #c0392b; background: #f6e8e4; }

/* ============ 首页倒计时：可多个，竖着排 ============ */
.countdown-list { display: flex; flex-direction: column; gap: 10px; }

/* ============ 文章正文里的链接（自动识别出来的网址） ============ */
.article-content a, .quiz-intro a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}
.article-content a:hover, .quiz-intro a:hover { opacity: .8; }

/* 中文语法卡：突出接续、用法、例句和关联句型 */
.grammar-clean { display: grid; gap: 18px; }
.grammar-clean > section { padding: 18px 20px; border: 1px solid #eadfd3; border-radius: 13px; background: #fffdfa; }
.grammar-clean > section h3 { margin: 0 0 10px; color: #b94e2e; font-size: 14px; letter-spacing: .08em; }
.grammar-clean > section p { margin: 0; color: #4d443d; line-height: 1.85; }
.grammar-clean-summary { background: linear-gradient(135deg,#fff7f1,#fffdf9) !important; }
.grammar-clean-summary > span { display: block; margin-bottom: 7px; color: #aa8d7c; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.grammar-clean-summary > p { color: #342d28 !important; font-size: 18px; font-weight: 700; }
.grammar-connection { padding: 11px 14px; border-left: 3px solid var(--accent); border-radius: 6px; background: #f7f2ec; font-family: "Yu Gothic", "Noto Sans JP", sans-serif; }
.grammar-clean ol { margin: 0; padding-left: 22px; }
.grammar-clean li { margin: 7px 0; padding-left: 4px; color: #4d443d; line-height: 1.8; }
.grammar-examples { display: grid; gap: 9px; }
.grammar-examples p { padding: 10px 12px; border-radius: 8px; background: #f8f5f1; color: #332d29; }
.grammar-related { display: flex; flex-wrap: wrap; gap: 8px; }
.grammar-related button { padding: 7px 12px; border: 1px solid #decfc2; border-radius: 999px; background: #fff; color: #9d452b; cursor: pointer; font: inherit; font-size: 13px; }
.grammar-related button:hover { border-color: var(--accent); background: #fff3ed; }

/* 《日本语表现文型词典》原始词条内容：保留原结构，适配本站阅读卡片。 */
.grammar-original { color: #3f3934; font-family: Arial,"Meiryo","Yu Gothic",sans-serif; font-size: 15px; line-height: 1.8; }
.grammar-original .part { display: grid; gap: 18px; }
.grammar-original .headerBlock { padding: 18px 22px; border: 1px solid #ead8ca; border-radius: 16px; background: linear-gradient(135deg,#fff7f1,#fffdf9); }
.grammar-original .meaning { margin: 4px 0; line-height: 1.7; }
.grammar-original .meaning:first-child { color: #88766a; font-size: 13px; }
.grammar-original .meaning:nth-child(2) { color: #342d28; font-size: 19px; font-weight: 700; }
.grammar-original hr { height: 1px; margin: 0; border: 0; background: #eadfd4; }
.grammar-original .exampleBlock,.grammar-original .connectionBlock,.grammar-original .explanationBlock { padding: 20px 22px; border: 1px solid #eadfd3; border-radius: 16px; background: #fffdfa; }
.grammar-original .exampleBlock::before { content: '例句'; display: block; margin-bottom: 12px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.grammar-original dl.example { display: grid; grid-template-columns: 2em minmax(0,1fr); gap: 10px 4px; margin: 0; line-height: 1.9; }
.grammar-original dl.example dt { width: auto; margin: 0; color: var(--accent); font-weight: 700; }
.grammar-original dl.example dd { margin: 0; padding: 0 0 10px; border-bottom: 1px dashed #eee1d5; }
.grammar-original dl.example dd:last-child { border-bottom: 0; }
.grammar-original ruby rt { color: #8c7f75; font-size: .62em; font-weight: 400; }
.grammar-original .EmphInExample { color: #a9472b; font-weight: 700; }
.grammar-original table.connect { width: 100%; overflow: hidden; border-collapse: collapse; border-radius: 12px; background: #f5eee7; }
.grammar-original table.connect th { width: 4.5em; padding: 9px 12px; background: #bd6244; color: #fff; text-align: center; }
.grammar-original table.connect td { padding: 9px 12px; }
.grammar-original p { margin-top: 0; }
.grammar-original [data-grammar] { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; cursor: pointer; }
.open-grammar-entry { display: grid; gap: 16px; }
.open-grammar-entry > h2 { margin: 0; font-size: 25px; color: #302b27; }
.open-grammar-meta { display: flex; gap: 8px; }
.open-grammar-meta span { padding: 4px 9px; border-radius: 999px; background: #fff1ea; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.open-grammar-entry section { padding: 18px 20px; border: 1px solid #eadfd3; border-radius: 14px; background: #fff; }
.open-grammar-entry section h3 { margin: 0 0 10px; color: var(--accent); font-size: 14px; }
.open-grammar-entry section p { margin: 7px 0; }
.open-grammar-entry section ul { margin: 10px 0 0; padding-left: 20px; }
.open-grammar-examples { display: grid; gap: 12px; margin: 0; padding-left: 22px; }
.open-grammar-examples li b,.open-grammar-examples li span { display: block; }
.open-grammar-examples li span { margin-top: 3px; color: #7d7169; }
.open-grammar-related { display: flex; flex-wrap: wrap; gap: 8px; }
.open-grammar-related a { padding: 6px 10px; border-radius: 9px; background: #fff5ef; color: var(--accent); text-decoration: none; }
.open-grammar-entry footer { color: #91877f; font-size: 12px; }

.jp-inline-results { margin-top: 22px; text-align: left; }
.jp-inline-results[hidden] { display: none !important; }
.jp-reference-panels[hidden] { display: none !important; }
.jp-entry-actions { display:flex; gap:10px; margin-top:16px; }
.jp-entry-actions a,.jp-entry-actions button { padding:7px 12px; border:1px solid #dfd5cf; border-radius:8px; background:#fff; color:#a64e35; font:inherit; font-size:12px; text-decoration:none; cursor:pointer; }
.jp-summary-actions{display:flex;align-items:center;gap:8px}.jp-summary-actions a,.jp-summary-actions button{padding:6px 9px;border:1px solid #e1d8d2;border-radius:8px;background:#fff;color:#a64e35;font:inherit;font-size:11px;text-decoration:none;white-space:nowrap;cursor:pointer}.jp-summary-actions i{margin-left:2px}
.jp-vocab-picker[hidden]{display:none}.jp-vocab-picker{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:20px}.jp-vocab-picker-shade{position:absolute;inset:0;border:0;background:rgba(32,27,24,.42)}.jp-vocab-picker>section{position:relative;width:min(420px,calc(100vw - 32px));padding:26px;border-radius:20px;background:#fff;box-shadow:0 24px 70px rgba(0,0,0,.2)}.jp-vocab-picker-close{position:absolute;right:14px;top:10px;border:0;background:none;font-size:26px}.jp-vocab-picker>section>span{color:#b8502e;font-size:10px;letter-spacing:.16em}.jp-vocab-picker h2{margin:5px 0}.jp-vocab-picker p{color:var(--muted);margin-bottom:16px}.jp-vocab-picker select,.jp-vocab-picker input{width:100%;margin:6px 0;padding:11px;border:1px solid #ddd4ce;border-radius:10px}.jp-vocab-picker .btn{width:100%;margin-top:12px}
.word-entry-page{display:grid;gap:18px}.word-entry-back{color:var(--muted);text-decoration:none}.word-entry-page>header,.word-entry-page>article{padding:26px;border:1px solid #e5dfda;border-radius:18px;background:#fff}.word-entry-page>header span{font-size:10px;letter-spacing:.18em;color:#b8502e}.word-entry-page h1{margin:7px 0;font-size:40px}.word-entry-page>article h2{margin:0 0 14px;font-size:18px}.word-entry-page blockquote{margin-top:16px;padding:14px;border-left:3px solid var(--accent);background:#faf7f4}.word-entry-page blockquote small{display:block;margin-top:5px;color:var(--muted)}
.jp-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 0 4px 12px; }
.jp-results-head h2 { margin: 0; color: var(--ink); font-size: 18px; }
.jp-results-head span { color: var(--muted); font-size: 12px; }
.jp-search-loading,.jp-search-empty { padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: #fff; color: var(--muted); text-align: center; }
.jp-search-result-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 13px; }
.jp-word-result { border: 1px solid var(--border); border-radius: 18px; background: #fff; padding: 20px; box-shadow: 0 8px 24px rgba(55,43,34,.055); }
.jp-word-result header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jp-word-result header > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.jp-word-result h3,.jp-grammar-result h2 { margin: 0; color: var(--ink); }
.jp-word-result header span,.jp-word-meta { color: var(--muted); font-size: 12px; }
.jp-word-result header button { border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 4px 8px; cursor: pointer; }
.jp-word-meaning { margin: 11px 0 7px; line-height: 1.65; }
.jp-word-result blockquote { margin: 13px 0 0; padding: 11px 13px; border-left: 3px solid var(--accent); background: #fff8f4; }
.jp-word-result blockquote b,.jp-word-result blockquote span { display: block; }
.jp-word-result blockquote span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.jp-result-source { margin-top: 13px; color: var(--muted); font-size: 12px; }
.jp-dict-results { display: grid; gap: 12px; margin-top: 12px; }
.jp-dict-result { overflow: hidden; border: 1px solid #e7dbd0; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(65,45,31,.055); }
.jp-dict-result summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 20px 24px; list-style: none; cursor: pointer; }
.jp-dict-result summary::-webkit-details-marker { display: none; }
.jp-dict-result summary span { color: #a36a54; font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.jp-dict-result summary h3 { margin: 5px 0 7px; color: var(--ink); font-family: "Yu Mincho","Noto Serif JP",serif; font-size: 25px; }
.jp-dict-result summary p { display: -webkit-box; overflow: hidden; margin: 0; color: #746961; font-size: 13px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.jp-dict-result summary i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #f3e9e3; color: #ae5638; font-style: normal; transition: transform .2s; }
.jp-dict-result[open] summary i { transform: rotate(180deg); }
.jp-dict-definition { padding: 22px 24px; border-top: 1px solid #eee3d9; color: #413a35; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.jp-dict-definition .yourei,.jp-dict-definition .example { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: #faf7f4; }
.jp-dict-definition .jpn,.jp-dict-definition .chn { display: block; }
.jp-dict-definition footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid #eee3d9; color: var(--muted); font-size: 12px; }
.jp-grammar-result { display: block; overflow: hidden; border: 1px solid #e7dbd0; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(65,45,31,.055); }
.jp-grammar-preview { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,.8fr); align-items: center; gap: 24px; min-height: 132px; padding: 22px 26px; list-style: none; cursor: pointer; }
.jp-grammar-preview::-webkit-details-marker { display: none; }
.jp-grammar-preview-main > span { display: block; margin-bottom: 4px; color: #b75f42; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.jp-grammar-preview-main h2 { font-family: "Yu Mincho","Noto Serif JP",serif; font-size: 30px; font-weight: 600; }
.jp-grammar-preview-main p { margin: 8px 0 0; color: #b34f30; font-size: 16px; font-weight: 650; }
.jp-grammar-preview-side { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; padding-left: 24px; border-left: 1px solid #eee3d9; }
.jp-grammar-preview-side small { grid-column: 1; color: #9b7c6c; font-size: 11px; }
.jp-grammar-preview-side b { grid-column: 1; color: #51463f; font-size: 14px; }
.jp-grammar-preview-side i { grid-column: 2; grid-row: 1 / 3; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #f3e9e3; color: #ae5638; font-style: normal; transition: transform .2s; }
.jp-grammar-result[open] .jp-grammar-preview-side i { transform: rotate(180deg); }
.jp-grammar-expanded { padding: 0 26px 22px; border-top: 1px solid #eee3d9; }
.jp-grammar-expanded section { padding-top: 22px; }
.jp-grammar-expanded section + section { margin-top: 22px; border-top: 1px solid #eee3d9; }
.jp-result-label { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: #9b7c6c; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.jp-result-label::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: #c86d4e; }
.jp-grammar-expanded ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 28px; margin: 0; padding: 0; counter-reset: grammar-use; list-style: none; line-height: 1.7; }
.jp-grammar-expanded ol li { position: relative; padding-left: 30px; color: #554941; }
.jp-grammar-expanded ol li::before { counter-increment: grammar-use; content: counter(grammar-use); position: absolute; left: 0; top: 2px; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #f4e8e1; color: #ae5638; font-size: 11px; font-weight: 800; }
.jp-grammar-example-list { display: grid; gap: 10px; }
.jp-grammar-example { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: start; gap: 12px; padding: 14px 16px; border: 1px solid #eee5dd; border-radius: 12px; background: #fdfbf9; }
.jp-grammar-example em { color: #c18b75; font: normal 700 11px/1.8 ui-monospace,monospace; }
.jp-grammar-example p { font-size: 15px; }
.jp-grammar-expanded > .jp-result-source { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #eee3d9; color: #9b8d84; }
.jp-grammar-expanded > .jp-result-source span { font-size: 10px; letter-spacing: .08em; }
.jp-grammar-expanded > .jp-result-source b { color: #74675f; font-weight: 500; }
.jp-grammar-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jp-grammar-suggestions button { border: 1px solid var(--border); border-radius: 999px; background: #fff; padding: 7px 12px; color: var(--ink); cursor: pointer; }
.jp-grammar-suggestions button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .jp-results-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .jp-dict-result summary,.jp-dict-definition { padding: 18px; }
  .jp-grammar-preview { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .jp-grammar-preview-side { padding: 14px 0 0; border-top: 1px solid #eee3d9; border-left: 0; }
  .jp-grammar-expanded { padding: 0 20px 20px; }
  .jp-grammar-expanded ol { grid-template-columns: 1fr; }
}

/* 日语学习首页：更轻、更聚焦的字典式搜索台 */
.jp-system-shell:not(.ai-system-shell) .jp-search-hero { border-color: #e5d6c7; box-shadow: 0 18px 42px rgba(91,63,41,.09); }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero::before { content: "辞"; display: block; position: absolute; right: 34px; top: 22px; color: rgba(184,80,46,.045); font: 700 150px/1 var(--font-serif); pointer-events: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes { border-color: #e6d8ca; background: rgba(255,255,255,.88); }
.jp-system-shell:not(.ai-system-shell) .jp-main-search { border: 1px solid #eadfd4; box-shadow: 0 10px 24px rgba(84,59,39,.07); }
.jp-system-shell:not(.ai-system-shell) .jp-main-search:focus-within { border-color: #cf7658; box-shadow: 0 12px 28px rgba(184,80,46,.12); }

/* 搜索页：轻量、扁平的辞典查询界面 */
.jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 18px 54px 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-copy { display: none; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search { min-height: 58px; border: 2px solid #e4d8d3; border-radius: 999px; box-shadow: none; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search:focus-within { border-color: #d36b56; box-shadow: 0 0 0 4px rgba(211,107,86,.08); }
.jp-system-shell:not(.ai-system-shell) .jp-global-search .jp-global-search-icon { align-self: center; min-width: 42px; height: 42px; margin: 0 0 0 8px; padding: 0; border: 0; background: transparent; box-shadow: none; color: #c8553c; font: 400 29px/1 sans-serif; cursor: pointer; transform: rotate(-18deg); }
.jp-system-shell:not(.ai-system-shell) .jp-global-search input { padding: 14px 8px; font-size: 17px; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search .jp-search-clear { align-self: center; min-width: 42px; height: 42px; margin: 0 9px 0 0; padding: 0; border: 0; background: transparent; color: #554a45; font: 300 28px/1 sans-serif; cursor: pointer; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes { display: flex; gap: 42px; margin: 14px 12px 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button { position: relative; min-width: 0; padding: 10px 4px 13px; border-radius: 0; background: transparent; color: #554b45; font-size: 15px; font-weight: 500; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button.active { background: transparent; color: #c64d35; box-shadow: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button.active::after { content: ''; position: absolute; right: 4px; bottom: 3px; left: 4px; height: 3px; border-radius: 3px; background: #d45b43; }
.jp-inline-results { padding: 0 54px; }
.jp-results-head { padding: 0 4px 10px; border-bottom: 1px solid #ebe6e2; }
.jp-search-result-grid,.jp-dict-results,.jp-grammar-list { display: block; margin: 0; }
.jp-word-result,.jp-dict-result,.jp-grammar-result { border: 0; border-bottom: 1px solid #eee9e6; border-radius: 0; box-shadow: none; }
.jp-word-result { padding: 18px 24px; }
.jp-word-result:first-child,.jp-dict-result:first-child,.jp-grammar-result:first-child { border-radius: 14px; background: #f5f3f1; }
.jp-dict-result { background: transparent; }
.jp-dict-result summary { padding: 17px 24px; }
.jp-dict-result[open] { margin: 6px 0; border: 0; border-radius: 14px; background: #f5f3f1; }
.jp-dict-definition { border-top-color: #e4ded9; background: rgba(255,255,255,.55); }
.jp-grammar-result { border-radius: 0; background: transparent; }
.jp-grammar-result[open] { margin: 6px 0; border-radius: 14px; background: #f5f3f1; }
.jp-grammar-preview { min-height: 100px; padding: 17px 24px; }
.jp-search-loading,.jp-search-empty { border-color: #e5e0dc; border-radius: 18px; box-shadow: none; }
@media (max-width:720px) {
  .jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 14px 8px 2px; }
  .jp-inline-results { padding: 0 8px; }
  .jp-system-shell:not(.ai-system-shell) .jp-search-modes { gap: 26px; margin-left: 8px; }
}

/* ==================== AI 聊天气泡（右下角，全站通用） ==================== */
.chat-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow: none;
  transition: transform .15s ease, box-shadow .15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none; /* 手指按住气泡拖动时，页面不会跟着滚 */
}
.chat-bubble:hover { transform: scale(1.08); box-shadow: none; }
.chat-bubble[hidden] { display: none; }
/* 长按拖动时的手感：放大一点、变成「抓取中」的鼠标样式 */
.chat-bubble.dragging {
  transition: none !important;
  transform: scale(1.12);
  cursor: grabbing;
  opacity: .95;
}
.chat-bubble.chat-pos-left { right: auto; left: 22px; }
.chat-bubble-img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  border: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 88px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-direction: column;
  z-index: 901;
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-panel.chat-pos-left { right: auto; left: 22px; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(120deg, #071d49, #0c5c9f);
  color: #f7f2e9;
  cursor: move; /* 按住标题栏可以拖动整个面板 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* 手机上手指拖面板时页面不跟着滚 */
}
.chat-head.dragging { cursor: grabbing; }
.chat-head-title { display: flex; align-items: center; gap: 10px; }
.chat-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-head-icon-img { object-fit: cover; border-radius: 0; background: transparent; }
.chat-head-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.chat-head-sub { font-size: 11px; opacity: .7; line-height: 1.3; }
.chat-close {
  background: none;
  border: none;
  color: #f7f2e9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  opacity: .8;
}
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
}
.chat-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
}
.chat-msg.me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.sys {
  align-self: center;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 12px;
  border-radius: 8px;
}
.chat-msg code { background: rgba(0, 0, 0, .06); padding: 0 4px; border-radius: 4px; font-size: 12px; }
.chat-msg.me code { background: rgba(255, 255, 255, .2); }
.chat-typing { color: var(--muted); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.chat-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13.5px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-send {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.chat-send:hover { background: var(--accent-dark); }
.chat-send:disabled { opacity: .55; cursor: default; }
/* AI 聊天：功能模式标签栏 */
.chat-modes { display: flex; gap: 4px; padding: 8px 10px 0; background: var(--card); }
.chat-mode-btn {
  flex: 1;
  padding: 6px 0;
  font-size: 12px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chat-mode-btn.active { background: var(--paper); color: var(--accent); font-weight: 700; border-color: var(--accent); }
.chat-subbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; background: var(--paper); border-bottom: 1px solid var(--border); }
.chat-subbar[hidden] { display: none; }
.chat-subbar-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-subbar-group[hidden] { display: none; }
.chat-sub-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.chat-sub-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 选中日语后浮出来的「AI 查词」小按钮 */
.chat-lookup {
  position: fixed;
  z-index: 950;
  padding: 5px 12px;
  font-size: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  cursor: pointer;
}
.chat-lookup[hidden] { display: none; }
/* 首页：每日一句 */
#dailySection[hidden] { display: none; }
.daily-date { font-size: 13px; color: var(--muted); }
.daily-source { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.daily-card {
  background: var(--paper);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.daily-jp { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.daily-reading { font-size: 14px; color: var(--accent); margin: 0 0 8px; }
.daily-cn { font-size: 15px; color: var(--ink); margin: 0 0 10px; }
.daily-detail {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.daily-detail[hidden] { display: none; }
.daily-line { font-size: 14px; line-height: 1.7; color: var(--ink); }
.daily-line + .daily-line { margin-top: 6px; }
.daily-toggle { font-size: 13px; }

/* ============ 日语学习系统：学习工作台 ============ */
.jp-home-return::before { content: '←'; font-size: 15px; }
.jp-system-shell { display: grid; grid-template-columns: 210px minmax(0,1fr); align-items: start; gap: 24px; }
.jp-system-sidebar { position: sticky; top: 85px; min-height: calc(100vh - 125px); padding: 16px 12px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,253,248,.94); box-shadow: var(--shadow); }
.jp-side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 9px 17px; color: var(--ink); border-bottom: 1px solid var(--border); }
.jp-side-brand:hover { color: var(--ink); }
.jp-side-brand span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font: 700 19px var(--font-serif); }
.jp-side-brand b { min-width: 0; font: 700 14px/1.35 var(--font-serif); }
.jp-side-nav { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; }
.jp-side-nav a,.jp-side-nav button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); font: 500 14px/1.3 sans-serif; font-family: inherit; text-align: left; cursor: pointer; transition: background .15s,color .15s,transform .15s; }
.jp-side-nav a:hover,.jp-side-nav button:hover { color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }
.jp-side-nav a.active { background: var(--accent); color: #fff; font-weight: 700; }
.jp-side-nav a > span:first-child,.jp-side-nav button > span:first-child { flex: 0 0 22px; width: 22px; text-align: center; font-size: 17px; }
.jp-side-divider { height: 1px; margin: 8px 12px; background: var(--border); }
.jp-side-account-login[hidden],
.jp-side-account-user[hidden] { display: none !important; }
.jp-side-account-user button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); font: 500 14px/1.3 sans-serif; font-family: inherit; text-align: left; cursor: pointer; transition: background .15s,color .15s,transform .15s; }
.jp-side-account-user button:hover { color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }
.jp-side-user-avatar { flex: 0 0 22px; width: 22px !important; height: 22px; overflow: hidden; display: grid; place-items: center; border-radius: 50%; background: #f3dfd7; color: var(--accent); font-size: 11px !important; font-style: normal; }
.jp-side-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.jp-side-user-avatar i { font-style: normal; }
.jp-side-foot { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding: 13px; border-radius: 12px; background: var(--paper); color: var(--muted); }
.jp-side-foot small { font-size: 10px; letter-spacing: .05em; }
.jp-workbench { max-width: 1080px; }
.jp-search-hero {
  position: relative; overflow: hidden; padding: 42px 46px 36px; margin-bottom: 16px;
  border: 1px solid #ead8c9; border-radius: 22px;
  background: radial-gradient(circle at 88% 18%, rgba(225,142,151,.22), transparent 24%), linear-gradient(135deg, #fffdf8 0%, #fbf1e8 100%);
  box-shadow: 0 16px 40px rgba(79,55,35,.08);
}
.jp-search-hero::after { content: '桜'; position: absolute; right: 28px; bottom: -38px; color: rgba(184,80,46,.055); font: 700 170px/1 var(--font-serif); pointer-events: none; }
.jp-hero-copy { position: relative; z-index: 1; margin-bottom: 24px; }
.jp-eyebrow,.jp-section-kicker { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.jp-search-hero .jp-hero-title { margin: 5px 0 7px; font-size: clamp(28px,4vw,40px); }
.jp-search-hero .jp-hero-sub { font-size: 14px; }
.jp-search-modes { position: relative; z-index: 1; display: inline-flex; gap: 5px; margin: -5px 0 11px; padding: 4px; border: 1px solid rgba(226,216,196,.78); border-radius: 13px; background: rgba(255,255,255,.62); }
.jp-search-modes button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 12px sans-serif; font-family: inherit; cursor: pointer; transition: .15s; }
.jp-search-modes button:hover { color: var(--accent); }
.jp-search-modes button.active { background: var(--accent); color: #fff; box-shadow: 0 3px 9px rgba(184,80,46,.15); }
.jp-global-search { position: relative; z-index: 1; display: flex; align-items: center; max-width: 820px; min-height: 58px; background: #fff; border: 2px solid transparent; border-radius: 16px; box-shadow: 0 8px 24px rgba(98,65,42,.12); transition: border-color .2s, box-shadow .2s; }
.jp-global-search:focus-within { border-color: #d88364; box-shadow: 0 8px 28px rgba(184,80,46,.17); }
.jp-global-search-icon { margin-left: 20px; font-size: 20px; }
.jp-global-search input { flex: 1; min-width: 0; padding: 17px 14px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 16px/1.3 sans-serif; font-family: inherit; }
.jp-global-search button { align-self: stretch; min-width: 94px; margin: 5px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: 700 14px sans-serif; font-family: inherit; cursor: pointer; }
.jp-global-search button:hover { background: var(--accent-dark); }
.jp-search-suggestions { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.jp-search-suggestions button { border: 0; border-radius: 12px; padding: 4px 10px; background: rgba(255,255,255,.72); color: var(--muted); cursor: pointer; }
.jp-search-suggestions button:hover { color: var(--accent); background: #fff; }
.sr-only { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.jp-workbench .jp-user-card { padding: 13px 18px; margin-bottom: 20px; background: rgba(246,224,213,.72); border-style: solid; border-color: #edd0c1; }
.jp-user-login { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.jp-user-login[hidden],.jp-user-info[hidden],.jp-daily-loading[hidden] { display: none !important; }
.jp-user-login strong { color: var(--ink); font-size: 14px; }
.jp-workbench .jp-user-tip { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.jp-continue-btn { padding: 8px 13px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.jp-continue-btn:hover { color: #fff; background: var(--accent-dark); }

.jp-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: 18px; margin-bottom: 30px; }
.jp-today-panel,.jp-daily-panel { min-height: 330px; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); box-sizing: border-box; }
.jp-daily-panel { position: relative; background: linear-gradient(150deg,#fffaf2,#fffdf9); }
.jp-panel-head,.jp-section-headline { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.jp-panel-head h2,.jp-section-headline h2 { margin: 3px 0 0; color: var(--ink); font: 700 20px/1.25 var(--font-serif); }
.jp-today-date { padding: 5px 10px; border-radius: 13px; background: var(--paper); color: var(--muted); font-size: 12px; }
.jp-today-tasks { margin-top: 17px; }
.jp-task-row { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 4px; border: 0; border-bottom: 1px dashed var(--border); background: transparent; color: var(--ink); text-align: left; font-family: inherit; cursor: pointer; }
.jp-task-row:last-child { border-bottom: 0; }
.jp-task-row:hover .jp-task-action { color: #fff; background: var(--accent); }
.jp-task-row b,.jp-task-row small { display: block; }
.jp-task-row b { margin-bottom: 3px; font-size: 14px; }
.jp-task-row small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.jp-task-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font: 700 15px var(--font-serif); }
.jp-task-coral { color: #b24e3c; background: #fde8e1; }.jp-task-blue { color: #457795; background: #e7f1f6; }.jp-task-green { color: #4c7955; background: #e6f2e6; font-family: sans-serif; font-size: 11px; }
.jp-task-action { padding: 5px 10px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 12px; transition: .15s; }
.jp-daily-mark { font-size: 26px; }
.jp-daily-loading { display: grid; place-items: center; min-height: 220px; color: var(--muted); font-size: 13px; }
.jp-daily-content { padding: 26px 4px 0; }
.jp-daily-content[hidden] { display: none; }
.jp-daily-jp { margin: 0 0 5px; color: var(--ink); font: 700 22px/1.65 var(--font-serif); }
.jp-daily-reading { color: var(--accent); font-size: 12px; line-height: 1.7; }
.jp-daily-cn { margin: 11px 0; color: var(--ink); font-size: 14px; line-height: 1.7; }
.jp-daily-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.jp-daily-tags span { max-width: 100%; overflow: hidden; padding: 4px 8px; border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.jp-daily-source { margin-top: 14px; color: #aa9a88; font-size: 11px; }

.jp-tools-section,.jp-path-section { margin: 30px 0; }
.jp-section-headline { align-items: flex-end; margin-bottom: 14px; }
.jp-section-headline p { color: var(--muted); font-size: 12px; }
.jp-tool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.jp-tool-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 108px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: 0 5px 18px rgba(70,50,35,.045); transition: transform .18s, border-color .18s, box-shadow .18s; }
.jp-tool-card:hover { color: var(--ink); transform: translateY(-2px); border-color: #dfa485; box-shadow: 0 10px 24px rgba(92,58,35,.09); }
.jp-tool-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--paper); font-size: 24px; }
.jp-tool-copy b,.jp-tool-copy small { display: block; }
.jp-tool-copy b { margin-bottom: 5px; color: var(--ink); font-size: 15px; }
.jp-tool-copy small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.jp-tool-arrow { color: var(--accent); font-size: 20px; }
.jp-path-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.jp-path-card { min-height: 120px; padding: 20px; border: 0; border-radius: 16px; background: #f4eee5; color: var(--ink); text-align: left; font-family: inherit; cursor: pointer; transition: transform .16s, background .16s; }
.jp-path-card:nth-child(2) { background: #edf3ef; }.jp-path-card:nth-child(3) { background: #f6ebec; }
.jp-path-card:hover { color: var(--ink); transform: translateY(-2px); filter: saturate(1.08); }
.jp-path-card span,.jp-path-card b,.jp-path-card small { display: block; }
.jp-path-card span { margin-bottom: 10px; font-size: 22px; }.jp-path-card b { margin-bottom: 5px; font-size: 14px; }.jp-path-card small { color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .jp-system-shell { display: block; }
  .jp-system-sidebar { position: static; min-height: 0; margin-bottom: 14px; padding: 10px; border-radius: 14px; }
  .jp-side-brand,.jp-side-foot,.jp-side-divider { display: none; }
  .jp-side-nav { flex-direction: row; gap: 7px; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .jp-side-nav::-webkit-scrollbar { display: none; }
  .jp-side-nav a,.jp-side-nav button { flex: 0 0 auto; width: auto; padding: 8px 11px; white-space: nowrap; }
  .jp-side-nav a span,.jp-side-nav button span { width: auto; }
  .jp-side-nav a:hover,.jp-side-nav button:hover { transform: none; }
  .jp-search-hero { padding: 30px 20px 26px; border-radius: 16px; }
  .jp-search-hero::after { right: -20px; }
  .jp-global-search { min-height: 52px; }
  .jp-global-search-icon { margin-left: 14px; }
  .jp-global-search input { padding: 14px 9px; font-size: 14px; }
  .jp-global-search button { min-width: 68px; }
  .jp-search-modes { width: 100%; }
  .jp-search-modes button { flex: 1; justify-content: center; padding-inline: 8px; }
  .jp-user-login,.jp-user-info { align-items: flex-start; flex-wrap: wrap; }
  .jp-dashboard-grid,.jp-tool-grid,.jp-path-grid { grid-template-columns: 1fr; }
  .jp-today-panel,.jp-daily-panel { min-height: 0; padding: 19px; }
  .jp-daily-loading { min-height: 150px; }
  .jp-tool-card { min-height: 94px; }
  .jp-section-headline p { display: none; }
}

/* ============ 首页时间工具条：保留全部功能，降低视觉占用 ============ */
.clock-bar {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 14px;
}
.clock-top {
  min-width: 174px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 2px 16px 2px 4px;
  border-right: 1px solid var(--border);
}
.clock-date-block { gap: 7px; }
.clock-date { font-size: 12px; font-weight: 600; }
.clock-week { padding: 0 7px; font-size: 10px; }
.clock-time { font-size: 22px; letter-spacing: 1px; }
.clock-pomo { min-width: 0; }
.pomo-compact {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  border-top: 0;
}
.pomo-compact .pomo-display { min-width: 118px; }
.pomo-compact .pomo-digit { width: 24px; height: 36px; }
.pomo-compact .pomo-strip span { width: 24px; height: 36px; font-size: 23px; }
.pomo-compact .pomo-sep { font-size: 19px; }
.pomo-compact .pomo-controls {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.pomo-chips { flex-wrap: nowrap; gap: 4px; }
.pomo-chip { min-width: 34px; padding: 4px 7px; border-radius: 8px; font-size: 11px; }
.pomo-adjust { flex-wrap: nowrap; gap: 4px; }
.pomo-btn { width: 29px; height: 29px; border-radius: 8px; font-size: 12px; }
.pomo-total { min-width: 47px; font-size: 11px; }
.pomo-actions { flex: 0 0 auto; flex-wrap: nowrap; gap: 5px; }
.pomo-compact .pomo-actions .btn { flex: 0 0 auto; padding: 5px 9px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.pomo-done-tip { position: absolute; width: auto; right: 24px; margin-top: 52px; padding: 4px 9px; font-size: 11px; }

@media (max-width: 980px) {
  .clock-bar { grid-template-columns: 1fr; gap: 8px; }
  .clock-top { min-width: 0; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 2px 7px; border-right: 0; border-bottom: 1px solid var(--border); }
  .pomo-compact .pomo-controls { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .clock-bar { padding: 9px 10px; }
  .pomo-compact { align-items: flex-start; flex-wrap: wrap; }
  .pomo-compact .pomo-display { min-width: 108px; justify-content: flex-start; }
  .pomo-compact .pomo-controls { width: 100%; }
  .pomo-chips { order: 1; }
  .pomo-adjust { order: 2; }
  .pomo-actions { order: 3; width: 100%; }
  .pomo-compact .pomo-actions .btn { flex: 1 1 auto; }
}

/* ============ AI 日语老师独立页 ============ */
.ai-system-shell { grid-template-columns: 210px minmax(0,1fr); }
.ai-page { min-width: 0; min-height: calc(100vh - 130px); display: flex; flex-direction: column; gap: 15px; }
.ai-page-head { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 15px; padding: 18px 21px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(135deg,#fffdf8,#faeee7); box-shadow: var(--shadow); }
.ai-page-avatar { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 17px; background: #f2e7d9; }
.ai-page-avatar img { width: 100%; height: 100%; object-fit: contain; }
.ai-page-head h1 { margin: 2px 0 1px; color: var(--ink); font-size: 22px; }
.ai-page-head p { color: var(--muted); font-size: 12px; }
.ai-clear-btn { padding: 7px 11px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.72); color: var(--muted); font: 12px sans-serif; font-family: inherit; cursor: pointer; }
.ai-clear-btn:hover { border-color: var(--accent); color: var(--accent); }
.ai-mode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.ai-mode-grid button { display: grid; grid-template-columns: 31px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); color: var(--ink); text-align: left; font-family: inherit; cursor: pointer; transition: .16s; }
.ai-mode-grid button > span { grid-row: 1 / 3; align-self: center; font-size: 21px; }
.ai-mode-grid button b { font-size: 13px; }.ai-mode-grid button small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-mode-grid button:hover { transform: translateY(-1px); border-color: #d69b7e; }
.ai-mode-grid button.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(184,80,46,.16); }
.ai-mode-grid button.active small { color: rgba(255,255,255,.8); }
.ai-workspace { min-height: 510px; flex: 1; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.ai-quick-bar { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--paper); }
.ai-quick-bar[hidden] { display: none; }
.ai-quick-bar button { padding: 5px 12px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); color: var(--ink); font: 12px sans-serif; font-family: inherit; cursor: pointer; }
.ai-quick-bar button:hover { border-color: var(--accent); color: var(--accent); }
.ai-page-messages { flex: 1; min-height: 330px; max-height: calc(100vh - 390px); overflow-y: auto; padding: 24px; scroll-behavior: smooth; }
.ai-message { width: fit-content; max-width: min(76%,720px); margin-bottom: 13px; padding: 11px 14px; border-radius: 4px 15px 15px 15px; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.75; word-break: break-word; }
.ai-message.user { margin-left: auto; border-radius: 15px 4px 15px 15px; background: var(--accent); color: #fff; }
.ai-message.system { margin-right: auto; border: 1px dashed #d9a48f; background: var(--accent-soft); color: var(--accent-dark); }
.ai-message.typing { color: var(--muted); animation: aiTyping 1s ease-in-out infinite alternate; }
@keyframes aiTyping { to { opacity: .45; } }
.ai-message code { padding: 1px 4px; border-radius: 4px; background: rgba(0,0,0,.06); }
.ai-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; margin: 0 16px; padding: 9px 9px 9px 16px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 5px 18px rgba(75,55,35,.07); }
.ai-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-composer textarea { width: 100%; max-height: 160px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: 14px/1.6 sans-serif; font-family: inherit; }
.ai-composer button { min-width: 80px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 13px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-family: inherit; cursor: pointer; }
.ai-composer button span { font-size: 18px; }.ai-composer button b { font-size: 12px; }
.ai-composer button:disabled { opacity: .5; cursor: wait; }

@media (max-width: 900px) {
  .ai-mode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ai-page-messages { max-height: none; }
}
@media (max-width: 760px) {
  .ai-system-shell { display: block; }
  .ai-page { min-height: 0; }
  .ai-page-head { grid-template-columns: 48px minmax(0,1fr); padding: 14px; }
  .ai-page-avatar { width: 45px; height: 45px; border-radius: 13px; }
  .ai-page-head h1 { font-size: 18px; }.ai-page-head p { display: none; }
  .ai-clear-btn { grid-column: 1 / 3; justify-self: end; margin-top: -4px; }
  .ai-mode-grid button { padding: 9px; }
  .ai-workspace { min-height: 62vh; }
  .ai-page-messages { min-height: 300px; padding: 15px; }
  .ai-message { max-width: 88%; font-size: 13px; }
  .ai-composer { margin: 0 9px; padding-left: 12px; }
  .ai-composer button { min-width: 43px; padding: 8px; }.ai-composer button b { display: none; }
}

/* AI 页面扩展工具：翻译、润色、个人词单、文本分析 */
.ai-tool-section { scroll-margin-top: 88px; overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: rgba(255,253,249,.97); box-shadow: var(--shadow); }
.ai-tool-section[hidden] { display: none; }
.ai-tools-page { min-height: 600px; }
.ai-tool-heading { padding: 24px 27px 19px; border-bottom: 1px solid var(--border); background: linear-gradient(115deg,#fffdf8,#fbf1ea); }
.ai-tool-heading > span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.ai-tool-heading h2 { margin: 4px 0 5px; color: var(--ink); font: 700 24px/1.2 var(--font-serif); }
.ai-tool-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.ai-split-workspace { display: grid; grid-template-columns: minmax(280px,.82fr) minmax(360px,1.18fr); min-height: 420px; }
.ai-input-pane { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-right: 1px solid var(--border); background: #fffdfa; }
.ai-input-pane textarea { width: 100%; min-height: 260px; flex: 1; resize: vertical; padding: 17px; border: 1px solid var(--border); border-radius: 15px; outline: none; background: #fff; color: var(--ink); font: 14px/1.8 sans-serif; font-family: inherit; box-sizing: border-box; }
.ai-input-pane textarea:focus,.ai-input-pane select:focus,.ai-vocab-toolbar input:focus,.ai-collect-row input:focus,.ai-collect-row select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-input-pane select,.ai-collect-row select,.ai-collect-row input,.ai-vocab-toolbar input { min-height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: #fff; color: var(--ink); font-family: inherit; }
.ai-field-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.ai-direction-tabs { width: fit-content; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--paper); }
.ai-direction-tabs button { padding: 7px 15px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 12px sans-serif; font-family: inherit; cursor: pointer; }
.ai-direction-tabs button.active { background: var(--accent); color: #fff; font-weight: 700; }
.ai-primary-action { align-self: flex-end; min-width: 118px; padding: 11px 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: 700 13px sans-serif; font-family: inherit; cursor: pointer; }
.ai-primary-action:hover { background: var(--accent-dark); }.ai-primary-action:disabled { opacity: .55; cursor: wait; }
.ai-result-pane { min-width: 0; padding: 24px; background: var(--card); }
.ai-empty-result { min-height: 150px; display: grid; place-items: center; color: #aa9d90; font-size: 13px; text-align: center; }
.ai-loading-result { animation: aiTyping 1s ease-in-out infinite alternate; }
.ai-tool-error { padding: 18px; border: 1px dashed #d99079; border-radius: 13px; background: #fff2ed; color: #a8452a; font-size: 13px; }
.ai-result-block + .ai-result-block { margin-top: 21px; padding-top: 20px; border-top: 1px dashed var(--border); }
.ai-result-block > span,.ai-result-subhead b { display: block; margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ai-result-text { color: var(--ink); font-size: 15px; line-height: 1.95; white-space: normal; }
.ai-change-list { display: grid; gap: 10px; }.ai-change-item { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 10px; padding: 12px; border-radius: 12px; background: var(--paper); }
.ai-change-item > b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; }
.ai-change-item del,.ai-change-item ins { display: block; text-decoration: none; line-height: 1.7; }.ai-change-item del { color: #a8887d; text-decoration: line-through; }.ai-change-item ins { color: #357052; font-weight: 700; }
.ai-change-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ai-result-vocab { margin-top: 23px; padding-top: 19px; border-top: 1px dashed var(--border); }.ai-result-subhead { display: flex; align-items: center; justify-content: space-between; }.ai-result-subhead b { margin: 0; }.ai-result-subhead small { color: var(--muted); font-size: 10px; }
.ai-vocab-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.ai-vocab-choice { position: relative; display: flex; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }.ai-vocab-choice:has(input:checked) { border-color: #d48c70; background: #fff8f4; }
.ai-vocab-choice input { margin-top: 3px; accent-color: var(--accent); }.ai-vocab-choice span { min-width: 0; }.ai-vocab-choice b,.ai-vocab-choice small,.ai-vocab-choice em { display: block; }.ai-vocab-choice b { color: var(--ink); font-size: 13px; }.ai-vocab-choice small { color: var(--accent); font-size: 10px; }.ai-vocab-choice em { margin-top: 2px; color: var(--muted); font-size: 11px; font-style: normal; }
.ai-collect-row { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(150px,1fr) auto; gap: 8px; margin-top: 10px; }.ai-collect-row button,.ai-vocab-toolbar button { padding: 0 16px; border: 1px solid var(--accent); border-radius: 11px; background: var(--accent); color: #fff; font: 700 12px sans-serif; font-family: inherit; cursor: pointer; }
.ai-login-note { margin: 20px 24px 0; padding: 13px 16px; border: 1px solid #efd5c8; border-radius: 13px; background: #fff3ec; color: var(--muted); font-size: 13px; }.ai-login-note a { margin-left: 5px; color: var(--accent); font-weight: 700; }
.ai-vocab-toolbar { display: flex; gap: 9px; padding: 20px 24px 0; }.ai-vocab-toolbar[hidden] { display: none; }.ai-vocab-toolbar input { flex: 1; }.ai-vocab-toolbar button { min-height: 42px; }
.ai-vocab-lists { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 20px 24px 24px; }
.ai-vocab-list { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #fff; }.ai-vocab-list header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--paper); }.ai-vocab-list h3 { margin: 0 0 2px; font-size: 14px; }.ai-vocab-list header small { color: var(--muted); font-size: 10px; }.ai-vocab-list header > span { padding: 4px 8px; border-radius: 9px; background: #fff; color: var(--accent); font-size: 9px; }
.ai-saved-word-grid { max-height: 290px; overflow-y: auto; padding: 7px 14px; }.ai-saved-word { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 1px; border-bottom: 1px dashed var(--border); }.ai-saved-word:last-child { border-bottom: 0; }.ai-saved-word b,.ai-saved-word small,.ai-saved-word span { margin-right: 7px; }.ai-saved-word b { font-size: 13px; }.ai-saved-word small { color: var(--accent); font-size: 10px; }.ai-saved-word span { color: var(--muted); font-size: 11px; }.ai-saved-word button { border: 0; background: transparent; color: #ba9b8d; cursor: pointer; }.ai-vocab-empty { color: var(--muted); font-size: 11px; text-align: center; }
.ai-sentence-list { display: grid; gap: 14px; }.ai-sentence-card { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }.ai-sentence-card header { display: flex; align-items: flex-start; gap: 9px; }.ai-sentence-card header > b { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10px; }.ai-sentence-card h3 { margin: 0; font: 700 14px/1.7 var(--font-serif); }.ai-parts-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }.ai-sentence-part { padding: 7px 9px; border-radius: 10px; background: var(--paper); }.ai-sentence-part b,.ai-sentence-part em,.ai-sentence-part small { display: block; }.ai-sentence-part b { font-size: 12px; }.ai-sentence-part em { color: var(--accent); font-size: 9px; font-style: normal; }.ai-sentence-part small { margin-top: 2px; color: var(--muted); font-size: 9px; }.ai-sentence-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }.ai-sentence-card p strong { margin-right: 8px; color: var(--ink); }
@media (max-width: 900px) { .ai-split-workspace { grid-template-columns: 1fr; }.ai-input-pane { border-right: 0; border-bottom: 1px solid var(--border); }.ai-vocab-lists { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .ai-tool-heading,.ai-input-pane,.ai-result-pane { padding: 18px; }.ai-vocab-choice-grid { grid-template-columns: 1fr; }.ai-collect-row { grid-template-columns: 1fr; }.ai-collect-row button { min-height: 42px; }.ai-vocab-toolbar { flex-direction: column; padding-inline: 18px; }.ai-vocab-toolbar button { min-height: 42px; }.ai-vocab-lists { padding-inline: 18px; } }

/* ============ 2026 白色主题重构 ============ */
:root {
  --paper: #f6f7f9;
  --paper-deep: #eef0f3;
  --card: #ffffff;
  --border: #e3e6ea;
  --ink: #25272b;
  --muted: #747982;
  --accent: #bf4d2c;
  --accent-dark: #9f3d20;
  --accent-soft: #f8e9e3;
  --accent-pink: #fbefeb;
  --radius: 14px;
  --shadow: 0 8px 26px rgba(35, 40, 48, .055);
  --shadow-hover: 0 14px 34px rgba(35, 40, 48, .1);
}

body {
  background-color: #f6f7f9;
  background-image: none;
}
.navbar {
  background: rgba(255,255,255,.94);
  border-bottom-color: #e7e9ed;
  box-shadow: 0 1px 10px rgba(35,40,48,.035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.logo-icon { border-radius: 11px; box-shadow: none; }
.nav-links a,.jp-btn,.nav-share,.lang-btn,.nav-login { border-radius: 10px; }
.jp-btn { background: #fff; border-style: solid; border-color: #e2b6a8; }
.lang-btn { background: #fff; }

/* 日语学习系统：白色工作台 */
.learning-page .page-main { max-width: 1380px; padding-top: 22px; }
.learning-page .jp-system-shell { grid-template-columns: 224px minmax(0,1fr); gap: 28px; }
.learning-page .jp-system-sidebar {
  top: 82px;
  padding: 18px 14px;
  border-color: #e4e7eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(31,38,46,.06);
}
.learning-page .jp-side-brand { padding: 3px 10px 18px; border-color: #eceef1; }
.learning-page .jp-side-brand span { box-shadow: 0 5px 14px rgba(191,77,44,.18); }
.learning-page .jp-side-nav { gap: 6px; padding-top: 16px; }
.learning-page .jp-side-nav a,
.learning-page .jp-side-nav button { min-height: 46px; padding: 11px 14px; border-radius: 12px; }
.learning-page .jp-side-nav a:hover,
.learning-page .jp-side-nav button:hover { background: #f5f6f8; transform: none; }
.learning-page .jp-side-nav a.active {
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(191,77,44,.16);
}
.learning-page .jp-side-divider { background: #eceef1; }
.learning-page .jp-side-foot { background: #f6f7f9; }

/* 登录后的“我的”恢复为原来的固定按钮，不展示昵称首字圆点。 */
.learning-page .jp-side-user-avatar { overflow: visible; background: transparent; color: inherit; font-size: 0 !important; }
.learning-page .jp-side-user-avatar::before { content: '👤'; font-size: 17px; line-height: 1; }
.learning-page .jp-side-user-avatar img,
.learning-page .jp-side-user-avatar i { display: none !important; }

.learning-page .jp-workbench { max-width: 1120px; }
.learning-page .jp-search-hero {
  padding: 42px 48px 38px;
  border-color: #e4e7eb;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(31,38,46,.055);
}
.learning-page .jp-search-hero::after { display: none; }
.learning-page .jp-search-modes { border-color: #e4e7eb; background: #f6f7f9; }
.learning-page .jp-global-search { border: 1px solid #e1e4e8; box-shadow: 0 8px 22px rgba(31,38,46,.07); }
.learning-page .jp-global-search:focus-within { border-color: #d17a5f; box-shadow: 0 0 0 4px rgba(191,77,44,.09); }
.learning-page .jp-reference-card,
.learning-page .ai-page-head,
.learning-page .ai-tool-section { border-color: #e4e7eb; background: #fff; box-shadow: 0 12px 32px rgba(31,38,46,.05); }
.learning-page .ai-page-head,
.learning-page .ai-tool-heading { background: #fff; }
.learning-page .ai-input-pane { background: #fafbfc; }
.learning-page .ai-quick-bar,
.learning-page .ai-direction-tabs,
.learning-page .ai-change-item,
.learning-page .ai-sentence-part,
.learning-page .ai-vocab-list header { background: #f5f6f8; }
.learning-page .jp-latest-cover { background: #f1f3f5; }

@media (max-width: 900px) {
  .learning-page .jp-system-shell { grid-template-columns: 1fr; gap: 16px; }
  .learning-page .jp-system-sidebar { position: static; min-height: 0; }
  .learning-page .jp-side-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .learning-page .jp-side-divider,.learning-page .jp-side-foot { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .learning-page .page-main { padding: 12px 10px 28px; }
  .learning-page .jp-search-hero { padding: 28px 20px 24px; }
  /* 手机上菜单改成一行横向滑动，不再竖着占满第一屏 */
  .learning-page .jp-system-sidebar { padding: 8px; margin-bottom: 12px; border-radius: 14px; }
  .learning-page .jp-side-brand,.learning-page .jp-side-foot,.learning-page .jp-side-divider { display: none; }
  .learning-page .jp-side-nav { display: flex; gap: 6px; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .learning-page .jp-side-nav a,.learning-page .jp-side-nav button,
  .learning-page .jp-side-account-user a { flex: 0 0 auto; width: auto; min-height: 40px; padding: 8px 12px; gap: 6px; white-space: nowrap; }
  .learning-page .jp-side-account-user { flex: 0 0 auto; }
}

/* ============ MOJi 风格工具工作台 ============ */
.learning-page .ai-system-shell { width: min(1560px,calc(100% - 24px)); max-width: 1560px; grid-template-columns: 200px minmax(0,1fr); gap: 16px; margin: 12px auto 24px; }
.learning-page .ai-tools-page { min-width: 0; }
.learning-page .ai-tools-page .ai-tool-section { min-height: calc(100vh - 92px); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; box-shadow: 0 5px 20px rgba(31,38,46,.04) !important; }
.learning-page .ai-tools-page .ai-tool-heading { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 20px; border-bottom: 1px solid #e8eaed; }
.learning-page .ai-tools-page .ai-tool-heading > div { display: flex; align-items: baseline; gap: 11px; }
.learning-page .ai-tools-page .ai-tool-heading > div > span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.learning-page .ai-tools-page .ai-tool-heading h2 { margin: 0; font: 700 20px/1.2 var(--font-serif); }
.learning-page .ai-tools-page .ai-tool-heading p { margin: 0; color: #8a9098; font-size: 11px; }
.ai-app-workspace { flex: 1; min-height: 610px; grid-template-columns: minmax(300px,.82fr) minmax(600px,1.7fr); background: #fff; }
.ai-app-workspace .ai-input-pane { min-width: 0; display: flex; flex-direction: column; gap: 0; padding: 0 !important; border-right: 1px solid #e8eaed; background: #fff !important; }
.ai-pane-bar { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #eceef1; }
.ai-pane-bar > b { margin-right: auto; color: #30343a; font-size: 14px; }
.ai-pane-bar > small,.ai-pane-bar > label { color: #9298a1; font-size: 10px; }
.ai-pane-bar select { width: auto; min-width: 112px; min-height: 34px; margin: 0; padding: 0 30px 0 10px; border-color: #e1e4e8; border-radius: 18px; background: #fff; }
.ai-app-workspace .ai-direction-tabs { margin: 0; padding: 3px; border-radius: 18px; background: #f3f4f6; }
.ai-app-workspace .ai-direction-tabs button { min-height: 30px; padding: 5px 12px; border-radius: 15px; font-size: 11px; }
.ai-app-workspace .ai-input-pane textarea { flex: 1; min-height: 420px; margin: 0; padding: 24px 20px; resize: none; border: 0; border-radius: 0; background: #fff; box-shadow: none; font-size: 15px; line-height: 2; }
.ai-app-workspace .ai-input-pane textarea:focus { box-shadow: inset 0 0 0 2px rgba(190,76,44,.08); }
.ai-app-workspace .ai-primary-action { align-self: flex-end; min-width: 128px; min-height: 42px; margin: 14px 18px 18px; border-radius: 10px; }
.ai-app-workspace .ai-result-pane { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 290px; padding: 0; background: #fff; }
.ai-app-workspace .ai-empty-result,.ai-app-workspace .ai-tool-error { grid-column: 1/-1; align-self: center; margin: 24px; }
.ai-app-workspace .ai-output-main,.ai-app-workspace .ai-analysis-main { min-width: 0; margin: 0; padding: 22px; border: 0; border-right: 1px solid #eceef1; border-radius: 0; overflow: auto; }
.ai-app-workspace .ai-result-block > span,.ai-app-workspace .ai-result-subhead { min-height: 34px; display: flex; align-items: center; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid #eceef1; color: #30343a; font-size: 14px; font-weight: 700; }
.ai-app-workspace .ai-result-vocab { min-width: 0; margin: 0; padding: 22px 18px; border: 0; overflow: auto; background: #fcfcfd; }
.ai-app-workspace .ai-result-vocab .ai-result-subhead { align-items: flex-start; }
.ai-app-workspace .ai-result-vocab .ai-result-subhead small { display: block; }
.ai-app-workspace .ai-vocab-choice-grid { grid-template-columns: 1fr; }
.ai-app-workspace .ai-vocab-choice { padding: 10px 8px; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.ai-app-workspace .ai-collect-row { position: sticky; bottom: 0; grid-template-columns: 1fr; padding-top: 12px; background: #fcfcfd; }
.ai-app-workspace .ai-collect-row button { min-height: 38px; }
.ai-polish-workspace { grid-template-columns: minmax(280px,.72fr) minmax(680px,1.7fr); }
.ai-polish-workspace .ai-result-pane { grid-template-columns: 1fr 1fr; }
.ai-polish-workspace .ai-output-main,.ai-polish-workspace .ai-output-analysis { min-width: 0; margin: 0; padding: 22px; border: 0; border-right: 1px solid #eceef1; border-radius: 0; overflow: auto; }
.ai-polish-workspace .ai-output-analysis { border-right: 0; }
.ai-polish-workspace .ai-result-vocab { grid-column: 1/-1; max-height: 240px; border-top: 1px solid #eceef1; }
.ai-polish-workspace .ai-result-vocab .ai-vocab-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ai-polish-workspace .ai-result-vocab .ai-collect-row { grid-template-columns: minmax(140px,.7fr) minmax(160px,1fr) auto; }
.ai-analysis-main .ai-result-subhead small { margin-left: auto; color: #9298a1; font-size: 10px; font-weight: 400; }
.ai-analysis-main .ai-sentence-list { padding: 0; }
.ai-sentence-card header { grid-template-columns: 28px minmax(0,1fr) auto; }
.ai-context-open { min-height: 30px; padding: 5px 10px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fff; color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer; }
.ai-context-open:hover { border-color: var(--accent); background: #fff8f5; }
body.ai-modal-open { overflow: hidden; }
.ai-context-modal[hidden] { display: none !important; }
.ai-context-modal { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 30px; }
.ai-context-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(22,25,29,.55); cursor: default; }
.ai-context-dialog { position: relative; width: min(920px,calc(100vw - 48px)); max-height: min(820px,calc(100vh - 60px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.ai-context-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #eceef1; }
.ai-context-dialog > header small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.ai-context-dialog > header h2 { margin: 2px 0 0; font-size: 20px; }
.ai-context-dialog > header > button { width: 38px; height: 38px; border: 0; background: transparent; color: #818791; font-size: 29px; cursor: pointer; }
.ai-context-scroll { overflow: auto; padding: 28px clamp(22px,5vw,56px) 54px; }
.ai-context-sentence { margin-bottom: 28px; color: #32363c; font-size: 16px; line-height: 1.8; }
.ai-context-tree { width: min(650px,100%); display: grid; gap: 20px; margin: 0 auto; }
.ai-context-node { position: relative; width: fit-content; max-width: calc(100% - 42px); margin-left: min(calc(var(--node-index) * 42px),45%); padding: 12px 16px; border-radius: 10px; background: #f1f2f4; color: #34383e; }
.ai-context-node:not(:last-child)::after { content: ''; position: absolute; left: 50%; top: 100%; width: 38px; height: 21px; border-right: 1px solid #c9cdd3; border-bottom: 1px solid #c9cdd3; border-radius: 0 0 8px; }
.ai-context-node span { display: block; font-size: 17px; }
.ai-context-node b { display: inline-block; margin-top: 7px; color: var(--accent); font-size: 9px; }
.ai-context-node small { display: block; margin-top: 3px; color: #858b94; font-size: 10px; line-height: 1.55; }
@media (max-width: 1100px) {
  .learning-page .ai-system-shell { grid-template-columns: 180px minmax(0,1fr); }
  .ai-app-workspace { grid-template-columns: minmax(260px,.75fr) minmax(480px,1.3fr); }
  .ai-app-workspace .ai-result-pane { grid-template-columns: minmax(0,1fr) 240px; }
  .ai-polish-workspace .ai-result-pane { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .learning-page .ai-system-shell { width: min(100% - 20px,1560px); grid-template-columns: 1fr; }
  .learning-page .ai-tools-page .ai-tool-section { min-height: auto; }
  .ai-app-workspace,.ai-polish-workspace { grid-template-columns: 1fr; }
  .ai-app-workspace .ai-input-pane { border-right: 0; border-bottom: 1px solid #e8eaed; }
  .ai-app-workspace .ai-input-pane textarea { min-height: 240px; }
  .ai-app-workspace .ai-result-pane { min-height: 520px; }
}
@media (max-width: 650px) {
  .learning-page .ai-tools-page .ai-tool-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ai-app-workspace .ai-result-pane,.ai-polish-workspace .ai-result-pane { display: block; }
  .ai-app-workspace .ai-output-main,.ai-app-workspace .ai-analysis-main,.ai-polish-workspace .ai-output-analysis { border-right: 0; border-bottom: 1px solid #eceef1; }
  .ai-app-workspace .ai-result-vocab { max-height: none; }
  .ai-polish-workspace .ai-result-vocab .ai-vocab-choice-grid { grid-template-columns: 1fr; }
  .ai-polish-workspace .ai-result-vocab .ai-collect-row { grid-template-columns: 1fr; }
  .ai-context-modal { padding: 10px; }.ai-context-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); border-radius: 16px; }
  .ai-context-node { margin-left: min(calc(var(--node-index) * 18px),30%); }
}

/* 学习系统左侧导航统一：所有页面同宽、同间距，工具入口不再忽大忽小。 */
@media (min-width: 761px) {
  .jp-system-shell,.ai-system-shell { grid-template-columns: 224px minmax(0,1fr); }
  .jp-system-shell .jp-system-sidebar { min-height: 0; padding: 17px 14px 15px; border-radius: 24px; background: linear-gradient(180deg,rgba(255,253,248,.97),rgba(251,246,238,.94)); box-shadow: 0 12px 34px rgba(80,57,37,.08); }
  .jp-system-shell .jp-side-brand { padding: 8px 10px 16px; }
  .jp-system-shell .jp-side-nav { gap: 4px; padding-top: 12px; }
  .jp-system-shell .jp-side-nav a,.jp-system-shell .jp-side-nav button { min-height: 42px; padding: 9px 13px; border-radius: 13px; font-size: 14px; }
  .jp-system-shell .jp-side-nav a span,.jp-system-shell .jp-side-nav button span { width: 24px; font-size: 16px; }
  .jp-system-shell .jp-side-divider { margin: 8px 10px; }
  .jp-system-shell .jp-side-foot { margin-top: 12px; }
}

/* ============ 学习入口页：精简后的版式 ============ */
.jp-system-shell:not(.ai-system-shell) {
  max-width: 1220px;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 28px;
  margin: 22px auto 36px;
}
.jp-system-shell:not(.ai-system-shell) .jp-system-sidebar {
  position: sticky;
  top: 82px;
  min-height: 0;
  padding: 17px 14px 15px;
  border-radius: 24px;
  background: linear-gradient(180deg,rgba(255,253,248,.97),rgba(251,246,238,.94));
  box-shadow: 0 12px 34px rgba(80,57,37,.08);
}
.jp-system-shell:not(.ai-system-shell) .jp-side-brand { padding: 8px 10px 18px; }
.jp-system-shell:not(.ai-system-shell) .jp-side-brand span { box-shadow: 0 5px 12px rgba(184,80,46,.2); }
.jp-system-shell:not(.ai-system-shell) .jp-side-nav { gap: 7px; }
.jp-system-shell:not(.ai-system-shell) .jp-side-nav a { padding: 13px 15px; border-radius: 14px; }
.jp-system-shell:not(.ai-system-shell) .jp-side-nav a.active { box-shadow: 0 7px 15px rgba(184,80,46,.2); }
.jp-system-shell:not(.ai-system-shell) .jp-side-foot { margin-top: 15px; background: rgba(246,241,231,.88); }
.jp-system-shell:not(.ai-system-shell) .jp-workbench { max-width: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero {
  min-height: 0;
  padding: 42px 50px 40px;
  margin: 0;
  border-color: rgba(228,210,191,.88);
  border-radius: 30px;
  background:
    radial-gradient(circle at 94% 4%,rgba(226,145,153,.18),transparent 28%),
    linear-gradient(145deg,#fffefa 0%,#fcf5ed 100%);
  box-shadow: 0 20px 46px rgba(80,55,34,.08), inset 0 1px 0 rgba(255,255,255,.86);
}
.jp-system-shell:not(.ai-system-shell) .jp-search-hero::after { display: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero::before { display: none; }
.jp-system-shell:not(.ai-system-shell) .jp-hero-copy { margin-bottom: 20px; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-title { margin: 0; font-size: clamp(34px,4vw,48px); letter-spacing: .035em; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-sub { max-width: 610px; line-height: 1.6; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes { margin: 0 0 16px; padding: 5px; border-radius: 17px; background: rgba(255,255,255,.78); box-shadow: 0 5px 16px rgba(80,55,34,.04); }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button { min-width: 104px; justify-content: center; padding: 10px 18px; border-radius: 12px; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search { max-width: none; min-height: 68px; border: 1px solid rgba(230,218,202,.7); border-radius: 21px; box-shadow: 0 12px 30px rgba(80,55,34,.09); }
.jp-system-shell:not(.ai-system-shell) .jp-global-search-icon { margin-left: 22px; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search button { min-width: 132px; margin: 8px; border-radius: 15px; }
.jp-system-shell:not(.ai-system-shell) .jp-user-card {
  margin: 10px 0 0;
  padding: 12px 16px;
  border: 1px solid #ead0c3;
  border-radius: 12px 12px 20px 20px;
  background: linear-gradient(90deg,rgba(249,232,226,.82),rgba(255,250,245,.92));
  box-shadow: 0 8px 24px rgba(80,55,34,.045);
}
.jp-system-shell:not(.ai-system-shell) .jp-user-login strong { font-size: 13px; }
.jp-system-shell:not(.ai-system-shell) .jp-user-btns .btn { min-width: 76px; text-align: center; }

.jp-reference-panels { display: grid; gap: 18px; margin-top: 22px; }
.jp-reference-card { overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: rgba(255,253,249,.96); box-shadow: 0 12px 34px rgba(80,55,34,.065); }
.jp-reference-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 24px; padding: 18px 0 13px; border-bottom: 1px solid var(--border); }
.jp-reference-head h2 { margin: 0; color: var(--ink); font: 700 17px/1.3 var(--font-serif); }
.jp-reference-head a { color: var(--muted); font-size: 12px; }
.jp-reference-head a:hover { color: var(--accent); }
.jp-reference-head a span { font-size: 18px; vertical-align: -1px; }
.jp-common-list { display: flex; flex-wrap: wrap; gap: 9px 26px; padding: 17px 24px 21px; }
.jp-common-list button { position: relative; padding: 3px 0 3px 13px; border: 0; background: transparent; color: var(--accent); font: 500 14px/1.5 sans-serif; font-family: inherit; cursor: pointer; }
.jp-common-list button::before { content: ''; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #e39a83; transform: translateY(-50%); }
.jp-common-list button:hover { color: var(--accent-dark); transform: translateY(-1px); }
.jp-latest-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; padding: 8px 24px 16px; }
.jp-latest-row { display: grid; grid-template-columns: 92px minmax(0,1fr) 22px; align-items: center; gap: 16px; min-width: 0; padding: 14px 0; color: var(--ink); border-bottom: 0; }
.jp-latest-row + .jp-latest-row { border-left: 1px dashed var(--border); padding-left: 24px; }
.jp-latest-row:hover { color: var(--ink); }
.jp-latest-cover { width: 92px; aspect-ratio: 16/10; overflow: hidden; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg,#f7e9dd,#f5ddd7); color: var(--accent); font: 700 26px var(--font-serif); }
.jp-latest-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.jp-latest-row:hover .jp-latest-cover img { transform: scale(1.04); }
.jp-latest-body { min-width: 0; }
.jp-latest-body h3 { overflow: hidden; margin: 0 0 8px; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.jp-latest-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.jp-latest-meta span { padding: 2px 8px; border: 1px solid #e7a188; border-radius: 10px; color: var(--accent); }
.jp-latest-arrow { color: #c8b8a7; font-size: 17px; transition: transform .2s,color .2s; }
.jp-latest-row:hover .jp-latest-arrow { color: var(--accent); transform: translateX(3px); }

/* ============ JLPT 练习库 ============ */
.jlpt-system-shell { max-width: 1180px; grid-template-columns: 210px minmax(0,1fr); margin: 14px auto 0; }
.jlpt-library { min-width: 0; }
.jlpt-library-head { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 32px 38px; border: 1px solid #ead8c9; border-radius: 22px; background: radial-gradient(circle at 88% 20%,rgba(225,142,151,.22),transparent 28%),linear-gradient(145deg,#fffdf9,#fbf0e7); box-shadow: 0 16px 40px rgba(79,55,35,.08); }
.jlpt-library-head h1 { margin: 7px 0 5px; color: var(--ink); font: 700 clamp(28px,4vw,42px)/1.2 var(--font-serif); }
.jlpt-library-head p { margin: 0; color: var(--muted); font-size: 13px; }
.jlpt-level-mark { flex: 0 0 122px; height: 96px; display: grid; place-items: center; align-content: center; border-radius: 18px; background: var(--accent); color: #fff; box-shadow: 0 12px 28px rgba(184,80,46,.22); font: 800 34px/1 var(--font-serif); }
.jlpt-level-mark small { margin-top: 9px; font: 500 9px/1 sans-serif; letter-spacing: .08em; opacity: .78; }
.jlpt-level-tabs { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin: 15px 0; }
.jlpt-level-tabs a { min-height: 66px; display: flex; align-items: center; justify-content: center; flex-direction: column; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,253,249,.92); color: var(--ink); box-shadow: 0 6px 18px rgba(80,55,34,.045); }
.jlpt-level-tabs a b { font-size: 18px; }
.jlpt-level-tabs a small { min-height: 13px; margin-top: 2px; color: var(--muted); font-size: 9px; }
.jlpt-level-tabs a:hover,.jlpt-level-tabs a.active { border-color: var(--accent); color: var(--accent); }
.jlpt-level-tabs a.active { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(184,80,46,.2); }
.jlpt-level-tabs a.active small { color: rgba(255,255,255,.8); }
.jlpt-kind-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 15px; }
.jlpt-kind-grid button { min-width: 0; padding: 15px 7px 13px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,253,249,.92); color: var(--ink); font-family: inherit; cursor: pointer; }
.jlpt-kind-grid button > span { width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto 7px; border-radius: 10px; background: var(--paper); color: var(--accent); font: 700 15px var(--font-serif); }
.jlpt-kind-grid button b,.jlpt-kind-grid button small { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; }
.jlpt-kind-grid button b { font-size: 12px; }
.jlpt-kind-grid button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.jlpt-kind-grid button:hover,.jlpt-kind-grid button.active { border-color: #dfa188; background: #fff7f1; color: var(--accent); }
.jlpt-kind-grid button.active > span { background: var(--accent); color: #fff; }
.jlpt-paper-card { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,253,249,.96); box-shadow: 0 12px 34px rgba(80,55,34,.065); }
.jlpt-paper-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 25px 15px; border-bottom: 1px solid var(--border); }
.jlpt-paper-head h2 { margin: 4px 0 0; color: var(--ink); font: 700 19px/1.25 var(--font-serif); }
.jlpt-search { width: min(260px,42%); display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.jlpt-search span { color: var(--muted); font-size: 18px; }
.jlpt-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 12px sans-serif; font-family: inherit; }
.jlpt-question-list { padding: 4px 25px 10px; }
.jlpt-question-row { display: grid; grid-template-columns: 34px 42px minmax(0,1fr) auto 66px; align-items: center; gap: 13px; min-height: 82px; border-bottom: 1px dashed var(--border); color: var(--ink); }
.jlpt-question-row:last-child { border-bottom: 0; }
.jlpt-question-row[hidden] { display: none; }
.jlpt-question-row:hover { color: var(--ink); }
.jlpt-question-no { color: #c2b3a5; font: 600 11px/1 sans-serif; }
.jlpt-question-kind { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #f8e7df; color: var(--accent); font: 700 17px var(--font-serif); }
.jlpt-question-copy { min-width: 0; }
.jlpt-question-copy b,.jlpt-question-copy small { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; }
.jlpt-question-copy b { font-size: 14px; }
.jlpt-question-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.jlpt-question-tag { padding: 3px 8px; border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 10px; white-space: nowrap; }
.jlpt-question-go { color: var(--accent); font-size: 11px; white-space: nowrap; }
.jlpt-question-go i { margin-left: 4px; font-style: normal; transition: transform .2s; }
.jlpt-question-row:hover .jlpt-question-go i { display: inline-block; transform: translateX(3px); }
.jlpt-empty,.jlpt-no-match { padding: 48px 20px; color: var(--muted); text-align: center; }
.jlpt-empty > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: var(--paper); color: var(--accent); font: 700 22px var(--font-serif); }
.jlpt-empty h3 { margin: 0; color: var(--ink); font-size: 15px; }
.jlpt-empty p { margin: 7px 0 0; font-size: 12px; }
.jlpt-library-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 0 0 15px; }
.jlpt-library-tabs a { display: grid; grid-template-columns: 38px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; min-height: 66px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,253,249,.94); color: var(--ink); box-shadow: 0 6px 18px rgba(80,55,34,.045); }
.jlpt-library-tabs a > span { grid-row: 1/3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--paper); color: var(--accent); font: 700 15px var(--font-serif); }
.jlpt-library-tabs a b { font-size: 13px; }.jlpt-library-tabs a small { color: var(--muted); font-size: 9px; }
.jlpt-library-tabs a:hover,.jlpt-library-tabs a.active { border-color: #dfa188; color: var(--accent); }
.jlpt-library-tabs a.active { background: #fff7f1; box-shadow: 0 8px 22px rgba(184,80,46,.1); }
.jlpt-library-tabs a.active > span { background: var(--accent); color: #fff; }
.jlpt-paper-library,.jlpt-mock-library { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,253,249,.96); box-shadow: 0 12px 34px rgba(80,55,34,.065); }
.jlpt-collection-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 25px 16px; border-bottom: 1px solid var(--border); }
.jlpt-collection-head h2 { margin: 4px 0 0; color: var(--ink); font: 700 20px/1.25 var(--font-serif); }
.jlpt-paper-summary { display: flex; align-items: baseline; gap: 5px; color: var(--muted); }
.jlpt-paper-summary b { color: var(--accent); font: 700 22px var(--font-serif); }.jlpt-paper-summary span { font-size: 10px; }
.jlpt-year-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 18px 20px 22px; }
.jlpt-year-card { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: #fff; transition: transform .18s,border-color .18s,box-shadow .18s; }
.jlpt-year-card:hover { transform: translateY(-2px); border-color: #e2ad98; box-shadow: 0 9px 22px rgba(80,55,34,.07); }
.jlpt-year-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px 9px; border-bottom: 1px solid #f0e6dc; }
.jlpt-year-top b { color: var(--ink); font: 700 19px var(--font-serif); }.jlpt-year-top span { padding: 2px 7px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 9px; }
.jlpt-session-list { padding: 4px 15px 7px; }
.jlpt-session-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 37px; border-bottom: 1px dashed #eee1d5; }
.jlpt-session-row:last-child { border-bottom: 0; }.jlpt-session-row > span { color: var(--accent); font-size: 12px; font-weight: 700; }.jlpt-session-row small { color: var(--muted); font-size: 10px; }.jlpt-session-row i { color: #b7a99b; font-size: 9px; font-style: normal; }
.jlpt-session-row.has-resource { color: inherit; text-decoration: none; border-radius: 8px; transition: background-color .2s ease, transform .2s ease; }
.jlpt-session-row.has-resource:hover { background: #fff7f1; transform: translateX(2px); }
.jlpt-session-row.has-resource i { color: var(--accent); font-weight: 700; }
.jlpt-source-pages { display: grid; gap: 14px; margin: 18px 0; }
.jlpt-source-pages img { display: block; width: 100%; height: auto; border: 1px solid #eadfd3; border-radius: 12px; background: #fff; }
.jlpt-listening-resource audio { display: block; width: 100%; margin: 16px 0; }
.jlpt-exam-entry { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; align-items: center; gap: 28px; padding: 34px 38px; border: 1px solid #e6d8ca; border-radius: 18px; background: linear-gradient(135deg,#fffdf9 60%,#fff1ea); box-shadow: 0 12px 32px rgba(92,61,39,.08); }
.jlpt-exam-entry-mark { display: grid; place-items: center; align-content: center; width: 112px; height: 112px; border-radius: 22px; background: var(--accent); color: #fff; box-shadow: 0 12px 24px rgba(181,74,42,.2); }
.jlpt-exam-entry-mark span { font-size: 11px; letter-spacing: .18em; opacity: .8; }
.jlpt-exam-entry-mark strong { font: 700 42px/1.15 Georgia,serif; }
.jlpt-exam-entry-copy h2 { margin: 5px 0 8px; color: var(--ink); font-size: 24px; }
.jlpt-exam-entry-copy p { margin: 0; color: var(--muted); }
.jlpt-exam-entry-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.jlpt-exam-entry-meta span { padding: 5px 10px; border-radius: 999px; background: #f5eee6; color: #806f61; font-size: 11px; }
.jlpt-exam-entry-actions { display: grid; gap: 10px; min-width: 150px; }
.jlpt-exam-entry-actions .btn { justify-content: center; text-align: center; }
@media (max-width: 760px) { .jlpt-exam-entry { grid-template-columns: 78px 1fr; padding: 24px 20px; gap: 18px; }.jlpt-exam-entry-mark { width: 76px; height: 76px; border-radius: 16px; }.jlpt-exam-entry-mark strong { font-size: 30px; }.jlpt-exam-entry-copy h2 { font-size: 19px; }.jlpt-exam-entry-actions { grid-column: 1/-1; grid-template-columns: 1fr 1fr; } }
.jlpt-clean-library { padding: 28px; border: 1px solid #e9dfd5; border-radius: 18px; background: #f8f7f5; }
.jlpt-clean-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; padding: 0 4px 18px; border-bottom: 1px solid #e5e1dc; }
.jlpt-clean-head h2 { margin: 4px 0 0; color: var(--ink); font-size: 24px; }
.jlpt-clean-switch { display: flex; align-items: center; gap: 8px; }
.jlpt-clean-switch span,.jlpt-clean-switch a { padding: 8px 18px; border: 1px solid #e1ddd8; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; }
.jlpt-clean-switch .active { border-color: var(--accent); background: var(--accent); color: #fff; }
.jlpt-clean-switch b { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; margin-left: 8px; border: 1px solid #e1ddd8; border-radius: 8px; background: #fff; color: var(--accent); }
.jlpt-clean-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.jlpt-clean-card { min-height: 132px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent; border-radius: 14px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 5px 16px rgba(86,66,50,.035); }
.jlpt-clean-card h3 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; }
.jlpt-clean-card span { display: block; margin-top: 8px; color: #b0a59c; font-size: 11px; }
.jlpt-clean-card strong { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; color: var(--accent); font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity .18s,transform .18s; }
.jlpt-clean-card.available { border-color: #eadfd6; }
.jlpt-clean-card.available:hover { border-color: #d78365; box-shadow: 0 10px 25px rgba(151,84,54,.1); transform: translateY(-2px); }
.jlpt-clean-card.available:hover strong { opacity: 1; transform: none; }
@media (max-width: 960px) { .jlpt-clean-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 680px) { .jlpt-clean-library { padding: 18px; }.jlpt-clean-head { align-items: flex-start; flex-direction: column; }.jlpt-clean-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.jlpt-clean-card { min-height: 110px; padding: 16px; } }
.jlpt-mock-grid { display: grid; gap: 12px; padding: 18px 20px 22px; }
.jlpt-mock-card { display: grid; grid-template-columns: 54px minmax(0,1fr) 80px 72px; align-items: center; gap: 15px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.jlpt-mock-card.featured { border-color: #e1ad98; background: linear-gradient(100deg,#fffaf5,#fff); }
.jlpt-mock-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: #f7e7df; color: var(--accent); font: 700 19px var(--font-serif); }
.jlpt-mock-card small { color: var(--muted); font-size: 9px; }.jlpt-mock-card h3 { margin: 3px 0 4px; color: var(--ink); font-size: 14px; }.jlpt-mock-card p { margin: 0; color: var(--muted); font-size: 10px; }
.jlpt-mock-card > strong { color: var(--accent); font: 700 24px var(--font-serif); text-align: center; }.jlpt-mock-card > strong small { display: block; margin-top: 3px; font: 500 9px sans-serif; }
.jlpt-mock-card > em { padding: 6px 8px; border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 9px; font-style: normal; text-align: center; }

@media (max-width: 760px) {
  .jp-system-shell:not(.ai-system-shell) { display: block; margin-top: 0; }
  .jp-system-shell:not(.ai-system-shell) .jp-system-sidebar { position: static; margin-bottom: 12px; border-radius: 14px; box-shadow: var(--shadow); }
  .jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 30px 20px 26px; border-radius: 20px; }
  .jp-system-shell:not(.ai-system-shell) .jp-user-card { border-radius: 10px 10px 17px 17px; }
  .jp-reference-card { border-radius: 16px; }
  .jp-reference-head { margin-inline: 18px; }
  .jp-common-list { gap: 8px 20px; padding-inline: 18px; }
  .jp-latest-list { grid-template-columns: 1fr; padding-inline: 18px; }
  .jp-latest-row { grid-template-columns: 72px minmax(0,1fr) 16px; gap: 11px; }
  .jp-latest-row + .jp-latest-row { border-left: 0; border-top: 1px dashed var(--border); padding-left: 0; }
  .jp-latest-cover { width: 72px; }
  .jp-latest-body h3 { font-size: 14px; }
  .jlpt-system-shell { display: block; margin-top: 0; }
  .jlpt-library-head { padding: 25px 20px; border-radius: 18px; }
  .jlpt-level-mark { flex-basis: 78px; height: 72px; border-radius: 14px; font-size: 25px; }
  .jlpt-level-mark small { display: none; }
  .jlpt-level-tabs { gap: 6px; }
  .jlpt-level-tabs a { min-height: 54px; border-radius: 12px; }
  .jlpt-kind-grid { grid-template-columns: repeat(3,1fr); }
  .jlpt-library-tabs { grid-template-columns: 1fr; }
  .jlpt-library-tabs a { min-height: 58px; }
  .jlpt-year-grid { grid-template-columns: 1fr; padding-inline: 14px; }
  .jlpt-collection-head { padding-inline: 18px; }
  .jlpt-mock-grid { padding-inline: 14px; }
  .jlpt-mock-card { grid-template-columns: 46px minmax(0,1fr) 58px; gap: 10px; padding: 14px; }
  .jlpt-mock-icon { width: 43px; height: 43px; }.jlpt-mock-card > em { display: none; }.jlpt-mock-card > strong { font-size: 20px; }
  .jlpt-paper-head { align-items: stretch; flex-direction: column; padding-inline: 18px; }
  .jlpt-search { width: auto; }
  .jlpt-question-list { padding-inline: 18px; }
  .jlpt-question-row { grid-template-columns: 34px minmax(0,1fr) 46px; gap: 10px; padding: 12px 0; }
  .jlpt-question-no,.jlpt-question-tag { display: none; }
  .jlpt-question-go { text-align: right; }
}

@media print {
  .chat-bubble, .chat-panel { display: none !important; }
}

/* 网站维护页 */
.maintenance-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 75% 15%,rgba(238,168,151,.25),transparent 30%),var(--paper,#f8f4ec); color: var(--ink,#3c3731); }
.maintenance-card { width: min(620px,100%); padding: 62px 44px; text-align: center; border: 1px solid var(--border,#e8d9c5); border-radius: 34px; background: rgba(255,253,249,.94); box-shadow: 0 24px 70px rgba(91,66,45,.12); }
.maintenance-mark { width: 76px; height: 76px; margin: 0 auto 26px; display: grid; place-items: center; border-radius: 24px; background: var(--accent,#bd4f2d); color: #fff; font: 700 34px var(--font-serif,serif); box-shadow: 0 12px 28px rgba(189,79,45,.24); transform: rotate(-3deg); }
.maintenance-card h1 { margin: 0; font: 700 clamp(34px,6vw,54px) var(--font-serif,serif); letter-spacing: .06em; }
.maintenance-card p { margin: 22px auto 0; max-width: 430px; color: var(--muted,#887b6d); font-size: 17px; line-height: 1.9; white-space: pre-line; }
.maintenance-line { width: 54px; height: 3px; margin: 30px auto 0; border-radius: 99px; background: var(--accent,#bd4f2d); opacity: .75; }
.maintenance-admin-link { display: inline-flex; margin-top: 24px; padding: 9px 16px; border: 1px solid #dfd5ca; border-radius: 10px; background: #fff; color: var(--muted,#887b6d); font-size: 12px; text-decoration: none; transition: border-color .18s,color .18s; }
.maintenance-admin-link:hover { border-color: var(--accent,#bd4f2d); color: var(--accent,#bd4f2d); }
@media (max-width: 560px) { .maintenance-page { padding: 18px; }.maintenance-card { padding: 46px 24px; border-radius: 24px; }.maintenance-mark { width: 64px; height: 64px; border-radius: 20px; font-size: 29px; } }

/* 独立个人中心 */
.profile-page { display: grid; gap: 18px; }
.profile-hero { padding: 30px 34px; border: 1px solid #e4e7eb; border-radius: 22px; background: #fff; box-shadow: 0 12px 32px rgba(31,38,46,.05); }
.profile-hero span,.profile-card-head span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.profile-hero h1 { margin: 5px 0 4px; font-size: 32px; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-login-gate { padding: 70px 24px; border: 1px solid #e4e7eb; border-radius: 22px; background: #fff; text-align: center; }
.profile-login-gate > span { display: block; margin-bottom: 12px; font-size: 42px; }
.profile-login-gate h2 { margin-bottom: 7px; font-size: 22px; }
.profile-login-gate p { margin-bottom: 22px; color: var(--muted); }
.profile-account-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 18px; }
.profile-account-layout[hidden],.profile-login-gate[hidden] { display: none !important; }
.profile-card { padding: 26px; border: 1px solid #e4e7eb; border-radius: 20px; background: #fff; box-shadow: 0 10px 28px rgba(31,38,46,.045); }
.profile-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #eceef1; }
.profile-card-head h2 { margin: 4px 0 0; font-size: 20px; }
.profile-card-head a { font-size: 12px; font-weight: 700; }
.profile-identity { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-identity p { margin-top: 7px; color: var(--muted); font-size: 11px; }
.profile-avatar { width: 82px; height: 82px; flex: 0 0 82px; border: 4px solid #fff; box-shadow: 0 0 0 1px #e4e7eb,0 8px 22px rgba(31,38,46,.08); }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.profile-form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.profile-form-grid input,.profile-password-fields input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #dfe3e7; border-radius: 11px; outline: none; background: #fafbfc; color: var(--ink); font: inherit; }
.profile-form-grid input:focus,.profile-password-fields input:focus { border-color: #cf765a; box-shadow: 0 0 0 3px rgba(191,77,44,.08); background: #fff; }
.profile-readonly { min-height: 44px; display: flex; align-items: center; padding: 0 13px; border: 1px solid #eceef1; border-radius: 11px; background: #f5f6f8; color: var(--ink); font-size: 13px; }
.profile-password-fields { display: grid; gap: 11px; }
.profile-password-fields .btn { min-height: 43px; }
.profile-post-card { grid-column: 1 / -1; }
.profile-post-card .acc-posts { max-height: none; }
.profile-logout { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.profile-logout .btn { min-width: 110px; }
@media (max-width: 780px) { .profile-account-layout { grid-template-columns: 1fr; }.profile-post-card,.profile-logout { grid-column: auto; }.profile-form-grid { grid-template-columns: 1fr; } }

/* ============ 全站白色主题与紧凑布局（最终覆盖） ============ */
html { background: #f5f6f8; }
body { min-height: 100vh; background: #f5f6f8 !important; background-image: none !important; color: #25272b; }
.page-main { max-width: 1280px; padding: 26px 20px 48px; }
.navbar { background: rgba(255,255,255,.96) !important; border-color: #e5e7eb; box-shadow: 0 1px 12px rgba(25,32,40,.04); }
.footer { background: #fff; border-top-color: #e5e7eb; }
.article-card,.article-row,.widget,.article-detail,.auth-card,.rb-setup,.rb-arena,.rb-result,
.jp-hero,.jp-feature-card,.words-gate,.comment-guest,.wcard-face,.wlist-item,.comment-form,.comment-item,
.shogi-need-login,.shogi-lobby-card,.shogi-room-top,.shogi-waiting,.editor-wrap {
  background: #fff !important;
  border-color: #e3e6ea !important;
  box-shadow: 0 8px 24px rgba(31,38,46,.045);
}
.article-card,.article-row,.widget,.article-detail,.jp-feature-card { border-radius: 16px; }
.article-card:hover,.article-row:hover,.jp-feature-card:hover { border-color: #d2d6dc !important; box-shadow: 0 14px 30px rgba(31,38,46,.08); }
.btn { border-radius: 10px; }
.section { margin-bottom: 28px; }
.home-layout,.list-layout,.detail-layout { gap: 28px; }

/* 学习系统统一为紧凑白色工作台，覆盖旧版米黄渐变。 */
.learning-page .jp-system-shell,
.learning-page .jp-system-shell:not(.ai-system-shell),
.learning-page .ai-system-shell,
.learning-page .jlpt-system-shell { width: min(1280px,calc(100% - 32px)); max-width: 1280px; grid-template-columns: 210px minmax(0,1fr); gap: 22px; margin: 20px auto 38px; }
.learning-page .jp-system-sidebar,
.learning-page .jp-system-shell:not(.ai-system-shell) .jp-system-sidebar,
.learning-page .jp-system-shell .jp-system-sidebar {
  padding: 14px 12px;
  border: 1px solid #e3e6ea;
  border-radius: 18px;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(31,38,46,.05);
}
.learning-page .jp-side-brand { padding: 5px 9px 14px; }
.learning-page .jp-side-nav { gap: 3px; padding-top: 11px; }
.learning-page .jp-system-shell .jp-side-nav a,
.learning-page .jp-system-shell .jp-side-nav button { min-height: 40px; padding: 8px 11px; border-radius: 10px; font-size: 13px; }
.learning-page .jp-system-shell .jp-side-nav a > span:first-child,
.learning-page .jp-system-shell .jp-side-nav button > span:first-child { flex: 0 0 22px; width: 22px; font-size: 15px; }
.learning-page .jp-system-shell .jp-side-nav a > span:not(:first-child),
.learning-page .jp-system-shell .jp-side-nav button > span:not(:first-child) { flex: 1 1 auto; width: auto !important; min-width: 0; white-space: nowrap; }
.learning-page .jp-side-account-user { min-width: 0; }
.learning-page .jp-side-account-user > a { display: flex; width: 100%; }
.learning-page .jp-side-foot { margin-top: 10px; padding: 10px 11px; background: #f5f6f8 !important; }

.learning-page .jp-search-hero,
.learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero,
.learning-page .jlpt-library-head,
.learning-page .ai-page-head,
.learning-page .ai-tool-section,
.learning-page .jp-reference-card,
.learning-page .jlpt-paper-card,
.learning-page .jlpt-paper-library,
.learning-page .jlpt-mock-library,
.learning-page .jlpt-library-tabs a,
.learning-page .jlpt-level-tabs a,
.learning-page .jlpt-kind-grid button {
  border-color: #e3e6ea !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(31,38,46,.045) !important;
}
.learning-page .jp-search-hero,
.learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 30px 34px 28px; border-radius: 20px; }
.learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-title { font-size: clamp(30px,3.2vw,42px); }
.learning-page .jp-search-modes { margin-bottom: 12px; background: #f5f6f8 !important; box-shadow: none !important; }
.learning-page .jp-global-search { min-height: 58px !important; border-color: #dfe3e8 !important; border-radius: 16px !important; box-shadow: none !important; }
.learning-page .jp-global-search button { min-width: 108px !important; margin: 6px !important; border-radius: 12px !important; }
.learning-page .ai-tool-heading,.learning-page .ai-page-head { background: #fff !important; }
.learning-page .ai-input-pane { background: #fafbfc !important; }
.learning-page .jlpt-clean-library { border-color: #e3e6ea; background: #fff; }
.learning-page .jlpt-exam-entry { border-color: #e3e6ea; background: #fff; box-shadow: 0 8px 26px rgba(31,38,46,.045); }

/* 个人中心标题改成紧凑页头，避免占用首屏。 */
.profile-page { gap: 14px; }
.profile-hero { min-height: 0; padding: 20px 26px; border-radius: 16px; box-shadow: 0 6px 20px rgba(31,38,46,.04); }
.profile-hero > div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 14px; }
.profile-hero span { grid-column: 1; font-size: 9px; }
.profile-hero h1 { grid-column: 2; grid-row: 1; margin: 0; font-size: 25px; }
.profile-hero p { grid-column: 1 / -1; margin-top: 5px; font-size: 12px; }
.profile-account-layout { gap: 14px; }
.profile-card { padding: 22px; border-radius: 16px; box-shadow: 0 6px 20px rgba(31,38,46,.04); }
.profile-card-head { margin-bottom: 18px; padding-bottom: 13px; }

@media (max-width: 900px) {
  .learning-page .jp-system-shell,.learning-page .jp-system-shell:not(.ai-system-shell),.learning-page .ai-system-shell,.learning-page .jlpt-system-shell { width: min(100% - 24px,1280px); grid-template-columns: 1fr; gap: 14px; }
  .learning-page .jp-system-sidebar { position: static; }
}
@media (max-width: 600px) {
  .page-main { padding: 16px 12px 34px; }
  .learning-page .jp-system-shell,.learning-page .jp-system-shell:not(.ai-system-shell),.learning-page .ai-system-shell,.learning-page .jlpt-system-shell { width: calc(100% - 16px); margin-top: 10px; }
  .learning-page .jp-search-hero,.learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 24px 18px 20px; }
  .profile-hero { padding: 17px 18px; }
  .profile-hero > div { display: block; }
  .profile-hero h1 { margin-top: 2px; font-size: 23px; }
}

/* 工具页保持本站卡片布局；参考产品仅复用功能与交互。 */
.learning-page .ai-tools-page .ai-tool-section { min-height: 0; display: block; }
.learning-page .ai-tools-page .ai-tool-heading { display: block; min-height: 0; padding: 24px 27px 19px; }
.learning-page .ai-tools-page .ai-tool-heading h2 { margin: 4px 0 5px; font: 700 24px/1.2 var(--font-serif); }
.learning-page .ai-tools-page .ai-tool-heading p { margin: 0; font-size: 12px; }
.learning-page .ai-tools-page .ai-polish-workspace { grid-template-columns: minmax(280px,.82fr) minmax(360px,1.18fr); }
.learning-page .ai-tools-page .ai-polish-workspace .ai-result-pane { display: block; }
.learning-page .ai-tools-page .ai-polish-workspace .ai-result-vocab { max-height: none; }

/* 公开词单广场 */
.ai-vocab-lists { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ai-vocab-lists > .ai-empty-result { grid-column: 1 / -1; min-height: 112px; border: 1px dashed #dfe3e7; border-radius: 14px; background: #fafbfc; }
.vocab-square-card { overflow: hidden; border: 1px solid #e3e6ea; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(31,38,46,.045); transition: transform .18s,box-shadow .18s,border-color .18s; }
.vocab-square-card:hover { transform: translateY(-3px); border-color: #d6b3a5; box-shadow: 0 14px 30px rgba(31,38,46,.08); }
.vocab-square-cover { height: 142px; display: grid; place-items: center; background-color: #f3f4f6; background-position: center; background-size: cover; text-decoration: none; }
.vocab-square-cover span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; background: #fff; color: var(--accent); font: 700 25px var(--font-serif); box-shadow: 0 8px 20px rgba(31,38,46,.08); }
.vocab-square-body { padding: 16px; }
.vocab-square-owner { display: flex; align-items: center; gap: 7px; color: #858b94; }
.vocab-square-owner > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #f7e9e3; color: var(--accent); font-size: 10px; font-weight: 800; }
.vocab-square-owner small { font-size: 10px; }
.vocab-square-body h3 { margin: 12px 0 6px; font-size: 17px; }.vocab-square-body h3 a { color: var(--ink); text-decoration: none; }
.vocab-square-body > p { min-height: 38px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.vocab-square-body footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eceef1; }
.vocab-square-body footer > span { color: #9399a2; font-size: 9px; }
.vocab-favorite { padding: 6px 10px; border: 1px solid #e1e4e8; border-radius: 8px; background: #fff; color: #6d737c; font-size: 10px; cursor: pointer; }.vocab-favorite.active { border-color: #e4b4a3; background: #fff5f1; color: var(--accent); }

/* 独立词单详情页 */
.vocab-detail-page { display: grid; gap: 16px; }.vocab-detail-loading { padding: 70px 24px; border: 1px solid #e3e6ea; border-radius: 18px; background: #fff; color: var(--muted); text-align: center; }
.vocab-detail-hero { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 28px; align-items: center; padding: 26px; border: 1px solid #e3e6ea; border-radius: 18px; background: #fff; box-shadow: 0 7px 24px rgba(31,38,46,.045); }
.vocab-detail-cover { aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: #f1f3f5; }.vocab-detail-cover img { width: 100%; height: 100%; object-fit: cover; }.vocab-detail-cover span { color: var(--accent); font: 700 42px var(--font-serif); }
.vocab-detail-hero a { color: var(--accent); font-size: 11px; text-decoration: none; }.vocab-detail-hero h1 { margin: 10px 0 6px; font-size: 30px; }.vocab-detail-hero p { margin: 0 0 8px; color: var(--muted); }.vocab-detail-meta { margin-bottom: 16px; color: #90969e; font-size: 10px; }
.vocab-detail-content { padding: 24px; border: 1px solid #e3e6ea; border-radius: 18px; background: #fff; }.vocab-detail-content > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid #eceef1; }.vocab-detail-content > header span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }.vocab-detail-content > header h2 { margin: 3px 0 0; font-size: 21px; }.vocab-detail-content > header small { color: var(--muted); font-size: 10px; }
.vocab-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding-top: 18px; }.vocab-detail-word { padding: 16px; border: 1px solid #e5e8ec; border-radius: 13px; background: #fff; text-align: left; cursor: pointer; transition: border-color .18s,transform .18s; }.vocab-detail-word:hover { transform: translateY(-2px); border-color: #d69a83; }.vocab-detail-word b { font-size: 17px; }.vocab-detail-word small { margin-left: 8px; color: var(--accent); }.vocab-detail-word p { margin: 8px 0; color: var(--muted); font-size: 11px; }.vocab-detail-word i { color: var(--accent); font-size: 9px; font-style: normal; }
.vocab-word-modal[hidden] { display: none !important; }.vocab-word-modal { position: fixed; inset: 0; z-index: 5100; display: grid; place-items: center; padding: 20px; }.vocab-word-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(20,24,29,.5); }.vocab-word-modal > section { position: relative; width: min(520px,100%); padding: 30px; border-radius: 20px; background: #fff; box-shadow: 0 26px 80px rgba(0,0,0,.23); }.vocab-word-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #8b9199; font-size: 26px; cursor: pointer; }.vocab-word-modal > section > span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }.vocab-word-modal h2 { margin: 6px 0 2px; font-size: 29px; }.vocab-word-reading { color: var(--accent); }.vocab-word-modal dl { margin: 20px 0; }.vocab-word-modal dl div { padding: 13px 0; border-top: 1px solid #eceef1; }.vocab-word-modal dt { color: #979da5; font-size: 9px; }.vocab-word-modal dd { margin: 5px 0 0; line-height: 1.75; }

/* 个人中心词单管理 */
.profile-card-intro { margin: -6px 0 18px; color: var(--muted); font-size: 11px; }.profile-vocab-item { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 18px; padding: 16px 0; border-top: 1px solid #eceef1; }.profile-vocab-item:first-child { border-top: 0; }.profile-vocab-cover { position: relative; height: 112px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #f1f3f5; }.profile-vocab-cover img { width: 100%; height: 100%; object-fit: cover; }.profile-vocab-cover > span { color: var(--accent); font: 700 31px var(--font-serif); }.profile-vocab-cover button { position: absolute; right: 7px; bottom: 7px; padding: 5px 8px; border: 0; border-radius: 7px; background: rgba(255,255,255,.92); color: var(--accent); font-size: 9px; cursor: pointer; }.profile-vocab-fields { display: grid; grid-template-columns: minmax(160px,.65fr) minmax(220px,1fr); gap: 10px 14px; align-items: end; }.profile-vocab-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }.profile-vocab-fields input,.profile-vocab-fields textarea { width: 100%; padding: 9px 11px; border: 1px solid #dfe3e8; border-radius: 9px; background: #fafbfc; font: inherit; }.profile-vocab-fields textarea { min-height: 62px; resize: vertical; }.profile-vocab-fields > small { color: #91979f; }.profile-vocab-fields > div { display: flex; justify-content: flex-end; gap: 8px; }.profile-vocab-delete { color: #b43c32; }
@media (max-width: 900px) { .ai-vocab-lists,.vocab-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.profile-vocab-fields { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .ai-vocab-lists,.vocab-detail-grid { grid-template-columns: 1fr; }.vocab-detail-hero,.profile-vocab-item { grid-template-columns: 1fr; }.vocab-detail-cover { max-width: 220px; }.vocab-detail-content > header { align-items: flex-start; flex-direction: column; }.profile-vocab-cover { width: 160px; } }

/* 日语首页桌面端尺寸修复：取消旧版 jp-hub 的窄栏与自动居中限制。 */
@media (min-width: 901px) {
  .learning-page .jp-system-shell:not(.ai-system-shell) {
    width: min(1480px,calc(100% - 40px));
    max-width: 1480px;
    grid-template-columns: 224px minmax(0,1fr);
    gap: 28px;
  }
  .learning-page .jp-system-shell:not(.ai-system-shell) > .jp-hub.jp-workbench {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    justify-self: stretch;
  }
  .learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero {
    width: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 46px 54px 44px;
  }
  .learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-title {
    font-size: clamp(40px,4vw,58px);
  }
  .learning-page .jp-system-shell:not(.ai-system-shell) .jp-search-modes {
    align-self: flex-start;
  }
  .learning-page .jp-system-shell:not(.ai-system-shell) .jp-global-search {
    width: 100%;
    min-height: 66px !important;
  }
}

/* 最终覆盖：日语查询页采用参考图中的轻量搜索布局 */
.jp-system-shell:not(.ai-system-shell) .jp-search-hero { min-height: 0 !important; padding: 18px 54px 4px !important; margin: 0 0 16px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.jp-system-shell:not(.ai-system-shell) .jp-search-hero .jp-hero-copy { display: none !important; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search { min-height: 58px !important; border: 2px solid #e2d9d5 !important; border-radius: 999px !important; box-shadow: none !important; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search:focus-within { border-color: #d36450 !important; box-shadow: 0 0 0 4px rgba(211,100,80,.08) !important; }
.jp-system-shell:not(.ai-system-shell) .jp-global-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes { display: flex !important; width: auto !important; align-self: auto !important; gap: 42px !important; margin: 10px 12px 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button { min-width: 0 !important; padding: 10px 4px 13px !important; border-radius: 0 !important; background: transparent !important; color: #554b45 !important; box-shadow: none !important; }
.jp-system-shell:not(.ai-system-shell) .jp-search-modes button.active { color: #c64d35 !important; }
@media (max-width:720px) {
  .jp-system-shell:not(.ai-system-shell) .jp-search-hero { padding: 12px 8px 2px !important; }
  .jp-system-shell:not(.ai-system-shell) .jp-search-modes { gap: 26px !important; margin-left: 8px !important; }
}
.my-vocab-manager{margin:0 24px 24px;padding-top:24px;border-top:1px solid #e4e7ea}.my-vocab-manager>header span{font-size:10px;letter-spacing:.16em;color:#c34e2d}.my-vocab-manager>header h2{margin:4px 0}.my-vocab-manager>header p{color:#7c8590}.my-vocab-manager>#myVocabLists>.ai-empty-result{min-height:112px;margin-top:16px;border:1px dashed #dfe3e7;border-radius:14px;background:#fafbfc}.my-vocab-card{margin-top:16px;padding:18px;border:1px solid #e3e7ea;border-radius:16px;background:#fff}.my-vocab-fields{display:grid;grid-template-columns:1fr 1.4fr auto auto;gap:10px;align-items:center}.my-vocab-fields>input{padding:10px;border:1px solid #dfe3e7;border-radius:9px}.my-vocab-fields label{font-size:12px;color:#59626c}.my-vocab-fields>button{padding:9px 13px;border:0;border-radius:9px;background:#c34e2d;color:#fff}.my-vocab-items{margin-top:14px;border-top:1px solid #edf0f2}.my-vocab-items>div{display:flex;justify-content:space-between;align-items:center;padding:10px 2px;border-bottom:1px solid #edf0f2}.my-vocab-items span{display:flex;gap:12px}.my-vocab-items small{color:#89919a}.my-vocab-items button{border:0;background:none;color:#b34e35;cursor:pointer}@media(max-width:760px){.my-vocab-manager{margin:0 18px 18px}.my-vocab-fields{grid-template-columns:1fr}.my-vocab-items span{display:block}}

/* 2026 首页体验增强：紧凑内容、触控、反馈与无障碍 */
.latest-articles-section .article-grid{gap:12px}
.latest-articles-section .article-card{display:grid;grid-template-columns:132px minmax(0,1fr);min-height:118px}
.latest-articles-section .card-cover{height:100%;min-height:118px;aspect-ratio:auto}
.latest-articles-section .card-body{padding:13px 15px;gap:5px}
.latest-articles-section .card-summary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}
button,.btn,.navbar a,.more-link,.article-card,.video-card,.widget-list a{touch-action:manipulation}
button,.btn,.pomo-chip,.pomo-btn,.tt-arrow,.focus-exit-btn{min-height:44px;min-width:44px}
a:focus-visible,button:focus-visible,input:is([type=checkbox],[type=radio],[type=range],[type=file]):focus-visible,[role="button"]:focus-visible{outline:3px solid rgba(184,80,46,.38);outline-offset:3px}
.interaction-toast{position:fixed;left:50%;bottom:28px;z-index:1001;transform:translate(-50%,10px);padding:11px 18px;border-radius:999px;background:#332f2a;color:#fff;box-shadow:0 12px 30px rgba(0,0,0,.2);opacity:0;transition:opacity .18s ease,transform .18s ease}
.interaction-toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:680px){.latest-articles-section .article-grid{grid-template-columns:1fr}.latest-articles-section .article-card{grid-template-columns:104px minmax(0,1fr);min-height:108px}.latest-articles-section .card-cover{min-height:108px}.latest-articles-section .card-summary{display:none}.latest-articles-section .card-meta{flex-wrap:wrap;gap:5px}.timetable-section .section-head{align-items:stretch}.timetable-section .section-head .btn{flex:1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* ============================================================
   移动端修补 · 第 1 批（2026-10-16）——手机上「用不了」的问题
   全部追加在文件末尾，靠「后写的规则优先」覆盖旧样式，不动旧代码
   ============================================================ */

/* 文章正文 / 语法页的宽表格：手机里改成横向滚动，不再把整页撑宽 */
@media (max-width: 760px) {
  .article-content table,
  .grammar-original table.connect {
    display: block;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  /* 语法对比弹窗：两列并排改上下排列 */
  .grammar-compare-grid { grid-template-columns: 1fr; }
}

/* 手机窄屏：专注模式数字缩小、按钮换行；文章信息条换行 */
@media (max-width: 640px) {
  .focus-display .pomo-digit { width: 54px; height: 80px; border-radius: 10px; }
  .focus-display .pomo-strip span { width: 54px; height: 80px; font-size: 46px; }
  .focus-display .pomo-sep { font-size: 32px; }
  .focus-modal { gap: 18px; padding: 60px 12px 32px; }
  .focus-actions { flex-wrap: wrap; gap: 10px; }
  .focus-actions .btn { min-width: 106px; padding: 11px 14px; font-size: 15px; }
  .detail-meta { flex-wrap: wrap; row-gap: 4px; }
  .detail-print-btn { margin-left: 0; }
}

/* ============================================================
   移动端修补 · 第 2 批（2026-10-16）——导航栏折叠 + 触控目标
   ============================================================ */

/* 导航链接：900px 以下整体换到第二行居中，不再和 logo、按钮挤成两三行 */
@media (max-width: 900px) {
  .nav-links { order: 3; width: 100%; justify-content: center; margin-left: 0; }
}

/* 触控目标：手机上常用链接也保证至少 44px 高，手指好点 */
@media (max-width: 760px) {
  .nav-links a,
  .pagination .page,
  .pagination .page-nav,
  .more-link,
  .nav-login,
  .doc-download,
  .jp-feature-go,
  .quiz-page-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }
  /* 侧边栏列表：整行都可以点 */
  .widget-list a { display: flex; align-items: center; min-height: 44px; }
  .jp-btn, .nav-share { min-height: 44px; }
}

/* 轮播图小圆点：视觉不变，用隐形外圈把可点击范围放大到约 33px */
.carousel-dots .dot { position: relative; }
.carousel-dots .dot::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; }

/* ============================================================
   移动端修补 · 第 3 批（2026-10-16）——手机字号统一
   ============================================================ */

/* 大标题在手机上降级，不再占半屏 */
@media (max-width: 640px) {
  .word-entry-page h1 { font-size: 28px; }
  .jp-dict-result summary h3 { font-size: 21px; }
  .jp-grammar-preview-main h2 { font-size: 23px; }
  .vocab-detail-hero h1 { font-size: 24px; }
  .vocab-word-modal h2 { font-size: 24px; }
  .grammar-compare-modal h1 { font-size: 23px; }
  .vocab-flash-card h2 { font-size: 32px; }
}

/* 阅读类小字在手机上放大，不用眯眼 */
@media (max-width: 760px) {
  .study-notice span { font-size: 12px; }
  .card-meta { font-size: 13px; }
  .quiz-sheet-head small { font-size: 12px; }
  .jp-task-row small { font-size: 13px; }
  .jp-daily-tags span { font-size: 12px; }
  .jp-latest-meta { font-size: 12px; }
  .jlpt-exam-entry-meta span { font-size: 12px; }
  .vocab-square-body > p { font-size: 13px; }
  .vocab-detail-word p { font-size: 13px; }
  .vocab-square-owner small { font-size: 12px; }
  .vocab-square-body footer > span { font-size: 11px; }
  .vocab-detail-meta { font-size: 12px; }
  .vocab-detail-content > header small { font-size: 12px; }
  .vocab-word-modal dt { font-size: 11px; }
  .vocab-detail-content > header span { font-size: 10px; }
}

/* ============================================================
   移动端修补 · 第 4 批（2026-10-16）——首屏空间、导航、列表排版
   ============================================================ */

/* 第 2 批给这些元素设了 display，会顶掉 HTML 的 hidden 属性
   （登录后头像和「登录」同时出现），这里补回来 */
.nav-login[hidden], .jp-btn[hidden], .nav-share[hidden], .more-link[hidden],
.doc-download[hidden], .jp-feature-go[hidden], .widget-list a[hidden] { display: none !important; }

@media (max-width: 640px) {
  /* 顶部导航：三行压成两行，且不再吸顶（吸顶时一直挡住约四分之一屏幕）
     第一行：logo 图标 + 右侧按钮；第二行：首页 / 文章 / 视频 / 关于 */
  .navbar { position: static; }
  .navbar-inner { gap: 6px 8px; padding: 8px 12px 6px; }
  .logo-icon { width: 36px; height: 36px; font-size: 21px; }
  .logo-text { display: none; }
  .nav-right { margin-left: auto; gap: 6px; }
  .nav-right .jp-btn, .nav-right .nav-share, .lang-btn, .nav-login {
    min-height: 36px; padding: 6px 10px; font-size: 13px;
  }
  .user-avatar-btn { width: 36px; height: 36px; }
  .nav-links { order: 3; width: 100%; justify-content: space-between; gap: 4px; margin: 0; }
  .nav-links a { flex: 1 1 0; min-height: 40px; padding: 6px 4px; font-size: 15px; }

  /* 首页区块标题：右侧的按钮、搜索框换到标题下一行，不再挤住标题 */
  .section-head { flex-wrap: wrap; row-gap: 10px; }
  .timetable-section .section-title { width: 100%; }
  .timetable-section .section-head .btn { flex: 1 1 0; min-height: 40px; }
  .section-head .search-form { order: 3; display: flex; width: 100%; }
  .section-head .search-form input { flex: 1; width: auto; min-height: 40px; font-size: 15px; }
  .section-head .search-form button { min-height: 40px; padding: 0 16px; font-size: 14px; }
  /* 侧栏里的「最新文章」和正文重复，手机上不再显示 */
  .sidebar .widget-latest { display: none; }

  /* 文章列表：封面缩小，标签/日期/作者不再被挤成一字一行 */
  .article-row { gap: 12px; padding: 12px; }
  .row-cover { width: 96px; align-self: flex-start; }
  .card-meta { flex-wrap: wrap; gap: 4px 10px; }
  .card-meta > * { white-space: nowrap; }

  /* 学习中心：外层页面和卡片的内边距不再层层叠加，三项任务并排显示 */
  .study-center-page { padding: 4px 0 40px; }
  .study-today-card, .study-panel { padding: 18px 14px; border-radius: 16px; }
  .study-task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .study-task { padding: 12px 10px; border-radius: 12px; }

  /* 投稿编辑器工具栏：6 行压成 1 行横向滑动，正文输入框回到第一屏 */
  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-toolbar > * { flex: 0 0 auto; }
  /* 附件按钮旁的提示文字换到下一行，不再被挤成一字一行 */
  .share-file-row > .share-file-hint { flex: 1 1 100%; }
}

/* ==========================================================
   输入框修补：文字输入框不再叠加全局的 3px 对焦外框（之前会和边框、外圈阴影叠成两三层）；
   没有单独写对焦样式的输入框，统一用边框变色 + 一圈淡色阴影
   ========================================================== */
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]),textarea,select):focus{outline:none}
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]),textarea,select):focus-visible{border-color:var(--accent)}
/* 组合搜索框里的输入框：外框由容器负责，自己不要边框和阴影 */
.jp-global-search input,.ai-composer textarea,.wsearch input{border:0!important;box-shadow:none!important;outline:none!important;background:transparent}
/* AI 聊天输入框：单行时和发送按钮垂直居中，文字从顶部开始 */
.ai-composer{align-items:center}
.ai-composer textarea{display:block;min-height:24px;padding:8px 0;line-height:1.6}
.ai-composer button{align-self:end;min-height:40px}
/* 新建词单：输入框只保留一圈对焦阴影 */
.ai-vocab-toolbar input:focus{outline:none}
/* 搜索框里的放大镜和清空按钮只是小图标，不吃「搜索」按钮的 108px 最小宽度 */
.jp-global-search button.jp-global-search-icon,.jp-global-search button.jp-search-clear{min-width:44px!important;width:44px;margin:0 0 0 8px!important;padding:0!important}
.jp-global-search button.jp-search-clear{margin:0 8px 0 0!important}
