/* 快传 — 界面样式
   设计参考 Apple：删掉不必要的东西，留白本身就是设计。
   无边框分区，靠间距和字号建立层级；克制的中性灰阶 + 一个强调色。
   改强调色只需改 --acc 一个变量。 */

:root {
  --ink:      #1d1d1f;
  --ink-2:    #6e6e73;
  --ink-3:    #a1a1a6;
  --paper:    #ffffff;
  --paper-2:  #fbfbfd;
  --fill:     #f5f5f7;
  --fill-2:   #e8e8ed;
  --rule:     #e2e2e5;
  --acc:      #0071e3;
  --ok:       #1d8049;
  --bad:      #d70015;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 语义别名（v5 补全：此前 --card / --line 被引用但从未定义，
     导致取件卡边框整条声明失效、阴影色彩与全站不一致） */
  --card:  var(--paper);
  --line:  var(--rule);
  --shadow-1: 0 1px 3px rgba(0,0,0,.04);
  --shadow-2: 0 6px 24px rgba(0,0,0,.09);

  /* 垂直节奏令牌（v5：用间距表达区块归属关系） */
  --gap-block: 28px;    /* 独立区块之间 */
  --gap-tight: 12px;    /* 语义上从属的元素之间（如分段控件与其面板） */
  --card-pad:  22px 24px;
  --block-h:   208px;   /* 上传区与文本域的统一高度 */
}

* { box-sizing: border-box; }

/* hidden 属性必须赢过组件的 display（.btn{display:inline-flex} 等作者样式会覆盖 UA 的 [hidden]，
   导致 hidden 属性为真但按钮照样渲染——此坑本文件的 #paneFile[hidden] 补丁同源） */
[hidden] { display: none !important; }

/* ===== 移动端基线（触屏手感）=====
   触屏没有悬停，浏览器会在点按后把 :hover 粘在元素上——悬停样式统一
   收进文件尾的指针门控；点按反馈由 :active 提供。 */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;   /* 灰色点按闪块交给自家 :active */
  overscroll-behavior: none;                  /* 不让下拉刷新劫持页面滚动 */
}
button, a, [role="button"], .mtab, .pk, .dropzone {
  touch-action: manipulation;                 /* 双击缩放不再吃掉点按延迟 */
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;                /* 长按控件不弹选择/呼出 */
}
/* iOS Safari 对字号 <16px 的输入框聚焦时会缩放页面且不回弹。
   只在触屏上放大到 16px（桌面细指针不受影响），并禁页面缩放是错误修法。 */
@media (pointer: coarse) {
  input, select, textarea, .ta, .rc-input, .pk-input { font-size: 16px; }
}

body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font: 16px/1.55 "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;   /* 跟随真实可视高度：100vh 是 URL 栏收起后的最大视口，移动端首屏会溢出 */
  display: flex; flex-direction: column;   /* v5：footer 贴底，消除内容少时的底部空洞 */
}

a { color: var(--acc); text-decoration: none; }

code, pre { font-family: var(--mono); font-size: 13px; }
code { background: var(--fill); padding: 2px 6px; border-radius: 5px; }
pre { padding: 16px 18px; overflow-x: auto; background: var(--fill); border-radius: var(--r); margin: 0; }
pre code { background: none; padding: 0; }

/* ============ 顶栏 ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; padding-top: env(safe-area-inset-top, 0px);
  height: calc(56px + env(safe-area-inset-top, 0px));   /* 让出状态栏/刘海区：viewport-fit=cover 已开 */
  background: rgba(251,251,253,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1;
}
.brand svg { display: block; flex: none; border-radius: 7px; }
.brand span { line-height: 1; }   /* v5：与 28px logo 视觉居中对齐 */
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: var(--ink-2); font-size: 14px; padding: 10px 0; }
.topbar nav a.on { color: var(--ink); }
.logout-form { margin: 0; }
.logout-form button { padding: 0; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 24px 56px; flex: 1 0 auto; width: 100%; }

/* 后台是桌面工作区，不沿用前台 640px 的单任务阅读宽度。 */
.admin-page .wrap { max-width: 1360px; padding: 28px 32px 72px; }
.admin-page nav.tabs { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 12; width: max-content; max-width: 100%; }
.admin-page .panel { padding: 28px 30px; }
.admin-page .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.foot { text-align: center; color: var(--ink-3); font-size: 12.5px; padding: 0 0 calc(36px + env(safe-area-inset-bottom, 0px)); flex: none; }   /* 让开 Home 指示条 */

/* ============ Hero ============ */
/* v6：站名用站点专属子集字体（仅含「心印快传」4 字，1.4KB），
   字形比例统一、笔画干净，比系统回退字体更像一个标识。
   font-display: swap 保证字体没到也能立即看到系统字。 */
@font-face {
  font-family: "FX Title";
  src: url("font/subset.woff2?v=1") format("woff2");
  font-weight: 400;
  font-display: swap;
}
.hero { padding: 44px 0 22px; text-align: center; }

/* 首页内容少时在首屏内垂直居中（伪元素 auto-margin：空间不足自动归零，不裁顶），
   结果卡出现后内容变多，自动回到顶部对齐，行为与长页面一致 */
.home .wrap { display: flex; flex-direction: column; }
.home .wrap::before { content: ""; margin-top: auto; }
.home .wrap::after  { content: ""; margin-bottom: auto; }

.hero-note { margin: 10px auto 0; max-width: 30em; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }

.hero h1 {
  margin: 0 0 10px; font-size: 42px; font-weight: 400;
  font-family: "FX Title", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: .04em;                /* 子集字面无内建字距，手动放开一点更舒展 */
  line-height: 1.12;
}
.hero p { margin: 0; color: var(--ink-2); font-size: 17px; }

/* ============ 舞台区（无边框，靠留白分隔） ============ */
.stage { padding: 0; margin-bottom: var(--gap-block); }
.stage.quiet {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-1);
}
.stage-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.stage-h h2 { margin: 0; font-size: 15px; font-weight: 600; }

h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

.muted { color: var(--ink-3); font-size: 13.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.gap { gap: 10px; }
.link { color: var(--acc); cursor: pointer; }
.sep { color: var(--ink-3); margin: 0 4px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border: none; border-radius: 980px;
  background: var(--fill); color: var(--ink);
  font-size: 15px; font-weight: 400; line-height: 1.3; cursor: pointer;
  font-family: inherit; transition: background .18s ease, opacity .18s ease, transform .12s ease-out;
  white-space: nowrap;   /* v5：修复「解锁」等两字按钮被挤压后竖排断行 */
  flex: none;            /* v5：避免在 flex 容器里被输入框挤压 */
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--acc); color: #fff; }
.btn.danger { background: var(--fill); color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.btn.sm { padding: 7px 15px; font-size: 13.5px; }
.btn.lg { padding: 14px 40px; font-size: 17px; font-weight: 500; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* 管理面板导航 */
nav.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 3px;
  background: var(--fill); border-radius: 10px; margin-bottom: 24px;
}
.tab { padding: 8px 16px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.tab.on { background: var(--paper); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ============ 上传区 ============ */
/* v5：dropzone 与 .ta 统一使用 --block-h，切换「文件/文本」tab 时高度不跳动 */
.dropzone {
  background: var(--paper); border-radius: var(--r-lg);
  height: var(--block-h); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; text-align: center; cursor: pointer;
  transition: box-shadow .2s, transform .2s, background .2s;
  box-shadow: var(--shadow-1);
}
.dropzone.drag, .dropzone:focus-visible {
  box-shadow: var(--shadow-2); outline: none; transform: translateY(-1px);
}
.dropzone.drag { background: #f0f7ff; }
.dz-icon { color: var(--ink-3); line-height: 0; transition: color .2s, transform .2s; }
.dropzone.drag .dz-icon { color: var(--acc); transform: translateY(-2px); }
.dz-text { margin-top: 16px; font-size: 18px; font-weight: 500; color: var(--ink); }
.dz-sub { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); }

/* 隐藏 file input：用 class 而非 hidden，iOS Safari 才能 click() */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: .01; pointer-events: none; }

/* 文本域 */
.ta {
  width: 100%; border: none; border-radius: var(--r-lg); padding: 18px 20px;
  font: 14px/1.65 var(--mono); background: var(--paper);
  color: var(--ink); height: var(--block-h); min-height: var(--block-h);
  box-shadow: var(--shadow-1);
  resize: none;              /* v5：禁用拖柄，保持与文件 tab 等高、外观统一 */
  overflow-y: auto;
  display: block;
}
.ta::placeholder { color: var(--ink-3); }
.ta:focus { outline: 2px solid var(--acc); outline-offset: -2px; }

/* ============ 上传队列 ============ */
.qitem {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; margin-top: 10px;
  background: var(--paper); border-radius: var(--r);
}
.qicon {
  width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--fill); border-radius: 9px; font: 600 12px/1 var(--mono); color: var(--ink-2);
}
.qname { flex: 1; min-width: 0; }
.qname b { display: block; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 进度条（v8）：扁平、克制的强调色填充 —— 与全站按钮/标签同一套语言。
   之前那版「蓝→青渐变 + 外发光 + 凹槽内阴影 + 玻璃高光」是全站唯一的异类，显得又亮又旧。
   现在只保留一条填充：位置由 JS 缓动逐帧驱动（见 app.js），到站/失败仅换色。 */
.qbar {
  position: relative; height: 6px; margin-top: 12px;
  background: var(--fill-2);
  border-radius: 999px;
  overflow: hidden;
}
.qbar i {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: inherit;
  background: var(--acc);
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
  transition: background-color .35s ease;   /* 仅到站/失败换色；位置由 JS 缓动驱动 */
}
.qitem.done .qbar i { background: var(--ok); }
.qitem.fail .qbar i { background: var(--bad); }
.qstat { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============ 结果卡片 ============ */
.result-card {
  background: var(--paper); border-radius: var(--r-lg);
  padding: var(--card-pad); margin-top: 16px;
  box-shadow: var(--shadow-1);
  animation: rise .3s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise-fade { from { opacity: 0; } to { opacity: 1; } }   /* 动效敏感降级：只留淡入，去掉位移 */
.rc-head { display: flex; gap: 10px; align-items: center; }
.rc-head > svg { color: var(--ok); flex: none; }
.rc-head .rc-title { flex: 1 1 auto; }        /* 标题吃掉剩余宽度，把「···」顶到最右 */
.rc-head .mi-more { margin-left: auto; }
.rc-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rc-title b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-title .muted { font-size: 12.5px; }
.rc-row { display: flex; gap: 8px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.rc-label { display: none; }
.rc-input {
  flex: 1; min-width: 190px; padding: 11px 14px; font: 13.5px var(--mono);
  border: none; border-radius: 10px; background: var(--fill); color: var(--ink-2);
}
.rc-input:focus { outline: 2px solid var(--acc); outline-offset: -2px; }
/* 链接下方的一句说明（一行为限，不抢戏） */
.rc-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
/* 行内小备注：跟在控件后面解释它的用途 */
.rc-note { font-size: 12.5px; color: var(--ink-3); }
/* 快传码胶囊：点一下就复制 —— 取代原来「输入框 + 按钮 + 说明」两行 */
.rc-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 8px 14px 8px 17px;          /* 右侧少 3px 补偿字距末位，视觉居中 */
  border: none; border-radius: 980px;  /* 与同排的「有效期」胶囊同形，别一个圆角一个圆 */
  background: var(--fill); color: var(--ink); font-family: inherit;
  font-size: 14px; font-weight: 500;   /* 「已复制」态沿用同字号，不会突然变大 */
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .12s ease-out;
}
.rc-chip code { font: 600 14px var(--mono); letter-spacing: .16em; }
.rc-chip svg { flex: none; width: 13px; height: 13px; color: var(--ink-3); }   /* 小小的复制图标：让它看得出能点 */
.rc-chip.copied { background: rgba(29, 128, 73, .12); color: var(--ok); }
.rc-chip.copied svg { color: currentColor; }
.rc-pass { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============ 我发过的 ============ */
.mine-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.mine-item:last-child { border-bottom: none; }
.mi-info { flex: 1 1 auto; min-width: 0; }
/* v5：标题行 = 文件名 +（快传码徽标 + 访问码标记），元信息行只留类型/大小/时间 */
.mi-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mi-info b { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mi-code {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 2px 6px; border: none; border-radius: 5px;
  background: var(--fill); color: var(--ink-2);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
  cursor: pointer;                    /* 点一下就复制「去主站输入这串码」的说明 */
  transition: background .16s ease, color .16s ease;
}
.mi-code svg { flex: none; width: 11px; height: 11px; color: var(--ink-3); }
.mi-code.copied { background: rgba(29, 128, 73, .12); color: var(--ok); font-family: inherit; letter-spacing: 0; }
.mi-code.copied svg { color: currentColor; }
.mi-flag { flex: none; display: inline-flex; align-items: center; color: var(--ink-3); }
.mi-flag svg { width: 14px; height: 14px; }
.mi-info .muted {
  display: block; margin-top: 3px;
  font-size: 12.5px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* v5：操作按钮在桌面端右侧成组，窄容器下自动换行到下一行（见媒体查询） */
.mi-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: none; justify-content: flex-end; }

/* 更多操作溢出菜单：主操作（复制链接）平铺，二维码/访问码/删除收纳进 ··· */
.mi-more { position: relative; flex: none; }
.mi-more-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s ease-out;
}
.mi-more-btn:active { transform: scale(.94); }
.mi-more.open .mi-more-btn { background: var(--fill); color: var(--ink); }
.mi-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  min-width: 156px; padding: 6px;
  background: var(--paper); border-radius: var(--r);
  box-shadow: var(--shadow-2);
  transform-origin: top right;      /* 从触发器起缩放，不从菜单中心 */
  opacity: 0; transform: translateY(-4px) scale(.97); visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .2s cubic-bezier(0.23,1,0.32,1), visibility 0s .2s;
}
.mi-more.open .mi-menu {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .16s ease, transform .2s cubic-bezier(0.23,1,0.32,1), visibility 0s;
}
.mi-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink);
  font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background .15s, color .15s, transform .12s ease-out;
}
.mi-menu-item:active { transform: scale(.98); }
.mi-menu-item svg { flex: none; }
.mi-menu-item.danger { color: var(--bad); }
.mi-menu-sep { height: 1px; margin: 5px 6px; background: var(--rule); }
@media (min-width: 641px) {
  /* 桌面端：保证按钮组不挤压信息区，信息区至少占一半宽度 */
  .mi-info { flex: 1 1 52%; }
}

/* ============ 取件页（v6.3 居中版式）============ */
.dl-card { text-align: center; padding: 8px 0 2px; }
.dl-mark {
  width: 72px; height: 72px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #2b8cff, #0062d6);   /* 品牌渐变，与 logo 同源 */
  border-radius: 20px; color: #fff;
  box-shadow: 0 10px 26px rgba(0, 98, 214, .30);
}
.dl-mark.warn { background: linear-gradient(180deg, #ffab2e, #df7e00); box-shadow: 0 10px 26px rgba(223, 126, 0, .26); }
.dl-h { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 10px; }
.dl-name { word-break: break-all; }
.dl-meta { font-size: 13.5px; margin: 0; color: var(--ink-2); }
.dl-meta .sep { margin: 0 7px; color: var(--ink-3); }
.dl-code { margin: 18px 0 0; }
.dl-code-t { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: .1em; margin-bottom: 7px; }
.dl-code code {
  font-size: 20px; font-weight: 600; letter-spacing: .22em;
  padding: 9px 14px 9px 19px;   /* 右侧少 5px 补偿字距末位，视觉居中 */
  background: var(--fill); border-radius: 12px;
}
.dl-actions { display: flex; gap: 10px; margin-top: 26px; }
.dl-actions .btn { flex: 1; justify-content: center; }
/* 窄屏：文本分享有三个按钮，横排会溢出卡片 —— 主操作独占一行，次要两个并排 */
@media (max-width: 640px) {
  .dl-actions { flex-wrap: wrap; }
  .dl-actions .btn.lg { padding: 13px 16px; font-size: 16px; }
  .dl-actions .btn.primary { flex: 1 1 100%; }
  .dl-actions .btn:not(.primary) { flex: 1 1 0; min-width: 0; }
}
.empty-h { font-weight: 600; font-size: 24px; letter-spacing: -.02em; }

.passrow { display: flex; gap: 8px; align-items: center; margin: 22px auto 0; max-width: 380px; }
.passrow input { flex: 1 1 auto; min-width: 0; }
/* ---------- 取件页·文本：可翻转的卡片 ----------
   整张卡是一个 3D 翻转容器：正/背两面叠在同一个网格格里，靠 backface-visibility 切换。
   桌面不翻卡（改用悬停浮层看二维码），手机才把卡翻过来 —— 见 app.js 的指针判定。 */
.dl-flip { max-width: 640px; margin: 44px auto 20px; perspective: 1600px; }
.dl-flip-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.dl-flip.flipped .dl-flip-inner { transform: rotateY(180deg); }
.dl-face {
  grid-area: 1 / 1;                    /* 两面同格：卡片高度取两者较大值，翻面时不跳 */
  background: var(--paper); border-radius: var(--r-lg);
  padding: 30px 30px 28px; box-shadow: var(--shadow-1);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.dl-flip.flipped .dl-face--front { pointer-events: none; }   /* 背面朝前时前脸不再挡点击 */
.dl-face--back {
  transform: rotateY(180deg); pointer-events: none;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
}
.dl-flip.flipped .dl-face--back { pointer-events: auto; }
.dl-face-in { display: grid; justify-items: center; gap: 14px; }

/* 二维码白盘：给码留出静默区，也让它在白卡上"坐得住" */
.qr-plate {
  display: inline-block; padding: 13px; line-height: 0;
  background: var(--paper); border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.qr-plate svg { display: block; width: 168px; height: 168px; }
.qr-cap { margin: 0; font-size: 13px; color: var(--ink-3); }

/* 二维码悬停浮层（桌面）：统一的全局浮层，由 app.js 定位到触发按钮旁边 ——
   菜单里的「二维码」、我发过的、取件页都用同一套，桌面端一律不再弹窗。
   触屏没有悬停，仍走 showQr 弹窗。 */
.qr-flyout {
  position: fixed; z-index: 60; padding: 10px;
  background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-2);
  pointer-events: none;               /* 纯展示：绝不吃掉点击、挡住下面的菜单 */
  opacity: 0; transform: scale(.96);
  transition: opacity .14s ease, transform .18s cubic-bezier(0.23, 1, 0.32, 1);
}
.qr-flyout.show { opacity: 1; transform: none; }
.qr-flyout .qr-plate { padding: 10px; border-radius: 14px; }
.qr-flyout .qr-plate svg { width: 148px; height: 148px; }
.qr-flyout .qr-cap { display: block; margin-top: 9px; text-align: center; font-size: 12.5px; }

/* 「···」的悬停提示：让按钮自己说明里面有什么（原生 title 有约 1s 延迟，太慢） */
.mi-more-btn { position: relative; }
.mi-more-btn::after {
  content: attr(data-tip);
  position: absolute; right: 0; bottom: calc(100% + 8px);
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  background: rgba(29, 29, 31, .93); color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0;
  opacity: 0; pointer-events: none; transform: translateY(3px);
  transition: opacity .14s ease, transform .16s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 50;
}
.mi-more.open .mi-more-btn::after { opacity: 0 !important; }   /* 菜单已展开就不必再提示 */
@media (hover: hover) and (pointer: fine) {
  .mi-more-btn:hover::after { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .dl-flip { margin-top: 28px; }
  .dl-face { padding: 22px 18px; }
  .qr-plate svg { width: 156px; height: 156px; }
}

/* 取件页·文本（文档式版式 v7）—— 一张卡承载全部：
   左对齐的轻量身份行 → 内嵌内容井（复制贴在内容右上角）→ 两个安静的文字链接。
   三条原则来自顶级分享/收据页的做法：
   ① 白卡里不再套白卡 —— 内容井改用比纸面略深的填充 + 发丝线（inset），层级立刻干净；
   ② 强调色只留给「复制」这一个动作 —— 身份行用中性灰，内容文字是全页对比度最高的一层；
   ③ 动作贴着它的对象 —— 复制按钮在内容井表头，长文滚动时始终可见。 */
.dl-doc-h {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: left; margin: 0 0 16px;   /* 标题 + 复制按钮同一行：动作贴着它要作用的内容 */
}
.dl-doc-info { min-width: 0; }
.dl-doc-t {
  display: flex; align-items: center; gap: 7px;
  margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--ink);
}
.dl-doc-t svg { flex: none; color: var(--ink-3); }
.dl-doc-m { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.dl-doc-m .sep { margin: 0 8px; }

/* 内容井：浅灰内嵌面 + 发丝线，长文在里面自己滚 —— 不再白卡套白卡 */
.tv {
  text-align: left; overflow: hidden;
  border-radius: var(--r); background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.tv-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px; border: none; border-radius: 980px;   /* 约 31px 高：指尖够用，又不把标题行撑厚 */
  background: rgba(0, 113, 227, .08); color: var(--acc);
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.45; cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .12s ease-out;
}
.tv-copy:active { transform: scale(.97); }
.tv-copy.copied { background: rgba(29, 128, 73, .12); color: var(--ok); }

.textview {
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  margin: 0; padding: 18px 20px;
  max-height: 440px; overflow: auto;
  color: var(--ink); text-align: left;
  font: 14px/1.7 var(--mono);
  /* 滚动渐隐（纯 CSS，无需 JS）：两层随内容滚动的遮罩 + 两层钉在边缘的投影，
     长文一看就知道还能往下滚，也不必让滚动条常驻 */
  background:
    linear-gradient(var(--paper-2) 30%, rgba(251,251,253,0)) top    / 100% 26px no-repeat local,
    linear-gradient(rgba(251,251,253,0), var(--paper-2) 70%) bottom / 100% 26px no-repeat local,
    radial-gradient(farthest-side at 50% 0,    rgba(0,0,0,.055), transparent) top    / 100% 8px no-repeat,
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.055), transparent) bottom / 100% 8px no-repeat;
  background-color: var(--paper-2);
  scrollbar-width: thin;
}
.textview--prose { font-family: inherit; font-size: 15px; line-height: 1.8; }  /* 中文正文改回正文字体 */

.dl-doc-pk { display: flex; align-items: center; gap: 9px; margin: 16px 0 0; font-size: 12.5px; color: var(--ink-3); }
.dl-doc-pk code { font-size: 13.5px; font-weight: 600; letter-spacing: .16em; color: var(--ink); }
.dl-doc-f { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.dl-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--ink-2);
  transition: color .16s ease;
}
.dl-link svg { flex: none; color: var(--ink-3); }

/* ============ 表格 ============ */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
th:last-child, td:last-child { padding-right: 0; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { white-space: nowrap; }

/* 宽表格横向滚动收纳在容器内，页面不再被撑出横向溢出（触屏可滑） */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.files-table { font-variant-numeric: tabular-nums; }
.files-table .c-check { width: 32px; padding-right: 10px; }
.files-table .c-check input { width: 16px; height: 16px; margin: 0; }
.file-name { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.token-sub { display: block; width: max-content; margin-top: 3px; padding: 0; background: transparent; color: var(--ink-3); font-size: 11px; }
.file-editor-row > td { padding: 0 0 14px; background: transparent; }
.file-editor {
  margin: 0 0 8px; padding: 22px 24px; border-radius: 14px;
  background: var(--fill); box-shadow: inset 0 0 0 1px rgba(0,0,0,.035);
}
.editor-head, .editor-actions, .editor-meta { display: flex; align-items: center; flex-wrap: wrap; }
.editor-head { justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.editor-head > div { display: flex; flex-direction: column; }
.editor-head span, .field-help { color: var(--ink-3); font-size: 12px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; }
.editor-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 16px; }
.editor-grid label { margin: 12px 0 4px; }
.editor-grid [name="pass"] { margin-top: 8px; }
.editor-meta { gap: 8px 20px; margin: 16px 0; color: var(--ink-2); font-size: 12.5px; }
.editor-actions { gap: 8px; }
.files-heading { justify-content: space-between; align-items: center; }
.files-heading > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.files-heading h2 { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--fill); }
.segmented a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.segmented a.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.filterbar { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(120px, .7fr)) auto auto; gap: 8px; margin: 20px 0 16px; }
.filterbar label { margin: 0; }
.filterbar input, .filterbar select { height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 13.5px; }
.filterbar .btn { height: 40px; padding: 8px 16px; font-size: 13.5px; }
.bulkbar { position: sticky; top: calc(120px + env(safe-area-inset-top, 0px)); z-index: 11; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 12px 10px 16px; border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-2); backdrop-filter: blur(18px) saturate(160%); }
.bulkbar[hidden] { display: none; }
.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); text-align: center; }
.empty-state span { color: var(--ink-3); font-size: 13.5px; }

@media (min-width: 721px) {
  .files-table { min-width: 1120px; }
}
@media (max-width: 1100px) {
  .admin-page .wrap { padding-left: 24px; padding-right: 24px; }
  .admin-page .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(120px, .6fr)) auto; }
  .filterbar select:nth-of-type(3), .filterbar select:nth-of-type(4) { display: none; }
  .editor-grid { grid-template-columns: 1fr 1fr; }
}
/* 手机：文件表改成卡片式 —— 每行自成一张卡，元信息换行分区，操作按钮始终在
   首行可见。原先靠「隐藏次要列 + 横向滑动」，窄屏仍会溢出、按钮滑不到。 */
@media (max-width: 720px) {
  .table-wrap { overflow-x: visible; }
  .files-table { display: block; font-size: 13px; }
  .files-table tbody { display: block; }

  /* 表头只保留「全选」，其余列名由各行自带的标签承担 */
  .files-table thead { display: block; }
  .files-table thead tr { display: flex; align-items: center; }
  .files-table thead th { display: none; }
  .files-table thead th.c-check { display: flex; align-items: center; gap: 8px; width: auto; padding: 0 0 10px; }
  .files-table thead th.c-check::after { content: "全选本页"; color: var(--ink-2); font-size: 12.5px; font-weight: 400; }

  .files-table tr { display: block; }
  .files-table tr.file-row {
    display: flex; flex-wrap: wrap; align-items: center;
    column-gap: 10px; row-gap: 6px; padding: 14px 2px;
    border-top: 1px solid var(--rule);
  }
  /* 空满宽 flex 项：在「名称 / 操作」之后强制换行，把元信息压到第二行起 */
  .files-table tr.file-row::before { content: ""; order: 4; flex-basis: 100%; height: 0; }
  .files-table .file-row > td { display: block; min-width: 0; padding: 0; border: 0; }

  .files-table .c-check { order: 1; flex: none; width: auto; padding: 0; }
  .files-table .c-name { order: 2; flex: 1 1 auto; }
  .files-table .c-name .file-name { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .files-table .c-name .token-sub { width: auto; overflow-wrap: anywhere; }
  .files-table .row-actions { order: 3; flex: none; margin-left: auto; white-space: nowrap; }

  .files-table .c-type, .files-table .c-size, .files-table .c-owner,
  .files-table .c-store, .files-table .c-time, .files-table .c-dl,
  .files-table .c-code, .files-table .c-pass, .files-table .c-exp {
    order: 5; flex: 0 0 auto; color: var(--ink-2); font-size: 12.5px;
  }
  .files-table .c-size::before  { content: "大小 "; }
  .files-table .c-owner::before { content: "上传者 "; }
  .files-table .c-store::before { content: "存储 "; }
  .files-table .c-time::before  { content: "创建 "; }
  .files-table .c-dl::before    { content: "下载 "; }
  .files-table .c-code::before  { content: "快传码 "; }
  .files-table .c-pass::before  { content: "保护 "; }
  .files-table .c-exp::before   { content: "到期 "; }

  .files-table td code { padding: 3px 8px; }
  .files-table td.c-time { white-space: nowrap; }   /* 时间竖排折行很难看 */

  .files-table .file-editor-row > td { display: block; }
}
.row-actions .link, .row-actions .btn { margin-right: 8px; }

/* ============ 表单 ============ */
/* 复选框/单选框不能用文本框那套内边距，否则控件被撑高、与文字无法竖直居中 */
input:where(:not([type="checkbox"], [type="radio"])), select {
  padding: 11px 14px; border: none; border-radius: 10px; font-size: 15px;
  width: 100%; background: var(--fill); color: var(--ink); font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--acc); outline-offset: -2px; }
label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 16px 0; }
label input, label select { margin-top: 7px; }
label.inline { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink); }
label.inline input { width: auto; margin: 0; flex: none; accent-color: var(--acc); }
input.mini { width: 96px; padding: 8px 10px; font-size: 13.5px; }
.formrow { display: flex; gap: 16px; flex-wrap: wrap; }
.formrow label { flex: 1 1 180px; }

/* ============ 卡片 / 统计 ============ */
.card, .panel {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 26px 28px; margin-bottom: 20px;
  box-shadow: var(--shadow-1);
}
.card.narrow2 { max-width: 660px; }
/* v5：窄面板宽度与首页容器(640)对齐，避免跨页切换时宽度跳变 */
.panel.narrow { max-width: 640px; margin: 44px auto 20px; }
.panel-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-h h2, .panel-h h3 { margin: 0; font-size: 16px; font-weight: 600; }

.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--paper); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-1); }
.stat .num { font-size: 27px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.stat .sub { color: var(--ink-3); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ============ 分页 ============ */
.pager { margin-top: 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); background: var(--fill); }
.pager a.on { background: var(--acc); color: #fff; }

/* ============ 标记 / 提示 ============ */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 980px; font-size: 12px;
  background: var(--fill); color: var(--ink-2); font-weight: 500;
}
.badge.green { background: #e3f5e9; color: var(--ok); }
.badge.red { background: #ffe5e5; color: var(--bad); }
.badge.gray { background: var(--fill); color: var(--ink-3); }

.checks { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.check { padding: 4px 12px; border-radius: 980px; font-size: 13px; background: var(--fill); color: var(--ink-2); }
.check.ok { background: #e3f5e9; color: var(--ok); }
.check.bad { background: #ffe5e5; color: var(--bad); }

.notice { background: var(--fill); border-radius: var(--r); padding: 16px 18px; font-size: 14.5px; color: var(--ink-2); }
.notice.bad { background: #ffe5e5; color: #8a1f1f; }
.notice.ok  { background: #e3f5e9; color: #14663a; }

.chart { width: 100%; height: auto; }

/* ============ 后端卡 ============ */
.backend-box { background: var(--paper-2); border-radius: var(--r); padding: 18px 20px; margin-bottom: 12px; }
.backend-box.active { background: #f0f7ff; box-shadow: inset 0 0 0 2px var(--acc); }
.be-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.be-head b { font-size: 15px; font-weight: 600; }
.be-fields { margin-top: 6px; }

/* ============ 子分区 ============ */
.subsec { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule); }
.subsec h3 { font-size: 13.5px; color: var(--ink-2); margin: 0 0 4px; font-weight: 600; }

/* ============ Toast ============ */
#toast {
  position: fixed; left: 50%; bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(14px);   /* 固定元素让开 Home 指示条 */
  background: rgba(29,29,31,.94); color: #fff; padding: 12px 24px;
  border-radius: 980px; font-size: 14.5px;
  opacity: 0; pointer-events: none; z-index: 99; max-width: 84vw;
  transition: opacity .24s ease-out, transform .24s cubic-bezier(0.23,1,0.32,1);
  backdrop-filter: blur(10px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: rgba(215,0,21,.95); }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .topbar { padding: 0 18px; height: 52px; }
  .wrap { padding: 0 18px 56px; }
  .admin-page .wrap { padding: 18px 14px 56px; }
  .admin-page nav.tabs { top: calc(58px + env(safe-area-inset-top, 0px)); width: 100%; flex-wrap: nowrap; }
  .admin-page .panel { padding: 20px 16px; }
  .hero { padding: 42px 0 26px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .dropzone { padding: 44px 20px; }
  .dz-text { font-size: 17px; }
  .stage.quiet { padding: 18px; }
  .card, .panel { padding: 20px 18px; }
  .panel.narrow { margin-top: 28px; }
  nav.tabs { gap: 2px; overflow-x: auto; }
  .tab { font-size: 13.5px; white-space: nowrap; padding: 8px 13px; }
  .mine-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .mi-actions { width: 100%; flex-wrap: wrap; }   /* v5：移动端 4 个按钮允许换行，避免贴边 */
  .rc-row { align-items: stretch; }
  .rc-input { min-width: 0; width: 100%; }
  .passrow { max-width: none; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .filterbar { display: flex; flex-wrap: wrap; }
  .filterbar .search-field { flex: 1 0 100%; }
  .filterbar select { flex: 1 1 130px; }
  /* 管理分享表单：标签与输入框同行，纵向高度砍掉约一半 */
  .file-editor { padding: 16px 14px; }
  .editor-head { margin-bottom: 2px; }
  .editor-grid { grid-template-columns: 1fr; gap: 2px; }
  .editor-grid label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0; }
  .editor-grid label > input, .editor-grid label > select { flex: 1 1 150px; margin-top: 0; }
  .editor-grid [name="pass"] { margin-top: 0; }
  .editor-grid .field-help { flex: 1 1 100%; margin: 0; }
  .editor-meta { gap: 4px 14px; margin: 12px 0; }
  .editor-actions .btn { flex: 1 1 auto; }
  .files-heading { align-items: flex-start; }
  table { font-size: 13px; }
  th, td { padding: 10px 8px 10px 0; }
  .ellipsis { max-width: 120px; }
}

/* ------------------------------------------------------------ 模态框 */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .16s ease;
}
.modal.show { opacity: 1; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .32);
  backdrop-filter: saturate(160%) blur(6px);
  -webkit-backdrop-filter: saturate(160%) blur(6px);
}
.modal-panel {
  position: relative;
  width: 340px; max-width: 100%;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
  padding: 22px 22px 16px;
  transform: translateY(8px) scale(.985);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1);
}
.modal.show .modal-panel { transform: none; }
.modal-title { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-desc { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.modal-body { margin-top: 14px; }
.modal-input {
  width: 100%; padding: 10px 12px;
  border: none; border-radius: var(--r-sm);
  background: var(--fill);
  font: inherit; color: var(--ink);
}
.modal-msg { margin: 8px 0 0; font-size: 13px; color: var(--bad); min-height: 0; }
.modal-msg:empty { display: none; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px;
}
.modal-panel.danger .modal-foot .btn.primary { background: var(--bad); }

/* ------------------------------------------------------------ 二维码 */
.qr-box {
  display: flex; justify-content: center;
  padding: 10px 0 2px;
}
.qr-box svg { display: block; border-radius: 10px; }
.qr-tip { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.qr-link { margin-top: 12px; }

/* ------------------------------------------------------------ 有效期胶囊（.xp）
   收起 = 小胶囊显示当前档位（参照首页取件胶囊的收放手感）；
   点击/hover 展开档位菜单即点即存；选「自定义…」右侧长出日期选择器。 */
.xp { position: relative; flex: 0 0 auto; }
.xp-face {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px 0 15px;
  border: 0; border-radius: 980px;
  background: var(--fill); color: var(--ink);
  font: inherit; font-size: 13.5px; cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .12s;
}
.xp-face:active { transform: scale(.97); }
.xp-val { font-weight: 500; }
.xp-chev { display: flex; color: var(--ink-3); transition: transform .22s; }
.xp-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: 248px; padding: 8px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--paper); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  transform-origin: top left;   /* 从触发胶囊的左上角起缩放，而非菜单自身中心 */
  opacity: 0; transform: translateY(-6px) scale(.97); visibility: hidden; pointer-events: none;
  transition: opacity .18s, transform .22s cubic-bezier(.34,.96,.6,.99), visibility 0s .22s;
}
.xp.open .xp-face { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--acc); }
.xp.open .xp-chev { transform: rotate(180deg); }
.xp.open .xp-menu {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .18s, transform .26s cubic-bezier(.34,.96,.6,.99), visibility 0s;
}
.xp-item {
  border: 0; border-radius: 9px; background: var(--fill); color: var(--ink);
  font: inherit; font-size: 13px; padding: 8px 2px; cursor: pointer;
  transition: background .15s, color .15s;
}
.xp-item.on { background: var(--acc); color: #fff; }
.xp-custom { grid-column: 1 / -1; background: transparent; box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-2); }
.xp-custom.on { background: var(--acc); color: #fff; box-shadow: none; }

/* 悬停展开仅限精确指针；触屏由点击开合（.open），避免点按后 :hover 粘连 */
@media (hover: hover) and (pointer: fine) {
  .xp:hover .xp-face { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--acc); }
  .xp:hover .xp-chev { transform: rotate(180deg); }
  .xp:hover .xp-menu {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: opacity .18s, transform .26s cubic-bezier(.34,.96,.6,.99), visibility 0s;
  }
  .xp-item:hover { background: var(--fill-2); }
  .xp-item.on:hover, .xp-custom.on:hover { background: var(--acc); }
}

.rc-label { display: inline-flex; align-items: center; gap: 6px; flex: none; }

/* 有效期行：胶囊 + 自定义日期 + 保存是一个不可拆控件组，窄屏换行整体移动 */
.exp-ctl { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
.rc-date {
  width: auto; min-width: 0; flex: 1 1 150px;
  padding: 7px 10px; border: none; border-radius: var(--r-sm);
  background: var(--fill); color: var(--ink); font: inherit; font-size: 13.5px;
}
.rc-exp .expinfo { flex: 1 1 110px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ 复制成功态 */
.btn.copied { background: rgba(29, 128, 73, .12); color: var(--ok); }

/* ------------------------------------------------------------ 备案号 */
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.foot .icp { color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------ 快传码取件（v6.1 起由 .pk 胶囊承担，旧卡片样式已移除） */

/* ============================================================
   模式切换：字即按钮，选中态靠色彩与下划线，不占额外行
   ============================================================ */
.modebar {
  display: flex; align-items: center; gap: 4px;
  margin: 0 0 14px;
}
.mtab {
  position: relative;
  border: 0; background: none; padding: 4px 2px 8px;
  font: inherit; font-size: 19px; font-weight: 600;
  color: var(--ink-3); cursor: pointer;
  letter-spacing: -.01em;
  transition: color .18s;
}
.mtab + .mtab { margin-left: 22px; }
.mtab.on { color: var(--ink); }
.mtab::after {                     /* 选中下划线：一条细线滑入，代替整个胶囊底 */
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--acc);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .28s cubic-bezier(.34,.96,.6,.99);
}
.mtab.on::after { transform: scaleX(1); }
.mtab:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 4px; }

/* ============================================================
   取件胶囊（v6.1）：一颗会横向生长的胶囊
   ------------------------------------------------------------
   收起：[🔑 我有快传码 +]                —— 44px 高的一行，几乎不存在
   展开：[ 快传码输入…            (🔑) ]  —— 横向长到整行，钥匙落位右端=提交
   要点：
   · 宽度过渡 px → 100%（浏览器按 calc 插值，全程平滑）
   · 两态内容交叉淡入淡出 + visibility 控制焦点序，收起时不被 Tab 命中
   · 提交键 mousedown preventDefault，防 input 先失焦导致胶囊收起吞掉点击
   ============================================================ */
.pk-wrap { margin: 0 0 18px; }
.pk {
  position: relative;
  display: flex; align-items: center;
  width: 188px; max-width: 100%;
  height: 44px;
  border-radius: 980px;
  background: var(--fill);
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;                        /* 宽度生长时裁掉内容，只露该露的 */
  transition:
    width .22s cubic-bezier(.34,.96,.6,.99),   /* 收回（exit）比展开快一拍 */
    transform .12s ease-out,
    background .25s, border-color .25s, box-shadow .25s;
}
.pk:not(.open):active { transform: scale(.98); }   /* 按下即回应，指尖不悬空 */
.pk.open {
  width: 100%;
  cursor: default;
  background: var(--card);
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(0,113,227,.10);
  transition:
    width .34s cubic-bezier(.34,.96,.6,.99),   /* 展开（enter）从容一点 */
    background .25s, border-color .25s, box-shadow .25s;
}

/* 收起态：图标 + 文案居左，加号钉在胶囊右端（展开的角标不该漂在中间） */
.pk-hint {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0 14px 0 16px;
  font: inherit; font-size: 15px; color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .18s, transform .18s, visibility 0s;
}
.pk-plus { margin-left: auto; display: flex; color: var(--ink-3); }
.pk.open .pk-hint {
  opacity: 0; transform: translateX(-8px);
  visibility: hidden;                      /* 焦点序里除名 */
  pointer-events: none;
  transition: opacity .18s, transform .18s, visibility 0s .18s;
}

/* 输入框：常驻布局（flex:1），收起时藏起来；展开即用 */
.pk-input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; outline: none; background: none;
  padding: 0 6px 0 18px;
  font: inherit; font-size: 16px; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0; visibility: hidden;
  transition: opacity .18s, visibility 0s;
}
.pk-input::placeholder { letter-spacing: normal; text-transform: none; color: var(--ink-3); }
.pk-input:focus { outline: none; }   /* 焦点指示由外层胶囊的描边+光圈承担，内圈不再重复 */
.pk.open .pk-input {
  opacity: 1; visibility: visible;
  transition: opacity .22s .14s, visibility 0s;   /* 立即可聚焦（focus 不依赖时序）；字等胶囊长出大半再淡入 */
}

/* 提交键：钥匙图标落位右端，由小放大出场（不从 0 出现，85% 起步配淡入） */
.pk-go {
  flex: none;
  position: relative;
  width: 34px; height: 34px; margin: 0 5px 0 0;
  border: 0; border-radius: 50%;
  background: var(--acc); color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
/* 触控热区扩到 50px：视觉仍是 34px 圆钮，手指不必精确落在图标上 */
.pk-go::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
  opacity: 0; transform: scale(.85);
  pointer-events: none;
  transition: opacity .16s, transform .12s ease-out, visibility 0s, background .18s;
}
.pk.open .pk-go {
  opacity: 1; transform: scale(1);
  pointer-events: auto;
  transition: opacity .2s .14s, transform .26s .14s cubic-bezier(.34,.96,.6,.99),
              background .18s, visibility 0s;
}
.pk.open .pk-go:active {           /* 按压反馈要快，且要压过上面的出场参数 */
  transform: scale(.92);
  transition: transform .1s ease-out;
}

/* 取件消息：默认空 = 0 高；报错时胶囊下出现一行小字 */
.pk-msg { margin: 8px 4px 0; font-size: 12.5px; min-height: 16px; color: var(--bad); }
.pk-msg:empty { margin: 0; min-height: 0; }

/* 主页面上传区/文本区：display:flex 会覆盖 hidden 的 display:none，显式兜住 */
#paneFile, #paneText { display: flex; flex-direction: column; }
#paneFile[hidden], #paneText[hidden] { display: none; }

/* 窄屏 */
@media (max-width: 620px) {
  .mtab { font-size: 18px; }
  .mtab + .mtab { margin-left: 18px; }
}

/* 结果卡片里的快传码已改成可点即复制的 .rc-chip（等宽 + 放开字距见上面的定义） */

/* ============ 悬停（仅精确指针）============
   触屏没有悬停，浏览器会在点按后把 :hover 粘在元素上直到点别处。
   全站悬停样式收进此门控；触屏的按压反馈由各元素的 :active 提供。 */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; }
  .brand:hover { text-decoration: none; }
  .topbar nav a:hover { color: var(--ink); text-decoration: none; }
  .btn:hover { background: var(--fill-2); text-decoration: none; }
  .btn.primary:hover { background: #0077ed; }
  .btn.danger:hover { background: #ffe5e5; }
  .tab:hover { color: var(--ink); text-decoration: none; }
  .dropzone:hover { box-shadow: var(--shadow-2); outline: none; transform: translateY(-1px); }
  .dropzone:hover .dz-icon { color: var(--acc); transform: translateY(-2px); }
  tr:hover td { background: #fafafa; }
  .pager a:hover { text-decoration: none; background: var(--fill-2); }
  .foot .icp:hover { color: var(--ink-2); }
  .mtab:hover { color: var(--ink-2); }
  .pk-hint:hover { color: var(--ink); }
  .pk-hint:hover svg { color: var(--acc); }
  .pk-go:hover { background: #0062c4; }
  .mi-more-btn:hover { background: var(--fill); color: var(--ink); }
  .mi-menu-item:hover { background: var(--fill); }
  .mi-menu-item.danger:hover { background: #ffe5e5; }
  .tv-copy:hover { background: rgba(0, 113, 227, .16); }
  .rc-chip:hover, .mi-code:hover { background: var(--fill-2); color: var(--ink); }
  .dl-link:hover { color: var(--acc); }
  .dl-link:hover svg { color: var(--acc); }
}

/* 动画敏感用户：位移/生长直接切换，不留运动（颜色淡入仍保留） */
@media (prefers-reduced-motion: reduce) {
  .pk, .pk.open, .pk-hint, .pk-input, .pk.open .pk-input, .pk-go, .pk.open .pk-go,
  .xp-face, .xp-chev, .xp-menu, .xp.open .xp-menu, .xp-item,
  .mtab::after, .btn, .dropzone, .dz-icon, .mi-menu, .mi-more.open .mi-menu, .tv-copy,
  .dl-flip-inner, .qr-flyout, .mi-more-btn::after, .rc-chip {
    transition-duration: .01ms;
  }
  .result-card { animation: rise-fade .2s ease-out; }   /* 位移换成纯淡入 */
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .bulkbar { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --ink-2: #4a4a4f; --ink-3: #626267; --rule: #b8b8bd; }
  .card, .panel, .stat, .topbar { box-shadow: inset 0 0 0 1px var(--rule); }
  .btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
}
