:root {
  --ink: #1a2a24;
  --ink-soft: #46534b;
  --muted: #7d8378;
  --faint: #a8a99f;
  --paper: #fbf8f1;
  --paper-deep: #f2ecdf;
  --paper-tint: #f7f1e5;
  --line: #e2d9c7;
  --line-strong: #cfc2a9;
  --forest: #12332b;
  --forest-deep: #0a241e;
  --forest-soft: #dfe9e3;
  --amber: #d98a3a;
  --amber-deep: #b96a1d;
  --amber-soft: rgba(var(--amber-rgb), 0.14);
  --white: #fffefb;
  --ui: "Aptos", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Songti SC", "SimSun", "Times New Roman", serif;
  --mono: "Cambria", "Times New Roman", "Songti SC", serif;
  --shadow-sm: 0 1px 2px rgba(26, 42, 36, 0.05);
  --shadow-md: 0 12px 34px rgba(26, 42, 36, 0.08);
  --shadow-lg: 0 26px 70px rgba(18, 51, 43, 0.16);
  --dock-w: min(360px, 94vw);
  --dock-zoom: 1;
  --on-accent: #0a241e;
  --accent-hover: #e39748;
  --on-accent-rgb: 10, 36, 30;
  --countdown-ink: var(--side-ink);
  --countdown-ink-rgb: var(--side-ink-rgb);
  --hover-tint: #fffaf0;
  --topbar-bg: rgba(251, 248, 241, 0.88);
  --surface-translucent: rgba(255, 255, 255, 0.55);
  --side-bg: #12332b;
  --side-ink: #e8eee8;
  --side-glow: rgba(var(--amber-rgb), 0.16);
  --side-line: rgba(0, 0, 0, 0.18);
  --side-soft: rgba(var(--side-ink-rgb), 0.48);
  --side-soft-2: rgba(var(--side-ink-rgb), 0.8);
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-fill: rgba(255, 255, 255, 0.09);
  --side-ink-rgb: 232, 238, 232;
  --amber-rgb: 217, 138, 58;
}

/* ---------------- 主题：极简 ---------------- */

[data-theme="minimal"] {
  --ink: #17181a;
  --ink-soft: #45474b;
  --muted: #787b80;
  --faint: #a3a6ab;
  --paper: #ffffff;
  --paper-deep: #f3f4f5;
  --paper-tint: #f7f8f9;
  --line: #e6e7e9;
  --line-strong: #d2d4d8;
  --forest: #17181a;
  --forest-deep: #000000;
  --forest-soft: #eceef0;
  --amber: #17181a;
  --amber-deep: #000000;
  --amber-soft: rgba(23, 24, 26, 0.06);
  --white: #ffffff;
  --hover-tint: #f5f6f7;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --surface-translucent: rgba(255, 255, 255, 0.72);
  --side-bg: #ffffff;
  --side-ink: #1b1c1e;
  --side-glow: rgba(0, 0, 0, 0.02);
  --side-line: #e6e7e9;
  --side-soft: rgba(27, 28, 30, 0.42);
  --side-soft-2: rgba(27, 28, 30, 0.72);
  --side-hover: rgba(0, 0, 0, 0.04);
  --side-fill: rgba(0, 0, 0, 0.05);
  --side-ink-rgb: 27, 28, 30;
  --amber-rgb: 23, 24, 26;
  --on-accent: #ffffff;
  --accent-hover: #2c2e32;
  --on-accent-rgb: 255, 255, 255;
  --countdown-ink: #f6f7f8;
  --countdown-ink-rgb: 246, 247, 248;
}

[data-theme="minimal"] body {
  background-color: #ffffff;
  background-image: none;
}

[data-theme="minimal"] .sidebar::after {
  display: none;
}

/* ---------------- 主题：冷色 ---------------- */

[data-theme="cool"] {
  --ink: #16232c;
  --ink-soft: #43606f;
  --muted: #72889a;
  --faint: #9cabb8;
  --paper: #f6fafc;
  --paper-deep: #e6eef4;
  --paper-tint: #edf4f9;
  --line: #d3e1ea;
  --line-strong: #b6cddb;
  --forest: #123c50;
  --forest-deep: #0a2b3c;
  --forest-soft: #dbeaf2;
  --amber: #2f8fb0;
  --amber-deep: #1f6d88;
  --amber-soft: rgba(47, 143, 176, 0.13);
  --white: #fbfdfe;
  --hover-tint: #eaf4f9;
  --topbar-bg: rgba(246, 250, 252, 0.9);
  --surface-translucent: rgba(255, 255, 255, 0.6);
  --side-bg: #123c50;
  --side-ink: #e4eff5;
  --side-glow: rgba(47, 143, 176, 0.26);
  --side-line: rgba(0, 0, 0, 0.2);
  --side-soft: rgba(228, 239, 245, 0.48);
  --side-soft-2: rgba(228, 239, 245, 0.82);
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-fill: rgba(255, 255, 255, 0.1);
  --side-ink-rgb: 228, 239, 245;
  --amber-rgb: 47, 143, 176;
  --on-accent: #06222e;
  --accent-hover: #3ba1c2;
  --on-accent-rgb: 6, 34, 46;
}

[data-theme="cool"] body {
  background-color: #e9f1f6;
  background-image:
    radial-gradient(circle at 14% -8%, rgba(47, 143, 176, 0.12), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(18, 60, 80, 0.08), transparent 32%),
    linear-gradient(rgba(182, 205, 219, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 205, 219, 0.16) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

/* ---------------- 主题：深色 ---------------- */

[data-theme="dark"] {
  --ink: #e7ecea;
  --ink-soft: #b3c0bb;
  --muted: #8b9995;
  --faint: #6d7a76;
  --paper: #161c1a;
  --paper-deep: #111715;
  --paper-tint: #1c2321;
  --line: #2a3330;
  --line-strong: #3a4643;
  --forest: #7fc0a6;
  --forest-deep: #a4d8c2;
  --forest-soft: #22302c;
  --amber: #e0a05c;
  --amber-deep: #f0bb84;
  --amber-soft: rgba(224, 160, 92, 0.16);
  --white: #1a2120;
  --hover-tint: #232c2a;
  --topbar-bg: rgba(22, 28, 26, 0.9);
  --surface-translucent: rgba(255, 255, 255, 0.04);
  --side-bg: #0d1211;
  --side-ink: #dfe6e3;
  --side-glow: rgba(224, 160, 92, 0.1);
  --side-line: rgba(255, 255, 255, 0.06);
  --side-soft: rgba(223, 230, 227, 0.44);
  --side-soft-2: rgba(223, 230, 227, 0.8);
  --side-hover: rgba(255, 255, 255, 0.05);
  --side-fill: rgba(255, 255, 255, 0.07);
  --side-ink-rgb: 223, 230, 227;
  --amber-rgb: 224, 160, 92;
  --on-accent: #201305;
  --accent-hover: #f0bb84;
  --on-accent-rgb: 32, 19, 5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
  background-color: #0f1413;
  background-image:
    radial-gradient(circle at 14% -8%, rgba(224, 160, 92, 0.07), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(127, 192, 166, 0.06), transparent 32%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

[data-theme="dark"] .sidebar::after {
  opacity: 0.3;
}

[data-theme="dark"] .page-sheet,
[data-theme="dark"] .docx-view,
[data-theme="dark"] .word-panel,
[data-theme="dark"] .mini-menu {
  border-color: var(--line);
}

[data-theme="dark"] .page-sheet img,
[data-theme="dark"] .thumb-item img {
  filter: brightness(0.88) contrast(1.04);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------------- 主题切换控件 ---------------- */

.theme-switcher-side {
  margin-top: 16px;
}

.theme-switcher-label {
  display: block;
  margin-bottom: 7px;
  color: var(--side-soft);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.theme-options button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid var(--side-fill);
  border-radius: 7px;
  background: transparent;
  color: var(--side-soft-2);
  font-size: 10.5px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.theme-options button:hover {
  background: var(--side-hover);
  color: var(--side-ink);
}

.theme-options button.active {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--side-ink);
  font-weight: 600;
}

.swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.sw-minimal {
  background: #ffffff;
}

.sw-warm {
  background: linear-gradient(135deg, #f7f1e5 50%, #d98a3a 50%);
}

.sw-cool {
  background: linear-gradient(135deg, #eaf4f9 50%, #2f8fb0 50%);
}

.sw-dark {
  background: linear-gradient(135deg, #1a2120 50%, #e0a05c 50%);
}

/* ---------------- 应用导航 ---------------- */

.app-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 14px;
  padding: 4px 0 0;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--side-soft-2);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.app-nav-item:hover {
  background: var(--side-hover);
}

.app-nav-item.active {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.app-nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  background: var(--side-fill);
  color: var(--side-soft-2);
  font-size: 13px;
}

.app-nav-item.active .app-nav-icon {
  background: var(--amber);
  color: var(--on-accent);
}

.app-nav-copy {
  min-width: 0;
  flex: 1;
}

.app-nav-copy b {
  display: block;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

.app-nav-copy small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--side-soft);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav-arrow {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  color: var(--side-soft);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.app-nav-item:hover .app-nav-arrow,
.app-nav-item.active .app-nav-arrow {
  opacity: 1;
}

[data-theme="minimal"] .app-nav-item.active .app-nav-icon {
  background: #17181a;
  color: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: #f4efe4;
  background-image:
    radial-gradient(circle at 14% -8%, rgba(var(--amber-rgb), 0.1), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(18, 51, 43, 0.08), transparent 32%),
    linear-gradient(rgba(207, 194, 169, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 194, 169, 0.12) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

::selection {
  background: rgba(var(--amber-rgb), 0.28);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(18, 51, 43, 0.2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 272px;
  width: 272px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: var(--side-ink);
  background:
    radial-gradient(circle at 20% 0%, var(--side-glow), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.04), transparent 30%),
    var(--side-bg);
  border-right: 1px solid var(--side-line);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.7px, transparent 0.7px);
  background-size: 6px 6px;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 0 6px 16px;
  cursor: pointer;
  border-radius: 10px;
}

.sidebar-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -4px;
  padding: 0 4px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(var(--side-ink-rgb), 0.16);
  border: 0;
  border-radius: 6px;
}

.brand:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  background: var(--amber);
  color: var(--on-accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -1px;
  box-shadow: 0 5px 18px rgba(var(--amber-rgb), 0.26);
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
  font-size: 15px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-dot {
  color: var(--amber);
}

.brand-sub {
  margin-top: 5px;
  color: rgba(var(--side-ink-rgb), 0.58);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.sidebar-upload {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  color: var(--on-accent);
  background: var(--amber);
  border: 1px solid rgba(var(--on-accent-rgb), 0.14);
  border-radius: 12px;
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-upload:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-upload-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: rgba(var(--on-accent-rgb), 0.13);
  font-size: 16px;
}

.sidebar-upload b {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.sidebar-upload small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  opacity: 0.64;
  letter-spacing: 0.06em;
}

.side-section {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  min-height: 90px;
}

.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 10px;
  color: rgba(var(--side-ink-rgb), 0.48);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.side-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(var(--side-ink-rgb), 0.66);
  font-size: 10px;
  letter-spacing: 0;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-empty {
  padding: 14px 8px 18px;
  color: rgba(var(--side-ink-rgb), 0.38);
  font-size: 12.5px;
  line-height: 1.7;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(var(--side-ink-rgb), 0.80);
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.recent-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.07);
}

.recent-item.active {
  background: rgba(var(--amber-rgb), 0.14);
  border-color: rgba(var(--amber-rgb), 0.28);
}

.recent-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  flex: 0 0 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(var(--side-ink-rgb), 0.7);
  font-size: 14px;
}

.recent-item.active .recent-icon {
  color: var(--amber);
}

.recent-copy {
  min-width: 0;
  flex: 1;
}

.recent-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  line-height: 1.35;
}

.recent-meta {
  display: block;
  margin-top: 2px;
  color: rgba(var(--side-ink-rgb), 0.4);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.side-languages {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-top: 14px;
}

.mini-langs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px 0;
}

.mini-langs span {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 4px 0;
  color: rgba(var(--side-ink-rgb), 0.52);
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.mini-langs b {
  width: 22px;
  color: var(--amber);
  font-family: var(--ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.sidebar-foot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 14px 6px 0;
  border-top: 1px solid rgba(var(--side-ink-rgb), 0.1);
  color: rgba(var(--side-ink-rgb), 0.36);
  font-size: 10px;
  line-height: 1.6;
}

.privacy-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: rgba(var(--side-ink-rgb), 0.55);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.privacy-dot span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #84b58e;
  box-shadow: 0 0 0 3px rgba(132, 181, 142, 0.12);
}

.sidebar-foot p {
  margin: 0;
}

/* ---------------- Main column ---------------- */

.main-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mobile-topbar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px clamp(18px, 2.4vw, 32px) 11px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.topbar-row-sub {
  align-items: center;
  padding-top: 1px;
}

.doc-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.doc-title-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.doc-title-line h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kind-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.doc-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.doc-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.doc-meta-line span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.doc-meta-line svg {
  width: 12px;
  height: 12px;
  color: var(--amber-deep);
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.view-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-deep);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.view-btn svg {
  width: 14px;
  height: 14px;
}

.view-btn:hover {
  color: var(--ink);
}

.view-btn.active {
  background: var(--white);
  color: var(--forest);
  box-shadow: 0 1px 4px rgba(26, 42, 36, 0.1);
}

.lang-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-soft);
}

.lang-select-wrap svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--amber-deep);
}

.lang-select-wrap select {
  max-width: 112px;
  padding: 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.icon-button.ai-button {
  display: inline-flex;
  width: auto;
  gap: 5px;
  padding: 0 11px 0 9px;
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper);
}

.icon-button-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--paper-tint);
  color: var(--forest);
}

.icon-button.ai-button:hover {
  border-color: var(--forest-deep);
  background: var(--forest-deep);
  color: var(--paper);
}

.main-content {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* ---------------- Empty state ---------------- */

.empty-state {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 58px 48px 44px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--amber-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow.small {
  font-size: 9.5px;
  letter-spacing: 0.18em;
}

.eyebrow-line {
  width: 26px;
  height: 1px;
  background: var(--amber);
}

.hero-title {
  max-width: 860px;
  margin: 20px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 66px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero-title em {
  position: relative;
  color: var(--amber-deep);
  font-style: italic;
  white-space: nowrap;
}

.hero-title em::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 2px;
  bottom: 5px;
  height: 7px;
  border-radius: 50%;
  background: rgba(var(--amber-rgb), 0.18);
  z-index: -1;
}

.hero-copy {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
  padding: 28px 32px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.72);
  box-shadow: var(--shadow-sm);
  outline: none;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  transform: translateY(-2px);
  border-color: var(--amber);
  background: rgba(255, 254, 251, 0.92);
  box-shadow: var(--shadow-md);
}

.dropzone.is-dragging {
  transform: scale(1.005);
  border-color: var(--amber);
  border-style: solid;
  background: var(--hover-tint);
  box-shadow: 0 0 0 5px rgba(var(--amber-rgb), 0.11), var(--shadow-md);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 14px;
  background: var(--forest);
  color: var(--amber);
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(18, 51, 43, 0.18);
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dropzone-copy strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.dropzone-copy span {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.dropzone-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--amber);
  color: var(--amber-deep);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.dropzone-action svg {
  width: 13px;
  height: 13px;
  transition: transform 0.18s ease;
}

.dropzone:hover .dropzone-action svg {
  transform: translateX(3px);
}

.dropzone-corner {
  position: absolute;
  top: -9px;
  right: 22px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--amber);
  color: var(--on-accent);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.language-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.ribbon-label {
  margin-right: 4px;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 11.5px;
  font-style: italic;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 254, 251, 0.55);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11.5px;
}

.lang-pill b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 17px;
  padding: 0 4px;
  border-radius: 20px;
  background: var(--forest-soft);
  color: var(--forest);
  font-family: var(--ui);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.samples-block {
  margin-top: 52px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-note {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sample-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 20px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: left;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.sample-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--amber));
}

.sample-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--amber-rgb), 0.38);
  box-shadow: var(--shadow-md);
}

.sample-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sample-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent, var(--amber)) 14%, white);
  color: var(--accent, var(--amber-deep));
  font-size: 17px;
}

.sample-tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sample-card h3 {
  margin: 16px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.3;
}

.sample-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.sample-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 13px;
  color: var(--amber-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sample-open svg {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.sample-card:hover .sample-open svg {
  transform: translateX(3px);
}

.sample-skeleton {
  min-height: 190px;
  border: 1px solid rgba(226, 217, 199, 0.7);
  border-radius: 15px;
  background: linear-gradient(100deg, #f7f2e8 30%, #fdfaf4 48%, #f7f2e8 66%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.how-item {
  position: relative;
}

.how-number {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.08em;
}

.how-item b {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
}

.how-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.empty-foot {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid rgba(226, 217, 199, 0.6);
  color: var(--faint);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---------------- Workspace ---------------- */

.workspace {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 34px 40px;
}

.workspace-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 254, 251, 0.68);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.hint-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(var(--amber-rgb), 0.45);
  animation: hintPulse 2.2s infinite;
}

@keyframes hintPulse {
  70% {
    box-shadow: 0 0 0 6px rgba(var(--amber-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--amber-rgb), 0);
  }
}

.doc-viewport {
  min-height: 55vh;
}

.pages-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
}

.page-block {
  width: min(940px, 100%);
}

.page-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 7px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-label b {
  color: var(--ink-soft);
  font-weight: 700;
}

.page-label .ocr-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber-deep);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.page-label .ocr-mark i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.page-paper {
  position: relative;
  overflow: hidden;
  border: 1px solid #e6dece;
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(26, 42, 36, 0.04), 0 18px 44px rgba(26, 42, 36, 0.1);
}

.page-canvas {
  position: relative;
  line-height: 0;
}

.page-canvas img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspot {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  outline: none;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.hotspot:hover {
  background: rgba(var(--amber-rgb), 0.20);
  box-shadow: inset 0 -1px 0 rgba(185, 106, 29, 0.6);
}

.hotspot:active,
.hotspot.is-active {
  background: rgba(var(--amber-rgb), 0.32);
  box-shadow: 0 0 0 1px rgba(185, 106, 29, 0.45);
}

.hotspot:focus-visible {
  background: rgba(var(--amber-rgb), 0.24);
  box-shadow: 0 0 0 2px var(--amber);
}

.workspace-end {
  margin-top: 34px;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 10.5px;
  font-style: italic;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ---------------- Reading view ---------------- */

.reading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.reading-page-block {
  width: min(830px, 100%);
}

.reading-page {
  width: 100%;
  padding: clamp(30px, 5vw, 62px) clamp(26px, 5.5vw, 66px);
  border: 1px solid #e6dece;
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(26, 42, 36, 0.04), 0 18px 44px rgba(26, 42, 36, 0.09);
}

.reading-page-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.reading-sheet {
  color: #26312b;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.95;
}

.reading-sheet h1,
.reading-sheet h2,
.reading-sheet h3,
.reading-sheet h4 {
  margin: 1.35em 0 0.55em;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.reading-sheet h1 {
  margin-top: 0;
  font-size: clamp(26px, 3.4vw, 38px);
}

.reading-sheet h2 {
  font-size: 26px;
}

.reading-sheet h3 {
  font-size: 21px;
}

.reading-sheet h4 {
  font-size: 18px;
}

.reading-sheet p {
  margin: 0 0 1.1em;
}

.reading-sheet .doc-subtitle {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.reading-sheet .doc-list-item {
  padding-left: 1.2em;
  text-indent: -1.2em;
}

.reading-sheet .doc-bullet {
  margin-right: 0.55em;
  color: var(--amber);
  font-family: var(--ui);
  font-size: 0.75em;
}

.reading-sheet strong {
  color: var(--forest);
  font-weight: 700;
}

.reading-sheet em {
  color: var(--ink-soft);
}

.reading-sheet .doc-table-wrap {
  margin: 1.4em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.reading-sheet .doc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.6;
}

.reading-sheet .doc-table td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
}

.reading-sheet .doc-table tr:last-child td {
  border-bottom: 0;
}

.reading-sheet .doc-table td:last-child {
  border-right: 0;
}

.reading-empty {
  padding: 56px 20px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 13px;
  text-align: center;
}

.word {
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.word:hover {
  color: var(--amber-deep);
  background: var(--amber-soft);
  box-shadow: inset 0 -1px 0 rgba(185, 106, 29, 0.55);
}

.word.is-active {
  color: var(--amber-deep);
  background: rgba(var(--amber-rgb), 0.22);
  box-shadow: 0 0 0 2px rgba(var(--amber-rgb), 0.18);
}

.word:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------------- DOCX ---------------- */

.docx-view {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 12px;
}

.docx-view .docx-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 100%;
  padding: 0 !important;
  background: transparent !important;
}

.docx-view .docx-wrapper > section.docx {
  max-width: 100%;
  margin: 0 auto !important;
  border: 1px solid #e6dece;
  border-radius: 5px;
  background: var(--white) !important;
  box-shadow: 0 2px 4px rgba(26, 42, 36, 0.04), 0 18px 44px rgba(26, 42, 36, 0.09) !important;
  overflow: hidden;
}

.docx-view .docx-wrapper > section.docx > * {
  font-family: var(--serif);
}

.docx-empty {
  padding: 56px 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------------- Word panel ---------------- */

.panel-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(10, 36, 30, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.panel-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.word-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: var(--dock-w);
  border-left: 1px solid var(--line);
  background: var(--white);
  box-shadow: -30px 0 80px rgba(18, 51, 43, 0.16);
  transform: translateX(104%);
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.word-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 94px;
  background: var(--amber);
}

.word-panel.open {
  transform: translateX(0);
}

/* 桌面端：面板停靠在右侧，正文区同步收缩，原文不被遮挡 */
.main-column {
  transition: margin-right 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 761px) {
  body.panel-open .main-column {
    margin-right: var(--dock-w);
  }

  .word-panel.open {
    box-shadow: -16px 0 48px rgba(18, 51, 43, 0.1);
  }

  .panel-scrim {
    display: none !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  :root {
    --dock-w: 324px;
  }
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 6px 26px;
}

.panel-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--amber-deep);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.panel-eyebrow span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.panel-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.panel-close:hover {
  border-color: var(--line-strong);
  background: var(--paper-tint);
  color: var(--ink);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 2px 26px 30px;
}

.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 54vh;
  color: var(--muted);
  text-align: center;
}

.placeholder-glyph {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--line-strong);
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
}

.panel-placeholder p {
  max-width: 240px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.word-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.word-heading {
  min-width: 0;
}

.word-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.word-phonetic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.01em;
}

.word-phonetic .phonetic-divider {
  width: 10px;
  height: 1px;
  background: var(--line-strong);
}

.speak-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  margin-top: 6px;
  border: 1px solid rgba(var(--amber-rgb), 0.45);
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber-deep);
  font-size: 17px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.speak-btn:hover {
  transform: scale(1.05);
  background: var(--amber);
  color: var(--on-accent);
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tag.lang-tag {
  border-color: transparent;
  background: var(--forest);
  color: #f1f5f1;
}

.tag.pos-tag {
  border-color: rgba(var(--amber-rgb), 0.28);
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.tag.form-tag {
  background: var(--paper-tint);
  color: #4e6658;
}

.lemma-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}

.lemma-note b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.lemma-note span {
  font-family: var(--mono);
  font-size: 12px;
}

.panel-section {
  margin-top: 24px;
}

.panel-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.panel-section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.zh-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.zh-item {
  padding: 11px 13px 11px 16px;
  border-left: 3px solid var(--amber);
  border-radius: 0 7px 7px 0;
  background: var(--paper-tint);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.55;
}

.definition-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.definition-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.65;
}

.definition-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--amber);
}

.forms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.form-chip b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
}

.form-chip span {
  color: var(--muted);
  font-size: 9px;
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-item {
  margin: 0;
  padding: 9px 12px;
  border-left: 2px solid var(--forest);
  background: var(--paper-tint);
  color: #405148;
  font-family: var(--serif);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.65;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9.5px;
}

.sources a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
}

.sources a:hover {
  color: var(--amber-deep);
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 24px 13px;
  border-top: 1px solid var(--line);
  background: var(--paper-tint);
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.panel-foot-mark {
  color: var(--line-strong);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.panel-notice {
  padding: 8px 11px;
  border: 1px solid rgba(var(--amber-rgb), 0.25);
  border-radius: 5px;
  background: rgba(var(--amber-rgb), 0.07);
  color: var(--amber-deep);
  font-size: 10.5px;
  line-height: 1.55;
}

.panel-error {
  padding: 40px 6px;
  text-align: center;
}

.panel-error b {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

.panel-error p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.skeleton-block {
  height: 18px;
  margin-top: 11px;
  border-radius: 4px;
  background: linear-gradient(100deg, #f3ecdf 30%, #faf6ed 48%, #f3ecdf 66%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-block.wide {
  height: 46px;
  margin-top: 18px;
}

.skeleton-block.short {
  width: 62%;
}

.panel-loading-label {
  margin-top: 18px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------------- 资料库（收藏夹与文件夹） ---------------- */

.library-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin: 0 2px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
}

.library-tab {
  flex: 1;
  padding: 6px 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(var(--side-ink-rgb), 0.56);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: background 0.16s ease, color 0.16s ease;
}

.library-tab:hover {
  color: rgba(var(--side-ink-rgb), 0.86);
}

.library-tab.active {
  background: rgba(var(--amber-rgb), 0.2);
  color: #f6e9d6;
  font-weight: 600;
}

.library-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 2px;
}

.library-add {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 9px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(var(--side-ink-rgb), 0.62);
  font-size: 11px;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.library-add:hover {
  border-color: rgba(var(--amber-rgb), 0.6);
  background: rgba(var(--amber-rgb), 0.1);
  color: #f6e9d6;
}

.library-add svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--amber);
}

.folder-list,
.fav-words,
.fav-docs {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.folder-item {
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.folder-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: rgba(var(--side-ink-rgb), 0.9);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-name svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--amber);
}

.folder-name small {
  flex: 0 0 auto;
  padding: 0 5px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(var(--side-ink-rgb), 0.55);
  font-size: 9px;
  line-height: 15px;
}

.folder-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.folder-item:hover .folder-actions {
  opacity: 1;
}

.folder-actions button,
.folder-doc-act {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(var(--side-ink-rgb), 0.5);
  font-size: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.folder-actions button:hover,
.folder-doc-act:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.folder-actions svg,
.folder-doc-act svg {
  width: 11px;
  height: 11px;
}

.folder-empty {
  padding: 5px 2px 3px;
  color: rgba(var(--side-ink-rgb), 0.32);
  font-size: 10px;
  line-height: 1.55;
}

.folder-doc {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-top: 2px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.folder-doc:hover {
  background: rgba(255, 255, 255, 0.06);
}

.folder-doc-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 3px;
  border: 0;
  background: transparent;
  color: rgba(var(--side-ink-rgb), 0.7);
  font-size: 10.5px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-doc-open:hover {
  color: #fff;
}

.folder-doc-open svg {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  opacity: 0.55;
}

.fav-word,
.fav-doc {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(var(--side-ink-rgb), 0.78);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.fav-word:hover,
.fav-doc:hover {
  border-color: rgba(var(--amber-rgb), 0.34);
  background: rgba(var(--amber-rgb), 0.1);
}

.fav-word b {
  flex: 0 0 auto;
  color: #fbf6ec;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-word > span {
  flex: 0 0 auto;
  color: rgba(var(--side-ink-rgb), 0.4);
  font-size: 8.5px;
}

.fav-word em {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: rgba(var(--side-ink-rgb), 0.62);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-doc svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--amber);
}

.fav-doc span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-remove {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 4px;
  color: rgba(var(--side-ink-rgb), 0.45);
  font-style: normal;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.fav-word:hover .fav-remove,
.fav-doc:hover .fav-remove {
  opacity: 1;
}

.fav-remove:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.fav-remove svg {
  width: 10px;
  height: 10px;
}

/* ---------------- 浮层菜单 ---------------- */

.mini-menu {
  position: fixed;
  z-index: 95;
  width: 244px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.mini-menu-title {
  overflow: hidden;
  margin-bottom: 5px;
  padding: 7px 9px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mini-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: hidden;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-menu-item svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--amber-deep);
}

.mini-menu-item:hover {
  background: var(--paper-tint);
  color: var(--ink);
}

.mini-menu-item.active {
  color: var(--forest);
  font-weight: 600;
}

.mini-menu-item.danger {
  color: #96382a;
}

.mini-menu-item.danger svg {
  color: currentColor;
}

.mini-menu-empty {
  padding: 7px 9px 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.mini-check {
  display: grid;
  place-items: center;
  margin-left: auto;
  color: var(--forest);
}

.mini-check svg {
  color: var(--forest);
}

/* ---------------- 缩略图栏 ---------------- */

.doc-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.thumb-rail {
  position: sticky;
  top: 104px;
  display: flex;
  flex: 0 0 116px;
  flex-direction: column;
  width: 116px;
  max-height: calc(100vh - 136px);
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 251, 0.78);
  box-shadow: var(--shadow-sm);
}

.thumb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px 7px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.thumb-collapse {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.thumb-collapse:hover {
  border-color: var(--amber);
  color: var(--amber-deep);
}

.thumb-collapse svg {
  width: 11px;
  height: 11px;
}

.thumb-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 1px;
}

.thumb-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.thumb-item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
}

.thumb-item span {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-align: center;
}

.thumb-item:hover {
  border-color: var(--line-strong);
  background: var(--paper-tint);
}

.thumb-item.active {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.thumb-item.active span {
  color: var(--amber-deep);
  font-weight: 700;
}

.doc-viewport {
  flex: 1;
  min-width: 0;
}

.thumb-restore {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--muted);
  font-size: 10.5px;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.thumb-restore:hover {
  border-color: var(--amber);
  color: var(--amber-deep);
}

.thumb-restore svg {
  width: 12px;
  height: 12px;
}

body.thumbs-collapsed .workspace-hint {
  margin-bottom: 10px;
}

/* ---------------- 段落工具 / 行内操作 ---------------- */

.para-row {
  position: relative;
}

.para-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  margin: -3px 0 11px;
  opacity: 0.72;
  transition: opacity 0.16s ease;
}

.para-row:hover .para-tools,
.para-row:focus-within .para-tools {
  opacity: 1;
}

.para-tools .mini-action span {
  display: none;
}

.para-tools .mini-action {
  padding: 1px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--faint);
}

.para-tools .mini-action:hover {
  border-color: var(--amber);
  background: var(--hover-tint);
  color: var(--amber-deep);
}

.para-tools .mini-action.is-speaking {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.mini-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--muted);
  font-family: var(--ui);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.mini-action svg {
  width: 10px;
  height: 10px;
}

.mini-action:hover {
  border-color: var(--amber);
  background: var(--hover-tint);
  color: var(--amber-deep);
}

.mini-action.is-speaking {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.page-label-tools,
.reading-label-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.page-label-tools .mini-action,
.reading-label-tools .mini-action {
  padding: 2px 7px;
}

/* ---------------- 解析进度 ---------------- */

.processing-progress {
  margin-top: 20px;
}

.processing-track {
  height: 6px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--paper-deep);
}

.processing-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--amber), #ecb169);
  transition: width 0.34s cubic-bezier(0.25, 0.6, 0.3, 1);
}

.processing-meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
}

.processing-meter b {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.processing-meter span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-steps {
  margin-top: 20px;
}

/* ---------------- 停靠面板：单词 / AI ---------------- */

.dock-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-deep);
}

.dock-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dock-tab:hover {
  color: var(--ink);
}

.dock-tab.active {
  background: var(--white);
  color: var(--forest);
  box-shadow: var(--shadow-sm);
}

.dock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.word-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.word-hero-actions .speak-btn {
  margin-top: 0;
}

.favorite-btn {
  border-color: var(--line);
  background: var(--white);
  color: var(--line-strong);
}

.icon-button.is-active {
  border-color: rgba(var(--amber-rgb), 0.55);
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.icon-button.is-active svg {
  fill: rgba(var(--amber-rgb), 0.3);
}

.favorite-btn:hover {
  border-color: var(--amber);
  background: var(--hover-tint);
  color: var(--amber-deep);
}

.favorite-btn.is-active {
  border-color: rgba(var(--amber-rgb), 0.5);
  background: var(--amber-soft);
  color: var(--amber-deep);
}

.favorite-btn.is-active svg {
  fill: rgba(var(--amber-rgb), 0.34);
}

.ai-pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ai-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 22px 8px 26px;
}

.ai-head {
  margin-top: 8px;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-title svg {
  width: 17px;
  height: 17px;
  color: var(--amber-deep);
}

.ai-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.ai-scope-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 7px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--paper-tint);
}

.ai-scope-label {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ai-scope {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-scope.is-paragraph {
  color: var(--amber-deep);
  font-weight: 600;
}

.ai-scope-reset {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--muted);
  font-size: 9px;
}

.ai-scope-reset:hover {
  border-color: var(--amber);
  color: var(--amber-deep);
}

.ai-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.ai-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--forest);
  font-size: 11px;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ai-action:hover:not(:disabled) {
  border-color: var(--amber);
  background: var(--hover-tint);
  color: var(--amber-deep);
}

.ai-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.ai-action svg {
  width: 13px;
  height: 13px;
}

.ai-target {
  max-width: 108px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 10.5px;
}

.ai-result-card {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-tint);
}

.ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-translucent);
}

.ai-result-head > span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-result-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.ai-result-tools button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--muted);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.ai-result-tools button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.ai-result-tools svg {
  width: 11px;
  height: 11px;
}

.ai-result-tools button:last-child svg {
  transition: transform 0.2s ease;
}

.ai-result-card.collapsed .ai-result-tools button:last-child svg {
  transform: rotate(180deg);
}

.ai-result {
  max-height: 46vh;
  overflow-y: auto;
  padding: 12px 13px 14px;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.78;
}

.ai-result-card.collapsed .ai-result {
  display: none;
}

.ai-result-card.collapsed .ai-result-head {
  border-bottom: 0;
}

.ai-result p {
  margin: 0 0 10px;
}

.ai-result p:last-child {
  margin-bottom: 0;
}

.ai-block strong {
  display: block;
  color: var(--forest);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.ai-bullet {
  display: block;
  position: relative;
  margin-top: 3px;
  padding-left: 12px;
}

.ai-bullet::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.ai-line {
  display: block;
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.ai-thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  animation: aiBlink 1.1s infinite ease-in-out;
}

.ai-thinking span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-thinking span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes aiBlink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.ai-placeholder {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.ai-ask {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.ai-ask textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.ai-ask textarea::placeholder {
  color: var(--faint);
}

.ai-ask-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 7px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper-tint);
}

.ai-hint {
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-send {
  flex: 0 0 auto;
  padding: 5px 14px;
  border: 1px solid var(--forest);
  border-radius: 6px;
  background: var(--forest);
  color: #f4f8f4;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.16s ease;
}

.ai-send:hover:not(:disabled) {
  background: var(--forest-deep);
}

.ai-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-bottom: 8px;
}

.ai-presets button {
  padding: 4px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.ai-presets button:hover {
  border-color: var(--amber);
  background: var(--hover-tint);
  color: var(--amber-deep);
}

/* ---------------- Overlay / toast ---------------- */

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 36, 30, 0.52);
  backdrop-filter: blur(7px);
}

.processing-card {
  width: min(420px, 100%);
  padding: 38px 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.processing-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--amber-deep);
  font-size: 27px;
}

.processing-orbit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(var(--amber-rgb), 0.38);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}

.processing-orbit span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  animation: orbit 2.2s linear infinite;
}

.processing-orbit span:nth-child(1) {
  animation-delay: -0.7s;
}

.processing-orbit span:nth-child(2) {
  animation-delay: -1.4s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbit {
  from {
    transform: rotate(0deg) translateY(-46px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateY(-46px) rotate(-360deg);
  }
}

.processing-card .eyebrow {
  justify-content: center;
}

.processing-card h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
}

.processing-card p {
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.processing-steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.processing-steps i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.processing-steps span.active {
  color: var(--amber-deep);
}

.processing-steps span.active i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.16);
}

.processing-steps span.done {
  color: var(--ink-soft);
}

.processing-steps span.done i {
  background: #84b58e;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 130;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: var(--forest);
  color: #f0f5f0;
  box-shadow: 0 16px 40px rgba(10, 36, 30, 0.28);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #7f3524;
}

/* ---------------- 顶部功能区切换 / 拖拽调宽 ---------------- */

.app-pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.dock-resizer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 72;
  display: none;
  width: 10px;
  cursor: col-resize;
  background: transparent;
}

.dock-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background 0.16s ease;
}

body.panel-open .dock-resizer {
  display: block;
}

.dock-resizer:hover::after,
body.dock-resizing .dock-resizer::after {
  background: var(--amber);
}

body.dock-resizing {
  cursor: col-resize;
  user-select: none;
}

body.dock-resizing .main-column,
body.dock-resizing .word-panel {
  transition: none;
}

.dock-grip {
  display: none;
}

@media (min-width: 761px) {
  .dock-grip {
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    left: -1px;
    width: 14px;
    height: 46px;
    margin-top: -23px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: var(--white);
    color: var(--faint);
    cursor: col-resize;
    z-index: 3;
    transition: color 0.16s ease, background 0.16s ease;
  }

  .dock-grip:hover {
    background: var(--amber-soft);
    color: var(--amber-deep);
  }

  .dock-grip svg {
    width: 11px;
    height: 11px;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .sidebar {
    flex-basis: 240px;
    width: 240px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .empty-state {
    padding: 48px 36px 40px;
  }

  .topbar {
    padding: 13px 26px;
  }

  .workspace {
    padding: 20px 26px 36px;
  }
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(226, 217, 199, 0.8);
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 700;
  }

  .mobile-upload {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--amber-deep);
    font-size: 15px;
  }

  .topbar {
    position: static;
    padding: 12px 20px 11px;
    flex-wrap: wrap;
  }

  .topbar-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .doc-heading {
    flex-basis: 100%;
  }

  .topbar-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .topbar-row-sub {
    justify-content: flex-start;
  }

  .lang-select-wrap {
    margin-left: auto;
  }

  .empty-state {
    padding: 40px 24px 70px;
  }
}

@media (max-width: 760px) {
  .hero-title {
    font-size: clamp(36px, 8.4vw, 50px);
  }

  .hero-copy {
    font-size: 14px;
  }

  .dropzone {
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px;
  }

  .dropzone-action {
    margin-left: 0;
  }

  .sample-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .how-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    column-gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(226, 217, 199, 0.65);
  }

  .how-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .how-number {
    grid-row: 1 / span 2;
    margin: 1px 0 0;
  }

  .how-item b,
  .how-item p {
    grid-column: 2;
  }

  .how-item p {
    margin-top: 3px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .section-note {
    padding: 0;
  }

  .workspace {
    padding: 16px 14px 28px;
  }

  .workspace-hint {
    font-size: 9.5px;
    text-align: center;
  }

  .page-block {
    width: 100%;
  }

  .reading-page {
    padding: 26px 22px;
  }

  .reading-sheet {
    font-size: 16px;
    line-height: 1.85;
  }

  .panel-scrim {
    display: block;
  }

  .doc-stage {
    gap: 0;
  }

  .thumb-rail,
  .thumb-restore {
    display: none;
  }

  .thumb-rail[hidden] {
    display: none !important;
  }

  .para-tools {
    opacity: 1;
  }

  .topbar-icon-group {
    gap: 4px;
  }

  .topbar-icon-group .icon-button {
    width: 32px;
    height: 32px;
  }

  body.panel-open {
    overflow: hidden;
  }

  .word-panel {
    top: auto;
    left: 0;
    width: 100%;
    height: 80vh;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 70px rgba(18, 51, 43, 0.2);
    transform: translateY(105%);
  }

  .word-panel::before {
    top: 0;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 0 0 4px 4px;
    transform: translateX(-50%);
  }

  .word-panel.open {
    transform: translateY(0);
  }

  .panel-body {
    padding-left: 22px;
    padding-right: 22px;
  }

  .panel-top {
    padding-top: 18px;
    padding-left: 22px;
  }
}

@media (max-width: 560px) {
  .empty-state {
    padding: 30px 18px 60px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .hero-title {
    margin-top: 14px;
    font-size: 35px;
    line-height: 1.1;
  }

  .hero-copy {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.75;
  }

  .dropzone {
    margin-top: 26px;
    padding: 20px;
    border-radius: 14px;
  }

  .dropzone-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 20px;
  }

  .dropzone-copy strong {
    font-size: 16px;
  }

  .dropzone-copy span {
    font-size: 10.5px;
    line-height: 1.5;
  }

  .language-ribbon {
    gap: 6px;
  }

  .ribbon-label {
    flex-basis: 100%;
  }

  .samples-block {
    margin-top: 38px;
  }

  .sample-grid {
    grid-template-columns: 1fr;
  }

  .sample-card {
    min-height: 156px;
  }

  .section-head h2 {
    font-size: 23px;
  }

  .topbar {
    padding: 12px 14px 11px;
  }

  .doc-title-line h1 {
    font-size: 19px;
  }

  .doc-meta-line {
    gap: 5px 9px;
    font-size: 10px;
  }

  .view-btn {
    padding: 7px 8px;
    font-size: 11px;
  }

  .lang-select-wrap {
    padding-left: 8px;
  }

  .lang-select-wrap select {
    max-width: 90px;
    font-size: 11px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .page-label,
  .reading-page-label {
    font-size: 8.5px;
  }

  .word-title {
    font-size: 33px;
  }

  .processing-card {
    padding: 30px 22px 24px;
  }

  .processing-steps {
    gap: 8px;
  }
}

/* ---------------- 侧栏字号缩放 ---------------- */

.dock-type {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-tint);
}

.dock-type-btn {
  min-width: 24px;
  height: 22px;
  padding: 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: background 0.16s ease, color 0.16s ease;
}

.dock-type-btn:hover:not(:disabled) {
  background: var(--white);
  color: var(--amber-deep);
}

.dock-type-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.dock-type-value {
  min-width: 30px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.panel-body,
.ai-pane {
  zoom: var(--dock-zoom);
}

/* ---------------- 查词聚焦：只缩放版式，不打断阅读 ---------------- */

.pages-view.is-zoomed {
  position: relative;
  z-index: 4;
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

body.word-focus .page-sheet {
  box-shadow: 0 30px 90px rgba(18, 51, 43, 0.22);
}

body.word-focus .word.is-active,
body.word-focus .hotspot.is-active {
  box-shadow: 0 0 0 3px var(--amber-soft), 0 0 0 1px var(--amber);
}

.zoom-exit {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--topbar-bg);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.zoom-exit span {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.zoom-exit:hover {
  border-color: var(--amber);
  color: var(--amber-deep);
}

@media (max-width: 760px) {
  .zoom-exit {
    bottom: 18px;
  }

  .dock-type {
    padding: 1px 3px;
  }
}

/* ---------------- 阅读学习 · 资料 ---------------- */

.reading-library-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 18px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--ui);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.reading-library-entry:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.reading-library-entry > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.reading-library-entry > span {
  font-size: 14px;
  font-weight: 600;
}

.reading-library-entry > small {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.reading-library-entry .entry-arrow {
  transform: rotate(180deg);
}

.reading-library {
  flex: 1;
  min-height: 60vh;
  overflow-y: auto;
  padding: 28px clamp(16px, 4vw, 48px) 64px;
  background: var(--paper);
}

.rl-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 880px;
  margin: 0 auto 14px;
}

.rl-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rl-back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.rl-back svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}

.rl-title b {
  display: block;
  font-size: 20px;
  letter-spacing: 0.4px;
}

.rl-title span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.rl-filters {
  display: flex;
  gap: 8px;
}

.rl-search,
.rl-range {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
}

.rl-search {
  width: 180px;
}

.rl-tabs {
  display: flex;
  gap: 6px;
  max-width: 880px;
  margin: 0 auto 10px;
}

.rl-tab {
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 13px;
  cursor: pointer;
}

.rl-tab.active {
  background: var(--paper-tint);
  color: var(--ink);
  font-weight: 600;
}

.rl-tab i {
  margin-left: 4px;
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
}

.rl-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 880px;
  margin: 0 auto;
}

.rl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.rl-item:hover {
  border-color: var(--line-strong);
}

.rl-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui);
  text-align: left;
  cursor: pointer;
}

.rl-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--paper-tint);
  color: var(--ink-soft);
}

.rl-icon svg {
  width: 16px;
  height: 16px;
}

.rl-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rl-name {
  overflow: hidden;
  font-size: 14px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rl-meta {
  font-size: 12px;
  color: var(--muted);
}

.rl-star {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.rl-star svg {
  width: 16px;
  height: 16px;
}

.rl-star.is-active {
  color: var(--amber);
}

.rl-empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
