/* ========== 基础重置与变量（浅色苹果风） ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-page: #f5f5f7;
  --bg-sidebar: #ececf1;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-glass: rgba(255, 255, 255, 0.9);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-glow: rgba(0, 113, 227, 0.25);
  --danger: #ff3b30;
  --sidebar-width: 232px;
  --red-deadline: #ff3b30;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.04);
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 确保 hidden 属性不被 CSS display 覆盖（修复移动端遮罩灰屏） */
[hidden] {
  display: none !important;
}

body {
  min-height: 100dvh;
  font-family: var(--font-system);
  color: var(--text-primary);
  background: #eef0f8;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ========== 静态页面背景（无 blur / 无动画，微信友好） ========== */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #f0f2fa 0%,
    #eef0f8 50%,
    #f5f5f7 100%
  );
}

.bg-mesh__orb {
  display: none;
}

/* ========== 整体布局 ========== */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}

.page--fade-in {
  opacity: 1;
  transform: none;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 左侧边栏（GPT 风格） ========== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #f5f5f7;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  padding: 14px 10px;
  min-height: 100dvh;
  position: sticky;
  top: 0;
}

.sidebar__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sidebar__new-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sidebar__new-btn:hover {
  background: #fff;
}

.sidebar__new-icon {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text-secondary);
}

.sidebar__close-btn {
  display: none;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar__close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.sidebar__search-wrap {
  margin-bottom: 12px;
}

.sidebar__search {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 8px;
  outline: none;
  transition: background 0.2s ease;
}

.sidebar__search:focus {
  background: #fff;
}

.sidebar__search::placeholder {
  color: var(--text-muted);
}

.sidebar__history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
}

.sidebar__section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 4px;
  margin: 0;
}

.sidebar__actions-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.sidebar__actions-hint:hover {
  color: var(--text-secondary);
}

.sidebar__actions-hint[aria-expanded="true"] {
  color: var(--text-secondary);
}

.sidebar__actions-hint-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.sidebar__actions-tip {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 4px 10px;
  box-shadow: var(--shadow-soft);
}

.sidebar__actions-tip strong {
  color: var(--accent);
  font-weight: 600;
}

.sidebar__list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 4px 4px 8px;
}

.sidebar__list::-webkit-scrollbar {
  width: 6px;
}

.sidebar__list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* 今日最急 */
.sidebar-urgent {
  margin-bottom: 12px;
  padding: 0 2px;
}

.sidebar-urgent__title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 6px 4px;
}

.sidebar-urgent__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  background: rgba(255, 59, 48, 0.06);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-urgent__card:hover {
  background: rgba(255, 59, 48, 0.1);
}

.sidebar-urgent__summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-urgent__deadline {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red-deadline);
}

/* 单条历史记录 */
.history-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-bottom: 4px;
  border-radius: 8px;
  border: none;
  transition: background 0.15s ease;
}

.history-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.history-item--active {
  background: rgba(0, 0, 0, 0.06);
}

.history-item--pinned {
  /* 置顶仅排序，无额外边框 */
}

.history-item--pinned.history-item--active {
  background: rgba(0, 0, 0, 0.06);
}

.history-item__btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 8px 8px;
  font-family: inherit;
  font-size: 0.8rem;
  text-align: left;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.history-item:hover .history-item__btn,
.history-item--active .history-item__btn {
  background: transparent;
}

.history-item__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
  position: relative;
}

.history-item__icon--image {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
}

.history-item__icon--urgent {
  color: var(--red-deadline);
  background: rgba(255, 59, 48, 0.08);
}

.history-item__icon svg {
  display: block;
}

.history-item__pin-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.35);
}

.history-item__pin-dot svg {
  width: 8px;
  height: 8px;
}

.history-item__body {
  flex: 1;
  min-width: 0;
}

.history-item__title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.history-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.history-item__time {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.history-item__tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 100px;
  color: var(--danger);
  background: rgba(255, 59, 48, 0.1);
}

.history-item__menu {
  flex-shrink: 0;
  align-self: center;
  width: 30px;
  height: 30px;
  margin-right: 6px;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.history-item:hover .history-item__menu,
.history-item--active .history-item__menu,
.history-item--menu-open .history-item__menu {
  opacity: 1;
}

.history-item__menu:hover,
.history-item__menu:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

.history-item--menu-open {
  border-color: rgba(0, 113, 227, 0.2);
  background: rgba(0, 113, 227, 0.06);
}

.history-item--long-press {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.1);
  transform: scale(0.98);
}

/* 触屏设备：菜单按钮始终可见 */
@media (hover: none) {
  .history-item__menu {
    opacity: 1;
  }
}

/* 历史记录操作菜单 */
.history-menu {
  position: fixed;
  z-index: 500;
  min-width: 140px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.history-menu__item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.history-menu__item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.history-menu__item--danger {
  color: var(--danger);
}

.history-menu__item--danger:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* 重命名弹窗 */
.history-dialog {
  width: min(90vw, 360px);
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.history-dialog__form {
  padding: 24px;
}

.history-dialog__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.history-dialog__input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  outline: none;
  margin-bottom: 18px;
}

.history-dialog__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.history-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.history-dialog__btn {
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.history-dialog__btn--ghost {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.06);
}

.history-dialog__btn--primary {
  color: #fff;
  background: var(--accent);
}

/* 历史记录空状态插画 */
.sidebar__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 32px;
  text-align: center;
  animation: emptyFadeIn 0.5s ease-out;
}

.sidebar__empty--hidden {
  display: none;
}

@keyframes emptyFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar__empty-illus {
  width: min(168px, 72%);
  margin-bottom: 18px;
}

.sidebar__empty-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(255, 120, 90, 0.12));
}

.sidebar__empty--search .sidebar__empty-illus--default {
  display: none;
}

.sidebar__empty--search .sidebar__empty-illus--search {
  display: block;
}

.sidebar__empty-illus--search[hidden] {
  display: none;
}

.sidebar__empty-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.sidebar__empty-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 200px;
}

.sidebar-overlay {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden;
  opacity: 0;
}

.sidebar-overlay.is-open {
  display: block !important;
  pointer-events: auto !important;
  visibility: visible;
  opacity: 1;
}

/* ========== 右侧主区域 ========== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}

.main__toolbar {
  display: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.toolbar-btn__bars {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
}

.toolbar-btn__bars::before,
.toolbar-btn__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
}

.toolbar-btn__bars::before {
  top: -6px;
}

.toolbar-btn__bars::after {
  top: 6px;
}

.main__content {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition:
    max-width 0.85s cubic-bezier(0.34, 1.2, 0.64, 1),
    padding 0.65s cubic-bezier(0.34, 1.2, 0.64, 1),
    justify-content 0.65s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* 双栏展开：主区域略上移，为下方卷轴留出空间 */
.main__content--split {
  max-width: min(900px, 96vw);
  justify-content: flex-start;
  padding-top: 28px;
  padding-bottom: 40px;
}

/* ========== 玻璃拟态主卡片（Win11 / iOS 悬浮感） ========== */
.glass-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: padding 0.25s ease;
}

.glass-card--split {
  padding: 28px 28px 32px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  transform: none;
}

/* 翻译进行中：卡片持续向下舒展 */
.glass-card--expanding {
  transition:
    box-shadow 0.5s cubic-bezier(0.34, 1.2, 0.64, 1),
    padding 0.65s cubic-bezier(0.34, 1.2, 0.64, 1),
    transform 0.65s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ========== 页头（加大标题、美化） ========== */
.hero {
  text-align: center;
  margin-bottom: 40px;
  transition:
    margin-bottom 0.65s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.5s ease;
}

.hero__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 113, 227, 0.15);
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1d1d1f 0%, #424245 50%, #0071e3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 80px rgba(0, 113, 227, 0.15);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* 双栏时压缩页头，把空间让给工作区 */
.hero--compact {
  margin-bottom: 20px;
}

.hero--compact .hero__badge {
  margin-bottom: 12px;
  padding: 6px 14px;
}

.hero--compact .hero__title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin-bottom: 8px;
}

.hero--compact .hero__subtitle {
  font-size: 0.95rem;
}

/* ========== 双栏工作区：上输入 / 下输出，卷轴向下舒展 ========== */
.workspace {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  transition: gap 0.85s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.workspace--split {
  gap: 18px;
}

.workspace__input {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  position: relative;
  transition: flex 0.85s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.workspace--split .workspace__input {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/* 下栏：默认收起，展开时向下显示 */
.workspace__output {
  flex: 0 0 auto;
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.workspace--split .workspace__output {
  max-height: min(72dvh, 680px);
  display: flex;
  flex-direction: column;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

/* 加载 / 逐字打印：卷轴随内容增高而继续向下延伸 */
.workspace--split.workspace--unrolling .workspace__output {
  max-height: min(82dvh, 760px);
  transition-duration: 0.35s;
}

/* 结果写入时：卷轴边缘微光（移动端已禁用） */
.workspace--split .workspace__output.glass-panel--result::before {
  display: none;
}

/* 子面板毛玻璃 */
.glass-panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.glass-panel--composer {
  padding: 12px 14px 14px;
  background: #fff;
}

/* 双栏时：上栏输入区收紧，视线对齐下栏标题 */
.workspace--split .workspace__input.glass-panel--composer {
  padding: 14px 16px 16px;
}

.glass-panel--result.result-panel {
  position: relative;
  padding: 18px 16px 48px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace--split .workspace__output.glass-panel--result {
  padding: 16px 16px 48px;
  min-height: min(200px, 32dvh);
  flex: 1;
}

.workspace--split .glass-panel--result {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== GPT 风格输入框 Composer ========== */
.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 双栏时输入区保持紧凑，把纵向空间让给下方结果卷轴 */
.workspace--split .composer {
  flex: 0 0 auto;
}

.workspace--split .composer__textarea {
  max-height: 160px;
}

.composer__row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

/* 左侧圆形加号 */
.composer-add-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.composer-add-btn:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.12);
}

.composer-add-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.composer-add-btn__plus {
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  margin-top: -2px;
}

.composer__field {
  flex: 1;
  min-width: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 4px 36px 4px 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

/* 聚焦：粉橘暖色渐变流光边框（与背景弥散光呼应） */
.composer__field::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    90deg,
    rgba(255, 149, 0, 0.18),
    rgba(255, 120, 90, 0.72),
    rgba(255, 190, 140, 0.62),
    rgba(255, 107, 130, 0.55),
    rgba(255, 149, 0, 0.18)
  );
  background-size: 300% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.composer__field--focused::before,
.composer__field:focus-within::before {
  opacity: 1;
  animation: none;
}

.composer__field--focused,
.composer__field:focus-within {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.12);
}

@keyframes borderFlowGlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

/* 一键清空：聚焦时右下角浮现 */
.composer__clear-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85) translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.composer__clear-btn--visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.composer__clear-btn:hover {
  color: var(--accent);
  background: #fff;
}

.composer__textarea {
  width: 100%;
  min-height: 52px;
  max-height: 200px;
  padding: 12px 8px 12px 0;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-primary);
  background: transparent;
  border: none;
  resize: none;
  outline: none;
}

.composer__textarea::placeholder {
  color: var(--text-muted);
}

.document-file-input {
  display: none;
}

/* 文件预览卡片（苹果风玻璃卡片） */
.file-preview {
  margin-top: 12px;
}

.file-preview__card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.file-preview__icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--accent);
  background: linear-gradient(
    145deg,
    rgba(0, 113, 227, 0.12) 0%,
    rgba(0, 113, 227, 0.04) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.file-preview__meta {
  flex: 1;
  min-width: 0;
}

.file-preview__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview__type,
.file-preview__size {
  margin: 3px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.file-preview__status {
  flex-shrink: 0;
  max-width: 38%;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.4;
}

.file-preview__status--active {
  color: var(--accent);
}

@keyframes fileStatusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.composer__footer {
  display: flex;
  justify-content: flex-end;
  padding-left: 46px;
}

.composer-send-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #0071e3;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

/* 点击翻译：流光扫过 */
.composer-send-btn__flow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 35%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.15) 65%,
    transparent 100%
  );
  transform: translateX(-120%) skewX(-12deg);
  pointer-events: none;
}

.composer-send-btn--launching {
  box-shadow:
    0 4px 18px var(--accent-glow),
    0 0 32px rgba(0, 113, 227, 0.45);
}

.composer-send-btn--launching .composer-send-btn__flow,
.composer-send-btn--launching .translate-btn__shine {
  animation: none;
}

.composer-send-btn.translate-btn--breathing {
  animation: none;
}

.translate-btn__shine {
  display: none;
}

.composer-send-btn:disabled {
  cursor: wait;
  opacity: 0.85;
}

.composer-send-btn:active:not(:disabled) {
  opacity: 0.92;
}

/* 功能选择面板（加号弹出，可上下滚动） */
.feature-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  pointer-events: none;
}

.feature-sheet-backdrop:not([hidden]) {
  pointer-events: auto;
}

.feature-sheet {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  width: min(280px, 100%);
  max-height: min(52dvh, 320px);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.feature-sheet--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.feature-sheet__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 10px 8px;
  margin: 0;
}

.feature-sheet__scroll {
  flex: 1;
  min-height: 0;
  max-height: min(46dvh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.feature-sheet__scroll::-webkit-scrollbar {
  width: 5px;
}

.feature-sheet__scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.feature-sheet__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 12px;
  text-align: left;
  font-family: inherit;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.feature-sheet__item:active:not(:disabled) {
  background: rgba(0, 113, 227, 0.08);
}

.feature-sheet__item:disabled {
  opacity: 0.45;
  cursor: wait;
}

.feature-sheet__icon {
  flex-shrink: 0;
  display: flex;
  color: var(--text-secondary);
}

.feature-sheet__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-sheet__desc {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.image-file-input {
  display: none;
}

/* ========== 图片预览区（选图后确认上传） ========== */
.image-preview {
  margin-top: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.image-preview__thumb {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
  background: #f5f5f7;
  border: 1px solid var(--border-light);
}

/* 系统截图分享：显示来源状态，隐藏手动确认按钮 */
.image-preview__source {
  margin: 10px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}

.image-preview__source--active {
  color: var(--accent);
}

.image-preview--share-mode .image-preview__actions {
  display: none;
}

.image-preview__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

.image-preview__btn {
  flex: 1;
  max-width: 160px;
  min-height: 48px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.image-preview__btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.image-preview__btn--ghost {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.06);
}

.image-preview__btn--primary {
  color: #fff;
  background: #0071e3;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.2);
}

/* ========== 拍照预览区（拍照后自动识别，小缩略图 + 状态） ========== */
.camera-preview {
  margin-top: 14px;
}

.camera-preview__card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.camera-preview__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: #f5f5f7;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.camera-preview__status {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* 识别中状态：轻微脉动提示 */
.camera-preview__status--active {
  color: var(--accent);
}

/* 下栏结果：随卷轴向下展开 */
.workspace--split .result-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  animation: none;
}

.workspace--split .workspace__output .result-content {
  display: flex;
  flex-direction: column;
}

@keyframes resultRevealScroll {
  from {
    opacity: 0;
    transform: translateY(18px);
    clip-path: inset(0 0 85% 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

/* 逐字打印中的光标 */
.is-typing::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: typingCaret 0.9s step-end infinite;
  font-weight: 400;
}

@keyframes typingCaret {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* 逐字打印时关闭默认卡片淡入，改由 spring 动效驱动 */
.result-content--typing .result-card,
.result-content--typing .result-module {
  animation: none;
  opacity: 0;
}

.result-content--typing .result-card--pending,
.result-content--typing .result-module--pending {
  opacity: 0;
  transform: translateY(12px);
}

.result-card--revealing,
.result-module--revealing {
  opacity: 1;
  animation: cardRevealSpring 0.55s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes cardRevealSpring {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  min-height: 36px;
  flex-shrink: 0;
}

/* 双栏时「翻译结果」标题与上栏输入区顶对齐 */
.workspace--split .result-panel__header {
  margin-bottom: 12px;
}

.result-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.result-panel__dot--pulse {
  animation: none;
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.result-panel__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* 一键复制：结果区右下角 */
.result-panel__copy-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 130, 90, 0.28);
  border-radius: 50%;
  color: #e86a3a;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.88) translateY(6px);
  transition:
    opacity 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
    transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.result-panel__copy-btn:not([hidden]) {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.result-panel__copy-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff8a5c 0%, #ff6b6b 100%);
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(255, 120, 90, 0.35);
}

.result-panel__copy-btn--done {
  color: #34c759;
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.result-panel__copy-btn--done:hover {
  color: #34c759;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.2);
}

.result-panel__copy-tip {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 50%;
  transform: translateY(50%);
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.result-panel__copy-btn--done .result-panel__copy-tip {
  opacity: 1;
}

/* 结果容器：内部为多张独立卡片，本身保持轻量 */
.result-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  box-shadow: none;
}

/* 旧版三大模块（历史兼容，新结果用 result-cards） */
.result-modules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-todo-list__item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.result-todo-list__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-todo-list__label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.result-todo-list__check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.result-todo-list__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  background: #fff;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.result-todo-list__check:checked + .result-todo-list__box {
  background: var(--text-primary);
  border-color: var(--text-primary);
  box-shadow: none;
}

.result-todo-list__check:checked + .result-todo-list__box::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  margin: 3px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.result-todo-list__check:focus-visible + .result-todo-list__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-todo-list__text {
  flex: 1;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-primary);
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.result-todo-list__check:checked ~ .result-todo-list__text {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.result-todo-list__label:active .result-todo-list__box {
  transform: scale(0.92);
}

/* 日期高亮（关键点 / 旧截止时间共用） */
.result-keypoints__text .result-deadline__hl,
.result-deadline__hl {
  background: rgba(255, 59, 48, 0.12);
  color: #d70015;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-style: normal;
}

/* ========== 结果卡片组（四大核心卡片） ========== */
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  opacity: 1;
  animation: none;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.result-card__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.result-card__title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: none;
}

.result-card__body {
  color: var(--text-primary);
}

.result-card__para {
  margin: 0;
  line-height: 1.65;
}

/* 待办列表 */
.result-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-card__list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.result-card__list li:last-child {
  margin-bottom: 0;
}

.result-card__list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* 卡片1：核心干货 */
.result-card--summary {
  padding: 28px 24px 32px;
  background: rgba(255, 255, 255, 0.88);
}

.result-card__summary-text {
  margin: 0;
  font-size: clamp(1.2rem, 4.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

/* 卡片2：截止时间（视觉中心，仅红色强调） */
.result-card--deadline {
  text-align: center;
  padding: 26px 22px 28px;
  background: rgba(255, 255, 255, 0.9);
}

.result-deadline__date {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--red-deadline);
  line-height: 1.3;
}

.result-deadline__remain {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--red-deadline);
  opacity: 0.85;
}

/* 高亮：识别出的日期 / 时间 / 周几 */
.result-deadline__hl {
  background: rgba(255, 59, 48, 0.12);
  color: #d70015;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  font-style: normal;
}

.result-card--deadline-missing {
  padding: 20px 22px;
}

.result-deadline__empty {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* 紧急标签 */
.result-card__badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
}

.result-card__badge--urgent {
  color: #fff;
  background: linear-gradient(135deg, #ff3b30 0%, #ff6259 100%);
  box-shadow: 0 2px 10px rgba(255, 59, 48, 0.45);
  animation: urgentBadgePulse 1.6s ease-in-out infinite;
}

@keyframes urgentBadgePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(255, 59, 48, 0.4);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.55);
  }
}

.result-card--deadline-urgent .result-deadline__date {
  animation: urgentTextPulse 2s ease-in-out infinite;
}

@keyframes urgentTextPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

/* 卡片3：待办 */
.result-card--todo {
  padding: 16px 20px 18px;
}

.result-card__todo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.result-card__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-todo-copy-btn {
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.result-todo-copy-btn:hover {
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.18);
}

.result-todo-copy-btn--done {
  color: var(--text-muted);
  border-color: transparent;
}

/* 卡片4：后果 */
.result-card--consequence {
  padding: 16px 20px;
}

.result-card__consequence-text {
  margin: 6px 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-primary);
}

/* 折叠详情 */
.result-details {
  margin-top: 4px;
}

.result-details__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.result-details__toggle:hover {
  color: var(--text-primary);
}

.result-details__chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform 0.2s ease;
}

.result-details__toggle[aria-expanded="true"] .result-details__chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.result-details__panel {
  padding: 0 4px 8px;
}

.result-details__panel[hidden] {
  display: none;
}

.result-details__row {
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.result-details__row:first-child {
  border-top: none;
}

.result-details__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-details__value {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 错误卡片 */
.result-card--error {
  border: 1px solid rgba(255, 59, 48, 0.35);
  background: #fffafa;
  opacity: 1;
  animation: none;
}

.result-card--error .result-card__title {
  color: var(--danger);
}

/* 翻译进行中：结果区去掉内边距，让彩虹边框贴边更醒目 */
.result-panel--loading .result-content {
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* ========== 加载态：轻量骨架屏 ========== */
.result-loading {
  padding: 8px 4px;
}

.result-loading__skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  background: var(--glass-bg);
  border-radius: 16px;
}

.result-loading__line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
}

.result-loading__line--lg {
  height: 22px;
  width: 92%;
}

.result-loading__line--md {
  width: 65%;
}

.result-loading__line--sm {
  width: 45%;
}

.result-loading__hint {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.result-error__msg {
  font-weight: 500;
  color: var(--text-primary);
  padding: 12px 14px;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.22);
  border-radius: 10px;
}

.result-hint {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.result-hint strong {
  color: var(--accent);
}

.typing-cursor::after {
  content: "▋";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

.footer {
  text-align: center;
  margin-top: 28px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* GitHub Pages 静态部署：后端未连接提示 */
.backend-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 14px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #8a6d3b;
  background: rgba(255, 243, 205, 0.92);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 999px;
  max-width: min(100%, 420px);
}

.backend-banner__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffc107;
  animation: backendDotPulse 2s ease-in-out infinite;
}

@keyframes backendDotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ========== 手机端：侧栏抽屉 ========== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar__close-btn {
    display: block;
  }

  .sidebar-overlay.is-open {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.4);
    touch-action: none;
  }

  /* 手机端：禁用毛玻璃与 blur */
  .sidebar,
  .main__toolbar,
  .glass-card,
  .glass-panel,
  .feature-sheet,
  .composer__field,
  .quick-entry,
  .image-preview,
  .camera-preview__card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .glass-card,
  .glass-panel {
    background: #fff !important;
  }

  .bg-mesh__orb {
    display: none !important;
  }

  .main__toolbar {
    display: block;
  }

  .main__content {
    padding: 24px 16px;
    justify-content: flex-start;
  }

  .glass-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .hero__title {
    font-size: clamp(2.25rem, 10vw, 2.75rem);
  }

  .main__content--split {
    max-width: 100%;
    padding: 16px 12px 28px;
  }

  .glass-card,
  .glass-card--split {
    padding: 24px 16px;
  }

  .glass-card--split {
    transform: none;
  }

  .workspace--split {
    gap: 14px;
  }

  .workspace--split .workspace__output {
    max-height: min(68dvh, 560px);
  }

  .composer__textarea {
    max-height: 140px;
  }

  .feature-sheet {
    width: 100%;
    max-height: min(56dvh, 360px);
  }

  .feature-sheet__scroll {
    max-height: min(50dvh, 320px);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .image-preview__actions {
    flex-direction: column;
  }

  .image-preview__btn {
    max-width: none;
    width: 100%;
  }

  .workspace--split .workspace__output.glass-panel--result {
    min-height: min(160px, 28dvh);
  }

  .file-preview__card {
    flex-wrap: wrap;
  }

  .file-preview__status {
    flex: 1 1 100%;
    max-width: none;
    text-align: left;
    margin-top: 4px;
    padding-left: 62px;
  }

  /* 手机端：结果卡片更紧凑 */
  .result-cards {
    gap: 10px;
  }

  .result-card {
    padding: 16px 16px;
    border-radius: 14px;
  }

  .result-card--summary {
    padding: 22px 18px 24px;
  }

  .result-card__summary-text {
    font-size: 1.15rem;
  }

  .result-card--deadline {
    padding: 20px 16px 22px;
  }

  .result-deadline__date {
    font-size: 1.3rem;
  }

  .composer__textarea {
    min-height: 72px;
    font-size: 16px;
  }

  .main__content {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  }

  .composer__footer {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .sidebar {
    height: 100dvh;
    max-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .main__toolbar {
    padding-top: calc(12px + env(safe-area-inset-top, 0));
  }
}

/* ========== 快捷入口（智能操作区） ========== */
.quick-entry {
  margin-top: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-entry__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 8px;
}

.quick-entry__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.quick-entry__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 10px;
}

.quick-entry__count--none {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
}

.quick-entry__none {
  margin: 0;
  padding: 2px 0 4px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.quick-entry__panel {
  padding: 0 14px 14px;
}

.quick-entry__warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #b45309;
  background: rgba(255, 149, 0, 0.08);
  border-radius: 10px;
}

.quick-entry__warn-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.quick-entry__group {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-entry__group:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.quick-entry__group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quick-entry__cat-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.quick-entry__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-entry__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-entry__where {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 6px;
}

.quick-entry__item-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-entry__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.quick-entry__btn:hover,
.quick-entry__btn:active {
  background: rgba(0, 113, 227, 0.14);
  border-color: rgba(0, 113, 227, 0.25);
}

.quick-entry__btn--done {
  color: #1d7a3a;
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.25);
}

.quick-entry__hint {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
}

@media (max-width: 480px) {
  .quick-entry__item-action .quick-entry__btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ========== 中国移动端网页标准（全局） ========== */
html.cn-mobile,
html.cn-mobile body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html.cn-mobile .toolbar-btn {
  width: 44px;
  height: 44px;
}

html.cn-mobile .sidebar__new-btn {
  min-height: 44px;
  font-size: 0.95rem;
}

html.cn-mobile .hero__title {
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  -webkit-text-fill-color: var(--text-primary);
  background: none;
  text-shadow: none;
}

html.cn-mobile .hero__subtitle {
  font-size: 1.05rem;
}

html.cn-mobile .composer__textarea {
  font-size: 16px;
  min-height: 80px;
}

html.cn-mobile .workspace__output {
  transition-duration: 0.25s !important;
}

html.cn-mobile .result-card--revealing,
html.cn-mobile .result-module--revealing {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

html.cn-mobile .is-typing::after {
  animation: none;
}

html.in-app-browser .history-dialog {
  max-width: calc(100% - 32px);
  margin: auto;
}

html.in-app-browser .history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

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

/* ========== 生产稳定版：移动端 / 微信 / 加载与错误 ========== */

html.cn-mobile,
html.cn-mobile body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html.cn-mobile button,
html.cn-mobile .translate-btn,
html.cn-mobile .composer-add-btn,
html.cn-mobile .feature-sheet__item,
html.cn-mobile .history-menu__item,
html.cn-mobile .sidebar__new-btn,
html.cn-mobile .image-preview__btn {
  min-height: 44px;
  min-width: 44px;
  font-size: 1rem;
}

html.cn-mobile .result-hint,
html.cn-mobile .result-error__msg,
html.cn-mobile .footer,
html.cn-mobile .history-item__title {
  font-size: 1rem;
  line-height: 1.5;
}

.result-loading__slow-hint {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.12);
  color: var(--text-secondary, #666);
  font-size: 0.95rem;
  text-align: center;
}

.result-error__retry {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 20px;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.result-error__retry:active {
  opacity: 0.85;
}

.image-preview__compress-hint {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent, #2563eb);
  font-size: 0.9rem;
  text-align: center;
}

html.in-app-browser .result-loading__rainbow-box {
  animation: none !important;
}

html.in-app-browser .translate-btn--breathing {
  animation: none !important;
}

html.in-app-browser .page--fade-in {
  opacity: 1 !important;
  transform: none !important;
}
