﻿@font-face {
  font-family: 'WumuFangSong';
  src: url('/fonts/fangsong.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============ 数字小键盘（紧凑版） ============ */
.num-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 5px;
  width: 100%;
}
.num-pad.hidden { display: none; }
.num-pad button {
  padding: 3px 0;
  min-height: 26px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  border: 1px solid #d0d5db;
  border-radius: 4px;
  background: #f7f9fb;
  color: #1b1f24;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.num-pad button:active { background: #e8f1ff; border-color: #0a84ff; }
.num-pad button.back { background: #fee; color: #dc2626; }
.num-pad button.clear { background: #f3f4f6; color: #6b7280; font-size: 12px; }
.num-pad button.minus { background: #f3f4f6; }

.mtext-h-btn {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #d0d5db;
  border-radius: 6px;
  background: #f7f9fb;
  color: #1b1f24;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mtext-h-btn:hover { background: #e8f1ff; border-color: #0a84ff; }
.mtext-h-btn.active { background: #0a84ff; border-color: #0a84ff; color: #fff; }

.dialog {
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.dialog.num-pad-open { padding: 6px 6px 8px; min-width: 0; width: 160px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #d8d3c9;
  background-image: radial-gradient(#c9c3b8 1px, transparent 1px);
  background-size: 20px 20px;
}

html, body { overflow: hidden; overscroll-behavior: none; touch-action: none; }
#cv { touch-action: none !important; }

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

#app {
  position: relative !important;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#cvWrap {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}
#cv {
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: #f5f4f0 !important;
  touch-action: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

#fileBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: transparent;
  user-select: none;
  font-size: 13px;
  color: #5c554b;
  cursor: pointer;
  pointer-events: none;
}
#fileBar > * {
  pointer-events: auto;
}

/* ======== ★ 悬浮居中工具栏 (Dock 风格) ======== */
#toolbar {
  position: fixed !important;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 100 !important;

  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 8px 12px !important;

  /* ★ 毛玻璃特效 ★ */
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;

  /* 边框与阴影让它更立体 */
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 24px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;

  width: calc(100% - 130px) !important; /* 左右留出空间给撤销重做按钮 */
  max-width: 800px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}
#toolbar::-webkit-scrollbar { display: none !important; }
#toolbar { -webkit-overflow-scrolling: touch; }

/* ======== Dock 内的按钮适配 ======== */
.tool-btn {
  flex: 0 0 auto !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  border: none !important;
  background: transparent !important; /* 去掉原来的白底黑框 */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  box-sizing: border-box !important;
}
.tool-btn:hover { background: rgba(0, 0, 0, 0.06) !important; }
.tool-btn:active, .tool-btn.active {
  background: rgba(0, 0, 0, 0.12) !important; /* ★ 改成柔和的高级灰，透明质感 */
  transform: scale(0.92) !important;
}
.tool-btn svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  flex-shrink: 0 !important;
  pointer-events: none !important;
}

/* ★ 有弹出菜单的工具：右上角一个小圆点做提示 */
.tool-btn { position: relative !important; }
.tool-btn.has-menu::after {
  content: '' !important;
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
  background: currentColor !important;
  opacity: 0.55 !important;
  pointer-events: none !important;
}
.tool-btn.has-menu:active::after,
.tool-btn.has-menu.active::after { opacity: 0.9 !important; }

.tool-btn[data-color="darkgray"] { color: #4b5563 !important; }
.tool-btn[data-color="purple"]   { color: #8b5cf6 !important; }
.tool-btn[data-color="blue"]     { color: #3b82f6 !important; }
.tool-btn[data-color="teal"]     { color: #14b8a6 !important; }
.tool-btn[data-color="amber"]    { color: #f59e0b !important; }
.tool-btn[data-color="orange"]   { color: #f97316 !important; }
.tool-btn[data-color="green"]    { color: #10b981 !important; }
.tool-btn[data-color="red"]      { color: #ef4444 !important; }

#status {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  min-height: 30px;
  line-height: 30px;
  padding: 0 18px calc(8px + env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  color: #7a7266;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  pointer-events: none;
}
#status > * { pointer-events: auto; }
#statusMain {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  line-height: 26px;
}
#statusMain .roll-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: statusRoll var(--roll-dur, 15s) linear infinite;
}
@keyframes statusRoll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

#statusMarquee {
  flex: 0 0 auto;
  width: 65px; /* 限制为 5 个字左右的宽度 */
  overflow: hidden; /* 超出部分隐藏 */
  position: relative;
  height: 18px;
  line-height: 18px;
  font-weight: 700;
  font-size: 11px;
  /* 移除了原本的淡入淡出 opacity 动画 */
  text-shadow:
    0px 0px 2px rgba(255, 255, 255, 1),
    0px 1px 3px rgba(0, 0, 0, 0.3);
}
#statusMarquee .marquee-inner {
  position: absolute;
  white-space: nowrap;
  display: inline-block;
  will-change: transform;
  left: 0;
  top: 0;
}



.popup-menu {
  position: fixed;
  z-index: 80;
  background: #2b2f36;
  border: 1px solid #121417;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  padding: 6px;
  min-width: 180px;
}
.popup-menu.hidden { display: none; }
.popup-menu .item {
  padding: 11px 14px;
  font-size: 14px;
  color: #e6e9ee;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.popup-menu .item:hover { background: #3a404a; }
.popup-menu .item.switch { justify-content: space-between; }
.popup-menu .item .on { color: #10b981; font-weight: 700; }
.popup-menu .item .off { color: #6b7280; }
.popup-menu .item.disabled { color: #5a6169; cursor: default; }
.popup-menu .item.disabled:hover { background: transparent; }
.popup-menu .sep { height: 1px; background: #3a404a; margin: 4px 6px; }

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#overlay.hidden { display: none; }

#overlay2 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
}
#overlay2.hidden { display: none; }

#overlay3 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
#overlay3.hidden { display: none; }

#overlay4 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 130;
}
#overlay4.hidden { display: none; }

#overlay5 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 140;
}
#overlay5.hidden { display: none; }

#overlay6 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}
#overlay6.hidden { display: none; }

#overlay7 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 145;
}
#overlay7.hidden { display: none; }

.dialog {
  background: #fff;
  border-radius: 10px;
  padding: 18px 18px 14px;
  min-width: 270px;
  max-width: 92vw;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.dialog label {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 600;
}
.dialog input,
.dialog textarea {
  width: 100%;
  padding: 9px 10px;
  font-size: 16px;
  border: 1px solid #c8ccd2;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.dialog input:focus,
.dialog textarea:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, .2);
}
.dialog .btns {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.dialog .btns button {
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
#dlgCancel { background: #e8eaed; color: #333; }
#dlgOk { background: #0a84ff; color: #fff; font-weight: 600; }

.export-choice {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid #d0d5db;
  border-radius: 8px;
  background: #f7f9fb;
  color: #1b1f24;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 8px;
  transition: background .12s;
}
.export-choice:hover { background: #e8f1ff; border-color: #0a84ff; }
.export-choice .sub {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

#fileInput { display: none; }

.tooltip {
  position: fixed;
  background: #111;
  color: #fff;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s;
}
.tooltip.show { opacity: 1; }

#txtContent {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  width: 100%;
  height: 44vh;
  padding: 8px;
  border: 1px solid #c8ccd2;
  border-radius: 6px;
  background: #f7f9fb;
  color: #1b1f24;
  resize: vertical;
  outline: none;
}

.mtext-tip {
  position: fixed;
  background: rgba(20, 20, 20, .88);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 250;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s;
}
.mtext-tip.show { opacity: 1; }

.grid-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.grid-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.grid-row .grid-lb {
  flex: 0 0 72px;
  font-size: 13px;
  color: #333;
}
.grid-row input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid #c8ccd2;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
}
.grid-row input:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, .2);
}
.grid-row .grid-unit {
  flex: 0 0 auto;
  font-size: 12px;
  color: #6b7280;
}
.grid-section-title {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  margin: 2px 0 6px;
  letter-spacing: .5px;
}
.grid-tip {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 10px;
}

#cmdBar {
  position: fixed;
  bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, .88);
  color: #fff;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 15px;
  letter-spacing: 2px;
  z-index: 220;
  pointer-events: none;
  display: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
#cmdBar.show { display: block; }


.float-btn {
  position: fixed;
  bottom: calc(41px + env(safe-area-inset-bottom, 0px)) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
/*下面这三行控制毛玻璃*/
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #333 !important;
  font-size: 22px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101 !important;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.float-btn:active { transform: scale(.92) !important; background: #e8f1ff !important; }

.float-btn.left { left: 16px !important; }
.float-btn.right { right: 16px !important; }

.float-btn.center {
  left: 50%;
  /* ★ 紧贴工具栏上方（工具栏底边 40px + 约 60px 高 + 8px 间距），不压状态栏 */
  bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;

  opacity: 0;
  pointer-events: none;
  /* ★ 动画修改：从底部向上冒出 */
  transform: translateX(-50%) translateY(20px) scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease !important;
}

.float-btn.center.show-delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.float-btn.center.show-delete:active {
  transform: translateX(-50%) translateY(0) scale(0.92) !important;
  background: #e8f1ff !important;
}

.float-btn.end-dim {
  bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  right: 16px !important;
  width: 56px !important;
  height: 56px !important;
  background: #10b981 !important;
  color: #fff !important;
  font-size: 28px !important;
  font-weight: 700;
}
.float-btn.end-dim:active { transform: scale(.92); background: #059669 !important; }
.float-btn.end-dim.hidden { display: none !important; }

@media (max-width: 768px) {
  .float-btn.center { display: flex; }
}
#rescueBar {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #d97706;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  z-index: 260;
  max-width: 94vw;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
#rescueBar.hidden { display: none; }
#rescueBar #rescueMsg { max-width: 60vw; }
#rescueBar button {
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
#rescueBar button:hover { background: rgba(255, 255, 255, .32); }
#rescueBar #rescueClose {
  padding: 4px 9px;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 一行两个卡片 */
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
  background: transparent;
  border: none;
}
.file-list .row {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e4ea;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #fff;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.file-list .row:active { transform: scale(0.96); }
.file-list .row .thumb-box {
  width: 100%;
  height: 110px;
  background: #f5f4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e8ecf0;
}
.file-list .row .thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.file-list .row .thumb-box .no-thumb { font-size: 32px; opacity: 0.2; }
.file-list .row .info {
  padding: 6px 8px;
  flex: 1;
  min-width: 0;
  border-bottom: none;
}
.file-list .row .fname {
  font-size: 13px;
  font-weight: 600;
  color: #1b1f24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-list .row .meta { font-size: 10px; color: #9aa3ae; margin-top: 2px; }

/* 调整删除按钮和复选框位置 */
.file-list .row .del-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.file-list .row .sel-box {
  position: absolute;
  top: 6px; left: 6px; z-index: 2;
  width: 18px; height: 18px;
}

.list-title {
  font-size: 15px;
  font-weight: 700;
  color: #1b1f24;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-title .hint {
  font-size: 11px;
  font-weight: 400;
  color: #9aa3ae;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #faf8f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .7s ease, visibility .7s ease;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
}
#splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#splash .bg-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 165, 155, .18), rgba(201, 165, 155, 0) 70%);
  pointer-events: none;
  z-index: 1;
}
#splash .bg-circle.c1 { width: 60vmin; height: 60vmin; top: -20vmin; left: -15vmin; }
#splash .bg-circle.c2 { width: 45vmin; height: 45vmin; bottom: -15vmin; right: -10vmin; }
#splash .content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  animation: splashIn .9s ease-out both;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#splash .logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#splash .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#splash .title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #a5281e;
  margin-bottom: 14px;
}
#splash .version {
  font-size: 14px;
  color: #b55a4f;
  letter-spacing: 6px;
  margin-bottom: 12px;
  font-weight: 500;
}
#splash .subtitle {
  font-size: 13px;
  color: #8a6a5c;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
#splash .subtitle-en {
  font-size: 11px;
  color: #a89086;
  letter-spacing: 2px;
  margin-bottom: 44px;
  text-transform: uppercase;
}
#splash .author {
  font-size: 15px;
  color: #6b4a3f;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
#splash .author .name {
  color: #a5281e;
  font-weight: 600;
  letter-spacing: 2px;
}
#splash .powered {
  font-size: 13px;
  color: #8a6a5c;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
#splash .powered .ds-name {
  color: #a5281e;
  font-weight: 600;
  letter-spacing: 1px;
}
#splash .loading {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 34px;
}
#splash .loading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9a59b;
  animation: dotPulse 1.2s ease-in-out infinite;
}
#splash .loading i:nth-child(2) { animation-delay: .15s; }
#splash .loading i:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50%      { opacity: 1;  transform: scale(1.1); }
}
#splash .copyright {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #b0a098;
  letter-spacing: 1px;
  padding: 0 20px;
  line-height: 1.7;
  z-index: 2;
}

/* ===== 横屏紧凑布局：只在矮横屏生效，竖屏完全不受影响 ===== */
@media (orientation: landscape) and (max-height: 500px) {
  #fileBar {
    min-height: 30px;
    padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 4px;
    font-size: 12px;
  }
  #fileBar .hint { font-size: 10px; }
  #toolbar { padding: 4px 8px; gap: 6px; }
  .tool-btn { width: 34px; height: 34px; border-radius: 8px; }
  .tool-btn svg { width: 18px; height: 18px; }
  #status { min-height: 20px; line-height: 20px; font-size: 11px; }
  .float-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }
  .float-btn.left { left: 10px; }
  .float-btn.right { right: 10px; }
  .float-btn.left { left: 10px; }
  .float-btn.right { right: 10px; }
  .float-btn.end-dim {
    width: 44px !important;
    height: 44px !important;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    font-size: 22px !important;
  }
}

/* ★ 右上角 UI 隐藏按钮 */
#btnToggleUI {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 9999;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#btnToggleUI:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.9);
}
#btnToggleUI svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}
/* 隐藏状态时，箭头旋转180度变成向右 */
#btnToggleUI.is-hidden svg {
  transform: rotate(180deg);
}



/* ===== 更新说明弹窗 ===== */
#whatsNewMask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9000;
}
#whatsNew {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.wn-head { padding: 18px 20px 10px; }
.wn-title { font-size: 18px; font-weight: 700; color: #1f2328; letter-spacing: .5px; }
.wn-ver { font-size: 12px; color: #8a8f98; margin-top: 4px; letter-spacing: 1px; }
.wn-list {
  padding: 2px 20px 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.wn-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.55;
  color: #33383f;
  border-bottom: 1px solid #f2f2f2;
}
.wn-item:last-child { border-bottom: none; }
.wn-ico { flex: 0 0 auto; width: 22px; text-align: center; font-size: 15px; }
.wn-txt { flex: 1 1 auto; }
.wn-foot {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f2f2f2;
}
#wnOk {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #0a84ff;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
#wnOk:active { transform: scale(.98); background: #0873dd; }

/* ★ 对话框里的小提示行（缓存/导出提醒） */
#dlgHint.dlg-hint {
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0 4px;
  text-align: left;
  font-weight: normal;
  white-space: normal;
}