/* 图纸库 / 我的图纸 页面样式：浅色、信号渐变（靛蓝 → 蓝 → 青），背景是淡淡的电路走线纹理 */
:root {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --ink: #16203A;
  --ink-2: #2D3A55;
  --muted: #5E6B82;
  --faint: #8A95A8;
  --line: #E4E9F2;
  --line-2: #EEF1F7;
  --indigo: #4F46E5;
  --blue: #2563EB;
  --cyan: #06B6D4;
  --signal: linear-gradient(120deg, #4F46E5 0%, #2563EB 52%, #06B6D4 100%);
  --amber-ink: #9A5B00;
  --amber-bg: #FFF4DC;
  --green-ink: #067A55;
  --green-bg: #E3F6EE;
  --red-ink: #B42335;
  --red-bg: #FDECEE;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-panel: 0 1px 2px rgba(22, 32, 58, .04), 0 8px 28px -12px rgba(37, 52, 110, .16);
  --shadow-float: 0 2px 6px rgba(37, 52, 110, .06), 0 22px 48px -18px rgba(49, 46, 129, .32);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font: inherit; color: inherit; }
/* 宽度与全站一致：外框 1200px、左右 24px（手机 16px），内容区 = 1200 - 2×24 */
.container { width: min(1152px, 100% - 48px); margin-inline: auto; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { width: min(1120px, 100% - 40px); margin-inline: auto; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--line-2); color: var(--ink); }
.nav-link.is-active { color: var(--indigo); background: #EEF0FF; }
.account-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip .ic { width: 16px; height: 16px; }
.chip-credit { background: var(--amber-bg); border-color: #F7DFA6; color: var(--amber-ink); }
.chip-credit strong { font-weight: 700; font-size: 14.5px; }
.chip-valid { background: var(--green-bg); border-color: #BFE8D6; color: var(--green-ink); }
.chip-expired { color: var(--muted); }
.chip-warn { background: var(--red-bg); border-color: #F6C6CD; color: var(--red-ink); }
.chip-topup { background: var(--signal); border: 0; color: #fff; font-weight: 600; }
.chip-topup:hover { filter: brightness(1.06); }

/* ---------- 顶部大区块 ---------- */
.hero, .page-head { position: relative; overflow: hidden; background: linear-gradient(135deg, #EEF0FF 0%, #E6F0FF 45%, #E3F7FB 100%); border-bottom: 1px solid var(--line); }
.hero-traces {
  position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%234F46E5' stroke-opacity='.13' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 40h52l18 18h60l14-14h76'/%3E%3Cpath d='M30 220v-52l22-22v-40'/%3E%3Cpath d='M220 150h-40l-20 20h-44l-16-16H60'/%3E%3Cpath d='M150 0v30l18 18v46l-12 12'/%3E%3Cpath d='M92 220v-30l14-14h40'/%3E%3Ccircle cx='52' cy='106' r='4' fill='%23fff'/%3E%3Ccircle cx='156' cy='106' r='4' fill='%23fff'/%3E%3Ccircle cx='60' cy='154' r='4' fill='%23fff'/%3E%3Ccircle cx='146' cy='176' r='4' fill='%23fff'/%3E%3Ccircle cx='130' cy='58' r='3' fill='%23fff'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
}
.hero-traces-soft { opacity: .55; }
.hero-inner { position: relative; padding: 56px 0 40px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(28px, 4.2vw, 40px); line-height: 1.15; letter-spacing: -.02em; font-weight: 750; color: var(--ink); }
.hero-lead { margin: 12px auto 28px; max-width: 58ch; color: var(--muted); font-size: 16px; }

.searchbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto; padding: 8px 8px 8px 18px;
  background: var(--surface); border: 1px solid #DCE2F0; border-radius: 16px;
  box-shadow: var(--shadow-float);
}
.searchbar:focus-within { border-color: #B9C2F5; box-shadow: var(--shadow-float), 0 0 0 4px rgba(79, 70, 229, .12); }
.searchbar-ic { width: 22px; height: 22px; color: var(--indigo); }
.searchbar input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }
.searchbar input::placeholder { color: var(--faint); }
.searchbar input::-webkit-search-cancel-button { cursor: pointer; }

.search-opts { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--indigo); }
.lib-stats:empty { display: none; }
.lib-stats { padding-left: 18px; border-left: 1px solid rgba(79, 70, 229, .18); }
.kind-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.kind-switch button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.kind-switch button .ic { width: 16px; height: 16px; }
.kind-switch button:hover { color: var(--ink); }
.kind-switch button[aria-checked="true"] { background: #EEF0FF; color: var(--indigo); }
.kind-switch button:disabled { opacity: .4; cursor: default; }
.kind-n { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--line-2); color: var(--muted); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.kind-switch button[aria-checked="true"] .kind-n { background: #fff; color: var(--indigo); }
.price-note { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.price-note .ic { width: 16px; height: 16px; color: var(--indigo); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, filter .15s; }
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.price-note .btn { margin-left: 8px; }
.file-act, .mine-act, .mine-card-act, .recent-act { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btn-primary { background: var(--signal); color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .6); }
.btn-soft { background: #EEF0FF; color: var(--indigo); }
.btn-soft:hover { background: #E3E6FF; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #CBD3E3; background: #FAFBFE; }
.btn[disabled], .btn.is-disabled { background: var(--line-2); color: var(--faint); box-shadow: none; cursor: not-allowed; filter: none; border-color: transparent; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn .ic { width: 17px; height: 17px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 主体 ---------- */
.page-main { padding: 28px 0 64px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 4px 2px 14px; }
.results-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

/* 文件列表：一整块面板，行与行之间用细线分隔 */
.file-list, .mine-list { list-style: none; margin: 0; padding: 0; }
.file-list:not(:empty) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); overflow: hidden; }
.file-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.file-row:first-child { border-top: 0; }
.file-row:hover { background: #FAFBFF; }

.tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; align-content: center; gap: 1px; }
.tile .ic { width: 20px; height: 20px; }
.tile span { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.tile { position: relative; }
.tile-board { background: #EEF0FF; color: var(--indigo); }
.tile-schematic { background: #FFEEF1; color: #D0243F; }
.tile-silk { background: #FDEFFB; color: #A21CAF; }
.tile-bios { background: #E6F6EF; color: #0F7B55; }
.tile-image { background: #E4F4FC; color: #0B78A8; }
.tile-other { background: #EEF2F6; color: #4B5870; }
.tile-arc { position: absolute; right: -5px; bottom: -5px; padding: 1px 4px; border-radius: 5px; background: #fff; border: 1px solid var(--line);
  color: var(--muted); font: 700 8.5px/1.3 var(--font); font-style: normal; letter-spacing: .02em; }

/* 分类小标签（结果里的第二行） */
.cat { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.cat-board { background: #EEF0FF; color: var(--indigo); }
.cat-schematic { background: #FFEEF1; color: #C0233C; }
.cat-silk { background: #FDEFFB; color: #9D1BA8; }
.cat-bios { background: #E6F6EF; color: #0F7B55; }
.cat-image { background: #E4F4FC; color: #0B78A8; }
.cat-other { background: #EEF2F6; color: #4B5870; }
.cat-task { background: linear-gradient(120deg, #EEF0FF, #E4F7FB); color: #3730A3; }
mark { background: #FFE58F; color: inherit; border-radius: 3px; padding: 0 1px; }
.file-row.is-owned .file-name { color: var(--ink-2); }

.file-meta { min-width: 0; }
.file-name { font-weight: 600; color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; color: var(--faint); font-size: 13px; }
.file-sub span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.file-sub .ic { width: 14px; height: 14px; }
.file-sub .dir { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.file-state:empty { display: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge .ic { width: 14px; height: 14px; }
.badge-owned { background: var(--green-bg); color: var(--green-ink); }
/* 2026-09：使用期限 / 缺失文件 */
.badge-missing, .badge-expired { background: var(--red-bg); color: var(--red-ink); }
.badge-until { background: var(--amber-bg); color: var(--amber-ink); }
.badge-member { background: #EEF0FF; color: var(--indigo); }
.file-sub .badge { height: 22px; padding: 0 8px; font-size: 12px; }
.badge .ic { width: 14px; height: 14px; }
.badge-free { background: #E4F7FB; color: #0A7890; }
.badge-cost { background: var(--amber-bg); color: var(--amber-ink); }
.badge-na { background: var(--line-2); color: var(--faint); }

/* 加载中占位 */
.skeleton .tile, .skeleton .sk { background: linear-gradient(90deg, #EEF1F7 0%, #F7F9FC 50%, #EEF1F7 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton .sk { height: 12px; border-radius: 6px; }
.skeleton .sk + .sk { margin-top: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state { display: grid; justify-items: center; gap: 14px; padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-state p { margin: 0; max-width: 46ch; }
.empty-art { width: 132px; height: auto; }
/* 二十三期：手机上已经有“最近购买”或随机推荐时，不再显示“输入型号…开始搜索”的大块占位（和搜索框提示重复，还占一整屏） */
@media (max-width: 640px) {
  .page-main:has(#recent:not([hidden])) .empty-state.is-start,
  .page-main:has(#randomBox:not([hidden])) .empty-state.is-start { display: none; }
}
.more-wrap { display: flex; justify-content: center; margin-top: 20px; }

/* 状态提示（封禁 / 审核 / 未登录 / 出错） */
.notice { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; margin-bottom: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-panel); }
.notice-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.notice-ic .ic { width: 22px; height: 22px; }
.notice h3 { margin: 2px 0 4px; font-size: 16px; }
.notice p { margin: 0; color: var(--muted); }
.notice .btn { margin-top: 12px; }
.notice-audit .notice-ic { background: var(--amber-bg); color: var(--amber-ink); }
.notice-blocked .notice-ic, .notice-error .notice-ic { background: var(--red-bg); color: var(--red-ink); }
.notice-login .notice-ic { background: #EEF0FF; color: var(--indigo); }
.notice-inline { box-shadow: none; background: #FFFBF0; border-color: #F7E3B5; }

/* ---------- 我的图纸 ---------- */
.page-head-inner { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 40px 0 28px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 32px); letter-spacing: -.02em; font-weight: 750; }
.page-sub { margin: 6px 0 0; color: var(--muted); }
.filter-box { display: flex; align-items: center; gap: 8px; width: min(340px, 100%); height: 42px; padding: 0 14px; background: var(--surface); border: 1px solid #DCE2F0; border-radius: 12px; box-shadow: var(--shadow-panel); color: var(--faint); }
.filter-box:focus-within { border-color: #B9C2F5; box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); color: var(--indigo); }
.filter-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }

.mine-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); overflow: hidden; }
.mine-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 230px 170px; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.mine-list .mine-row:hover { background: #FAFBFF; }
.mine-row-head { border-top: 0; padding-block: 11px; background: #F8F9FD; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.mine-file { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mine-time { color: var(--muted); font-size: 13.5px; }
.mine-time small { display: block; color: var(--faint); font-size: 12px; }
.mine-act { display: flex; justify-content: flex-end; }

.pw { display: flex; align-items: center; gap: 2px; min-width: 0; height: 36px; padding: 0 4px 0 10px; border-radius: 9px; background: #F6F7FB; border: 1px solid var(--line-2); }
.pw > .ic { width: 15px; height: 15px; color: var(--faint); margin-right: 6px; }
.pw code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13.5px/1 ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace; color: var(--ink-2); letter-spacing: .02em; }
.pw.is-masked code { letter-spacing: .18em; color: var(--faint); }
.pw-none { color: var(--faint); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.pw-none .ic { width: 15px; height: 15px; }

/* ---------- 对话框 ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(22, 32, 58, .36); backdrop-filter: blur(3px); animation: fade .15s ease-out; }
.modal { width: min(440px, 100%); background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(22, 32, 58, .45); overflow: hidden; animation: pop .18s ease-out; }
.modal-top { position: relative; padding: 26px 26px 0; }
.modal-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; }
.modal-badge .ic { width: 24px; height: 24px; }
.modal-badge.tone-primary { background: #EEF0FF; color: var(--indigo); }
.modal-badge.tone-success { background: var(--green-bg); color: var(--green-ink); }
.modal-badge.tone-warn { background: var(--amber-bg); color: var(--amber-ink); }
.modal-badge.tone-danger { background: var(--red-bg); color: var(--red-ink); }
.modal h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-body { padding: 8px 26px 4px; color: var(--muted); white-space: pre-line; }
.modal-body .file-name { margin-top: 2px; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 20px 26px 24px; }
.modal-hint { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.task-files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; white-space: normal; }
.task-file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #F6F7FB; }
.task-file .tile { width: 40px; height: 40px; border-radius: 10px; }
.task-file .file-name { font-size: 13.5px; }
.task-file .file-sub span { gap: 4px; }
.ledger { margin: 16px 0 4px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.ledger div { padding: 10px 6px; border-radius: 12px; background: #F6F7FB; }
.ledger b { display: block; font-size: 22px; color: var(--ink); line-height: 1.2; }
.ledger small { color: var(--faint); font-size: 12px; }
.ledger .is-cost { background: var(--amber-bg); }
.ledger .is-cost b { color: var(--amber-ink); }
.ledger i { font-style: normal; color: var(--faint); }
.modal .pw { margin-top: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; z-index: 130; transform: translateX(-50%); display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(22, 32, 58, .5); animation: pop .18s ease-out; }
.toast .ic { width: 17px; height: 17px; color: #6EE7C8; }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .topbar-inner { gap: 12px; height: auto; min-height: 60px; flex-wrap: wrap; padding: 10px 0; }
  .brand span { display: none; }
  .nav-link span { display: none; }
  .nav-link { padding: 8px 10px; }
  .mine-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mine-row-head { display: none; }
  .mine-time { grid-column: 1; padding-left: 62px; margin-top: -8px; }
  .mine-pw { grid-column: 1 / -1; }
  .mine-act { grid-column: 2; grid-row: 1; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  /* 十五期 手机：标题小一点，不要说明文字，搜索框往上提 */
  .hero-inner { padding: 20px 0 20px; }
  .hero h1 { font-size: 24px; margin-bottom: 14px; }
  .hero-lead { display: none; }
  .searchbar { padding-left: 14px; }
  .searchbar .btn { padding: 0 14px; }
  /* 窄屏：按钮放到文件名下面，文件名占满整行宽度 */
  .file-row { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; gap: 4px 12px; align-items: start; }
  .file-row .tile { grid-row: 1 / span 2; }
  .file-row .file-state { display: none; }
  .file-row .file-act { grid-column: 2; justify-self: start; margin-top: 8px; }
  .file-row .file-act .btn { height: 34px; padding: 0 12px; font-size: 13.5px; }
  .tile { width: 44px; height: 44px; }
  .page-head-inner { flex-direction: column; align-items: stretch; }
  .filter-box { width: 100%; }
  .chip-valid span, .chip-expired span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 最近购买 ---------- */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 2px 12px; font-size: 15px; font-weight: 650; color: var(--ink-2); }
.section-title a, .section-title span { font-size: 13px; font-weight: 500; color: var(--faint); }
.section-title a { margin-left: auto; color: var(--blue); }
.recent { margin-bottom: 28px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.recent-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-panel); }
.recent-meta { min-width: 0; }
.recent-time { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.recent-act { grid-column: 1 / -1; justify-content: flex-start; }
.recent-act:empty { display: none; }

/* ---------- 我的图纸：卡片 ---------- */
.head-tools { display: flex; align-items: center; gap: 12px; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid #DCE2F0; box-shadow: var(--shadow-panel); }
.view-toggle button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; }
.view-toggle button[aria-checked="true"] { background: #EEF0FF; color: var(--indigo); }
.mine-group + .mine-group { margin-top: 26px; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.mine-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-panel); min-width: 0; }
.mine-card:hover { border-color: #D3DAEA; }
.mine-card-top { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; }
.mine-card-pw .pw-none { height: 36px; }
.mine-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }
.mine-card-time { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.mine-card-time .ic { width: 15px; height: 15px; color: var(--faint); }
.mine-card-time small { color: var(--faint); }
.mine-card.skeleton { min-height: 170px; gap: 14px; }
.mine-card.skeleton .tile { width: 48px; height: 48px; }

/* ---------- 图片预览 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; background: rgba(12, 18, 36, .88); animation: fade .15s ease-out; }
.lightbox-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; }
.lightbox-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-bar .icon-btn { color: #cbd5e1; }
.lightbox-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lightbox-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 8px 16px 20px; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; background: #fff; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lightbox-stage img.is-zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox-err { color: #cbd5e1; }

@media (max-width: 640px) {
  .recent-list, .mine-grid { grid-template-columns: 1fr; }
  .head-tools { width: 100%; }
  .head-tools .filter-box { flex: 1; }
  .lib-stats { padding-left: 0; border-left: 0; width: 100%; text-align: center; }
  .kind-switch { width: 100%; }
}

/* ---------- PDF 芯片搜索 ---------- */
.chip-box { margin-top: 32px; }
.chip-lead { margin: -4px 2px 12px; color: var(--muted); font-size: 13.5px; }
/* 随机推荐（2026-09 五期）：关键字为空或太短时显示 */
.random-box { margin-bottom: 28px; }
.random-box .section-title { align-items: center; }
.random-box .section-title .btn { margin-left: auto; }
.random-hint { margin: -4px 2px 12px; color: var(--muted); font-size: 13.5px; }
.chip-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); overflow: hidden; }
.chip-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.chip-item:first-child { border-top: 0; }
.chip-main { min-width: 0; }
.chip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-head b { font-weight: 650; }
.chip-date { color: var(--faint); font-size: 12.5px; }
.chip-name { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-name .ic { width: 14px; height: 14px; flex: none; color: var(--faint); }
.chip-snip { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #F8F9FD; color: var(--ink-2); font: 12.5px/1.5 ui-monospace, "SF Mono", Consolas, monospace; overflow-wrap: anywhere; }
@media (max-width: 640px) { .chip-item { grid-template-columns: 1fr; } .chip-item .btn { justify-self: start; } }

/* ---------- 访客模式（2026-09-28，未登录直接打开 library.php） ---------- */
.guest-bar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.guest-bar-inner { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guest-brand { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); font-weight: 700; white-space: nowrap; }
.guest-brand span { overflow: hidden; text-overflow: ellipsis; }
.guest-brand img { border-radius: 7px; flex: none; }
.guest-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.guest-lang { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; padding: 0 8px; }
.guest-note { flex-wrap: wrap; }
.guest-more { margin: 18px auto 0; max-width: 640px; padding: 14px 16px; border: 1px dashed #C7CEF5; border-radius: var(--radius);
  background: #F5F6FF; color: var(--ink-2); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; text-align: center; }
@media (max-width: 560px) {
  .guest-brand span { display: none; }
  .guest-bar-inner { height: 52px; }
}
/* ---------- 十七期 手机（≤ 767px）：一行吸顶头部（搜索框 | 选项按钮）+ 底部弹出的“搜索选项”面板 ----------
   标题不显示（外壳底部标签已经写着“资源引擎”）；文件 / 内容搜索、整词匹配、价格说明由 library.js 挪进 #libSheet。 */
.lib-mbtn, .lib-sheet, .lib-mask { display: none; }
@media (max-width: 767px) {
  .hero { position: sticky; top: 0; z-index: 30; overflow: visible; }
  .hero-traces { display: none; }
  .hero-inner { padding: 8px 0; }
  .hero h1 { display: none; }
  #searchArea { display: flex; align-items: center; gap: 8px; }
  #searchArea .searchbar { flex: 1; min-width: 0; margin: 0; padding: 4px 4px 4px 12px; border-radius: 12px; box-shadow: none; }
  #searchArea .searchbar input { height: 36px; font-size: 16px; }
  #searchArea .searchbar .btn { height: 36px; padding: 0 12px; font-size: 14px; }
  .lib-mbtn { flex: none; position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid #DCE2F0; border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; }
  .lib-mbtn .ic { width: 20px; height: 20px; }
  .lib-mbtn.is-dot, .lib-mbtn[aria-expanded="true"] { color: var(--indigo); border-color: #C7D2FE; }
  .lib-mbtn.is-dot::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--indigo); box-shadow: 0 0 0 2px var(--surface); }
  .lib-sheet.is-open { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; max-height: 80vh; overflow-y: auto;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--surface);
    box-shadow: 0 -16px 40px -12px rgba(22, 32, 58, .3); text-align: left; animation: pop .2s ease-out; }
  .lib-mask.is-open { display: block; position: fixed; inset: 0; z-index: 119; background: rgba(15, 23, 42, .35); }
  .lib-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 650; color: var(--ink); }
  .lib-sheet-head button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--line-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
  .lib-sheet-label { display: block; margin: 4px 0 6px; font-size: 12.5px; color: var(--faint); }
  .lib-sheet .kind-switch { display: flex; }
  .lib-sheet .kind-switch button { flex: 1; justify-content: center; height: 40px; }
  .lib-sheet .search-opts { justify-content: flex-start; margin-top: 14px; }
  .lib-sheet .price-note { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
}
