/* ==================================================================
   云仓 · 网盘资源索引 —— 共享设计系统
   零依赖 / 零构建，直接部署到 Cloudflare Pages
   ================================================================== */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #FBF9F5;
  --surface-3: #F3EFE8;
  --line: #E8E2D7;
  --line-strong: #D9D0C1;
  --ink: #24211C;
  --ink-2: #575249;
  --ink-3: #8C867A;
  --accent: #C9603C;
  --accent-dark: #A94C2C;
  --accent-soft: #F8EBE4;
  --green: #5B7A5E;
  --green-soft: #EAF0E6;
  --amber: #A97A29;
  --amber-soft: #F8F0DE;
  --red: #B5483C;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(60, 45, 25, .05);
  --shadow: 0 1px 2px rgba(60, 45, 25, .04), 0 14px 34px -20px rgba(60, 45, 25, .34);
  --shadow-lg: 0 24px 70px -28px rgba(60, 45, 25, .38);
  --font: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background: radial-gradient(900px 380px at 78% -8%, rgba(201, 96, 60, .075), transparent 65%);
  z-index: 0;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

::selection { background: #EAD3C5; color: #3B2419; }

.wrap { width: min(1280px, 100% - 48px); margin-inline: auto; position: relative; z-index: 1; }
.wrap-narrow { width: min(1080px, 100% - 48px); margin-inline: auto; position: relative; z-index: 1; }
main { flex: 1; }

/* ----------------------------- 提示条 ------------------------------ */
.mode-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--amber-soft);
  border-bottom: 1px solid #EBDCBB;
  color: #7A5B1E;
  font-size: 12.5px;
  text-align: center;
  justify-content: center;
}
.mode-bar.is-on { display: flex; flex-wrap: wrap; }
.mode-bar strong { font-weight: 650; }
.mode-reset {
  flex: 0 0 auto;
  padding: 3px 10px;
  border: 1px solid rgba(122, 91, 30, .35);
  border-radius: 6px;
  background: rgba(255, 255, 255, .45);
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
}
.mode-reset:hover { background: rgba(255, 255, 255, .9); border-color: rgba(122, 91, 30, .7); }

/* ------------------------------ 导航 ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 240, .82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(216, 207, 192, .65);
}
.nav {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: -.4px; font-weight: 700; }
.brand-text small { font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.4px; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.is-active { background: var(--ink); color: #fff; font-weight: 600; }
.nav-spacer { flex: 1; }
.nav-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.nav-cta { display: inline-flex; }
.nav-toggle { display: none; }

/* ------------------------------ 按钮 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1px;
  transition: transform .18s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -12px rgba(169, 76, 44, .9); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #3C3830; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-plain { background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn-plain:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: transparent; color: var(--red); border-color: #EAD3CE; }
.btn-danger:hover { background: #FBEFEC; }
.btn-sm { min-height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 15px; }

/* ------------------------------ 首屏 ------------------------------- */
.hero { padding: 58px 0 42px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 32px; }
.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #E6D4C8;
  background: rgba(255, 255, 255, .7);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
}
.eyebrow .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: breathe 2.6s ease-in-out infinite; }
.hero h1 {
  margin: 22px 0 16px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.1;
  letter-spacing: -2.6px;
  font-weight: 720;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede { margin: 0; max-width: 52ch; font-size: 16.5px; line-height: 1.85; color: var(--ink-2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-stats { display: flex; gap: 34px; margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 470px; }
.stat b { display: block; font-size: 25px; letter-spacing: -1px; line-height: 1.2; font-weight: 700; }
.stat small { color: var(--ink-3); font-size: 12px; letter-spacing: .4px; }
.hero-art { position: relative; justify-self: end; width: min(100%, 520px); animation: float 7s ease-in-out infinite; }
.hero-art img { width: 100%; height: auto; }

/* --------------------------- 搜索 / 筛选 --------------------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 14px 0 20px; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: -.8px; font-weight: 700; }
.section-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13.5px; }
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  height: 48px;
  width: min(360px, 100%);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbar svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.searchbar input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; }
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar button { border: 0; background: transparent; color: var(--ink-3); display: none; padding: 4px; }
.searchbar button.is-on { display: block; }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 26px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  transition: transform .18s var(--ease), background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.chip .count { font-size: 11px; opacity: .6; }
.filter-label { color: var(--ink-3); font-size: 12px; margin-right: 4px; letter-spacing: .5px; }

/* ----------------------------- 瀑布流 ------------------------------ */
/* 标准瀑布流：置顶资源与普通资源同处一个 Grid，不分区、不按行对齐。
   --masonry-row 是行轨道基准，--masonry-gap 同时用于列间距与卡片垂直留白；
   home.js 的 planMasonry() 按「最短列优先」显式算出每张卡片的
   grid-column / grid-row-start，卡片紧贴同列上一张的底部，各列独立堆叠，
   高矮不一也不会留出整行空白；DOM 顺序即视觉阅读顺序，置顶始终在最前。 */
.masonry {
  --masonry-row: 8px;
  --masonry-gap: 20px;
  /* 列数以自定义属性声明：卡片显式 grid-column 会生成隐式列，
     computed grid-template-columns 会被污染，不能再拿它反推列数 */
  --masonry-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--masonry-cols), minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: var(--masonry-row);
  column-gap: var(--masonry-gap);
  row-gap: 0;
  align-items: start;
  padding-bottom: 56px;
}
.masonry.is-loading, .masonry.is-message { grid-auto-rows: auto; row-gap: 20px; }
.masonry.is-loading .skeleton { display: block; margin: 0; }
.masonry > .card { min-width: 0; align-self: start; }
.card {
  display: block;
  width: 100%;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s;
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.tag-accent { background: var(--accent-soft); color: var(--accent-dark); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-warn { background: var(--amber-soft); color: var(--amber); }
.card-date { margin-left: auto; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.card h3 { margin: 0 0 8px; font-size: 17.5px; line-height: 1.45; letter-spacing: -.4px; font-weight: 680; word-break: break-word; }
.card-summary { margin: 0 0 16px; color: var(--ink-2); font-size: 13.2px; line-height: 1.75; word-break: break-word; }
.card-links { display: flex; flex-direction: column; gap: 8px; }
.drive-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
}
.drive-row:hover { border-color: var(--line-strong); background: var(--surface); }
.drive-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.drive-name { font-size: 12.8px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「复制 / 打开」文字按钮组：位于网盘名称与提取码之间 */
.drive-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.drive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.drive-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.drive-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.drive-btn:active { transform: scale(.94); }
.drive-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: background .18s, color .18s, transform .18s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 15px; height: 15px; }
/* 提取码要完整显示「提取码 8888」，锁定不收缩，避免被长链接名挤掉文字；
   整块是按钮，点击复制纯提取码，已复制时短暂变绿并显示「已复制」。 */
.drive-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.drive-code b { color: var(--ink); font-weight: 700; letter-spacing: .4px; }
.drive-code:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.drive-code:hover b { color: var(--accent-dark); }
.drive-code:active { transform: scale(.96); }
.drive-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drive-code.is-copied,
.drive-code.is-copied:hover { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.drive-code.is-copied b,
.drive-code.is-copied:hover b { color: var(--green); }

/* -------------------------- 置顶与表单补充 ------------------------- */
.tag-pin { background: var(--green-soft); color: var(--green); font-weight: 700; }
.tag-mini { padding: 2px 7px; font-size: 10.5px; border-radius: 5px; }
.card.is-pinned { border-color: rgba(91, 122, 94, .4); box-shadow: var(--shadow), inset 3px 0 0 var(--green); }
.card.is-pinned:hover { border-color: var(--green); }
.manage-row.is-pinned { border-color: rgba(91, 122, 94, .42); }
.btn-pin { background: var(--green-soft); color: var(--green); border-color: #D6E2CF; }
.btn-pin:hover { background: #DEEBD8; color: #3F5C42; border-color: var(--green); }
.chip-pin { margin-left: 6px; }
.chip-pin.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.switch-stack { display: grid; gap: 10px; }
.switch-row.is-pin { flex-wrap: wrap; }
.switch-row.is-pin input { accent-color: var(--green); }
.switch-hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--line); }
.link-count { font-size: 11.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.link-count svg { width: 13px; height: 13px; }
.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 7px;
  transition: color .18s, background .18s;
}
.report-btn:hover { color: var(--accent); background: var(--accent-soft); }
.report-btn svg { width: 14px; height: 14px; }

/* --------------------------- 状态与骨架 ---------------------------- */
.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; break-inside: avoid; margin-bottom: 20px; display: inline-block; width: 100%; }
.sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #EFEAE1 25%, #F7F3EC 50%, #EFEAE1 75%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; margin-bottom: 12px; }
.sk-line.w40 { width: 40%; } .sk-line.w70 { width: 70%; } .sk-line.w90 { width: 90%; } .sk-line.h24 { height: 24px; } .sk-line.h44 { height: 44px; border-radius: 10px; }
.state-box { grid-column: 1 / -1; text-align: center; padding: 82px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); background: rgba(255, 255, 255, .5); }
.state-box .state-icon { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3); }
.state-box .state-icon svg { width: 25px; height: 25px; }
.state-box h3 { margin: 0 0 6px; font-size: 17px; }
.state-box p { margin: 0 0 18px; color: var(--ink-3); font-size: 13.5px; }

/* ------------------------------ 弹窗 ------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(36, 33, 28, .42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .2s ease both;
}
.modal {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 90px -30px rgba(30, 24, 16, .5);
  padding: 28px;
  animation: pop .32s var(--ease) both;
  max-height: min(88dvh, 760px);
  overflow-y: auto;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.modal-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.modal-close { border: 0; background: var(--surface-3); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); flex-shrink: 0; }
.modal-close:hover { background: var(--line); }
.modal-close svg { width: 16px; height: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ------------------------------ 表单 ------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label { font-size: 13px; font-weight: 650; letter-spacing: .1px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: #AAA397; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238C867A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.field-error { color: var(--red); font-size: 12px; min-height: 0; }
.reason-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reason {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 9px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all .18s;
}
.reason:hover { border-color: var(--line-strong); }
.reason.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.switch-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ------------------------------ 登录 ------------------------------- */
/* 与 .wrap（导航、页脚、登录后的工作台）同宽居中。旧写法是整屏 1fr 1fr，
   在 4K / 超宽屏上左栏文案会贴到屏幕最左、密码卡片被推到站点内容区之外，
   看起来与顶部导航完全错位。限宽后左栏与 LOGO 左对齐，卡片始终留在内容区里。 */
.gate-wrap {
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100dvh - 72px);
}
.gate-aside {
  position: relative;
  padding: 70px 64px 70px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
/* 分隔线只落在内容中段，超宽屏上不再是一条从导航贯到页脚的长线 */
.gate-aside::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: min(460px, 62%);
  background: var(--line);
}
.gate-aside h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.2; letter-spacing: -1.6px; margin: 20px 0 14px; }
.gate-aside p { color: var(--ink-2); max-width: 42ch; line-height: 1.85; }
.gate-points { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; }
.gate-point { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--ink-2); }
.gate-point .gp-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.gate-point svg { width: 16px; height: 16px; }
.gate-main { display: flex; align-items: center; justify-content: center; padding: 50px 32px; min-width: 0; }
.gate-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow); }
.gate-card .lock { width: 46px; height: 46px; border-radius: 15px; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 20px; }
.gate-card .lock svg { width: 21px; height: 21px; }
.gate-card h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.6px; }
.gate-card > p { margin: 0 0 26px; color: var(--ink-3); font-size: 13.5px; }
.gate-note { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; line-height: 1.65; }

/* ---------------------------- 发布工作台 --------------------------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 28px; padding: 40px 0 76px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 28px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -.5px; }
.panel-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 12.8px; }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; margin-right: 8px; }

.category-row { display: flex; gap: 8px; align-items: stretch; }
.category-row .select { flex: 1; }
.category-add { display: none; gap: 8px; margin-top: 10px; }
.category-add.is-on { display: flex; }
.category-add .input { flex: 1; width: auto; min-width: 0; }

.manage-list { display: flex; flex-direction: column; }
.manage-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.manage-item:first-child { border-top: 0; }
.manage-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.manage-empty { color: var(--ink-3); font-size: 13px; padding: 14px 0 2px; }
.admin-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.link-editor { display: flex; flex-direction: column; gap: 10px; }
.link-line { display: grid; grid-template-columns: 30px minmax(0, 1fr) 118px 30px; gap: 8px; align-items: center; animation: rise .3s var(--ease) both; }
.link-line .num { font-size: 12px; color: var(--ink-3); text-align: center; }
.link-line .input { padding: 10px 12px; font-size: 13px; }
.link-line .code-input { padding: 10px 10px; font-size: 12.5px; }
.link-line .del { width: 30px; height: 30px; }
.code-slot { min-width: 0; }
.code-slot .input { width: 100%; }
.code-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 38px;
  padding: 0 4px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  transition: border-color .18s, color .18s, background .18s;
}
.code-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.code-add svg { width: 12px; height: 12px; }
.code-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.code-badge b { letter-spacing: .4px; }
.detect-strip { grid-column: 2 / -1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: -3px; font-size: 11.5px; color: var(--ink-3); min-height: 16px; }
.detect-strip .drive-icon { width: 18px; height: 18px; border-radius: 6px; font-size: 9px; }
.detect-strip b { color: var(--ink-2); font-weight: 600; }
.panel-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.editor-hint code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
.editor-hint { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: 12px; color: var(--ink-3); line-height: 1.7; }

.preview-panel { position: sticky; top: 96px; }
.preview-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 12px; letter-spacing: .4px; }
.preview-label .live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: breathe 2.4s ease-in-out infinite; }
.preview-shell { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.preview-shell .card { box-shadow: none; animation: none; margin: 0; }
.preview-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 28px 10px; }
.publish-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.form-msg { font-size: 12.5px; margin-top: 12px; min-height: 18px; color: var(--red); }
.form-msg.ok { color: var(--green); }

/* ---------------- 自定义网盘域名映射 & 跳转标记 ---------------- */
.drive-redirect {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  font-size: 10px; font-style: normal; font-weight: 500; line-height: 1.5;
  color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line);
  vertical-align: 1px; white-space: nowrap;
}
.detect-custom { color: var(--accent-dark); }
.domain-panel { margin-top: 20px; }
.domain-summary { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.domain-summary::-webkit-details-marker { display: none; }
.domain-summary::after {
  content: ''; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .2s var(--ease);
}
.domain-panel[open] .domain-summary::after { transform: rotate(-135deg); }
.domain-summary-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.domain-summary-text strong { font-size: 15px; font-weight: 650; color: var(--ink); }
.domain-summary-text small { font-size: 12.5px; color: var(--ink-3); }
.domain-count { margin-left: auto; flex-shrink: 0; font-size: 12px; color: var(--ink-3); }
.domain-body { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.domain-hint { margin: 0 0 18px; font-size: 12.8px; line-height: 1.75; color: var(--ink-2); }
.domain-hint code { font-family: var(--font-mono, monospace); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.domain-rows { display: flex; flex-direction: column; gap: 10px; }
.domain-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 30px; gap: 8px; align-items: center; }
.domain-row .input, .domain-row .select { min-width: 0; }
.domain-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.domain-foot .form-msg { margin-top: 0; flex: 1 1 200px; }
.domain-footnote { margin: 16px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }

/* ---------------------------- 反馈后台 ----------------------------- */
.admin-head { padding: 44px 0 8px; }
.admin-head h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -1.5px; margin: 0 0 8px; }
.admin-head p { color: var(--ink-3); margin: 0; font-size: 14px; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-card small { display: block; color: var(--ink-3); font-size: 12px; margin-bottom: 4px; }
.stat-card b { font-size: 28px; letter-spacing: -1px; }
.stat-card.is-pending b { color: var(--accent); }
.stat-card.is-resolved b { color: var(--green); }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.report-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 70px; }
.report-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  animation: rise .4s var(--ease) both;
}
.report-item.is-resolved { opacity: .72; }
.report-main { min-width: 0; }
.report-title { font-weight: 650; font-size: 15px; margin-bottom: 5px; word-break: break-word; }
.report-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; }
.report-note { margin-top: 8px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.8px; color: var(--ink-2); word-break: break-word; }
.report-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---------------------------- 资源管理 ------------------------------ */
.filter-panel { margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 14px; }
.filter-grid .field { margin-bottom: 0; }
.filter-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-dates .chip { padding: 5px 11px; font-size: 12px; }
.filter-right { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.manage-table { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.manage-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow-sm); animation: rise .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.manage-row:hover { border-color: var(--line-strong); }
.manage-row-main { min-width: 0; }
.manage-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.manage-row-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.manage-row-summary { margin-top: 8px; color: var(--ink-2); font-size: 12.8px; max-width: 78ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.brand-dots { display: inline-flex; gap: 3px; }
.brand-dots .drive-icon { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; }
.modal-wide { width: min(720px, 100%); }
.modal-wide .field { margin-bottom: 15px; }
.modal-wide .modal-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 14px 0 2px;
  margin-top: 10px;
  box-shadow: 0 -12px 20px -16px rgba(60, 45, 25, .5);
}
.modal-wide .modal-foot::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 20px;
  background: linear-gradient(to top, var(--surface), transparent);
  pointer-events: none;
}

/* ------------------------------ 页脚 ------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .45); padding: 30px 0; margin-top: auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--ink-3); font-size: 12.3px; line-height: 1.8; }
.footer-links { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }

/* ------------------------------ 提示 ------------------------------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff;
  padding: 11px 17px; border-radius: 12px;
  font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease) both;
  max-width: min(360px, calc(100vw - 44px));
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.ok svg { color: #A8D2A4; }
.toast.err svg { color: #F0A79C; }
.toast.is-out { animation: toastOut .25s ease forwards; }

/* ------------------------------ 动效 ------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* ---------------------------- 响应式 ------------------------------- */
@media (max-width: 1080px) {
  .masonry { --masonry-cols: 2; }
  .hero-grid { grid-template-columns: 1fr .8fr; }
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-shell { max-width: 520px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 8px; }
  .hero-art { justify-self: center; width: min(88%, 420px); margin-top: -10px; }
  .hero { padding: 38px 0 28px; }
  .gate-wrap { grid-template-columns: minmax(0, 1fr); }
  .gate-aside { padding: 44px 24px 8px; }
  .gate-aside::after { display: none; }   /* 单列布局不需要中间分隔线 */
  .gate-aside h1 { font-size: 30px; }
  .gate-points { display: none; }
  .gate-main { padding: 24px 24px 60px; }
  .nav-links { gap: 0; margin-left: 4px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  .nav-status { display: none; }
}
@media (max-width: 680px) {
  .wrap, .wrap-narrow { width: min(100% - 32px, 1280px); }
  .nav { height: 62px; gap: 6px; }
  .brand img { width: 32px; height: 32px; }
  .brand-text b { font-size: 15px; }
  .brand-text small { display: none; }
  .nav-links { margin-left: auto; gap: 0; }
  .nav-link { padding: 5px 6px; font-size: 12px; }
  .nav-status { display: none; }
  .nav-cta { display: none; }
  .hero { padding-bottom: 14px; }
  .hero-art { width: 64%; margin-top: -4px; }
  .hero h1 { letter-spacing: -1.6px; }
  .gate-wrap { grid-template-columns: minmax(0, 1fr); width: min(100% - 32px, 1280px); }
  .gate-aside { padding: 36px 16px 0; }
  .gate-main { padding: 20px 16px 56px; min-width: 0; }
  .gate-card { width: 100%; max-width: 100%; padding: 26px 22px; }
  .hero-stats { gap: 22px; margin-top: 30px; }
  .stat b { font-size: 21px; }
  .masonry { --masonry-cols: 1; --masonry-gap: 16px; }
  .section-head { flex-direction: column; align-items: stretch; }
  .searchbar { width: 100%; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-card b { font-size: 22px; }
  .report-item { grid-template-columns: 1fr; }
  .report-actions { justify-content: flex-start; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-footer { align-items: flex-start; }
  .filter-right { width: 100%; justify-content: space-between; }
  .manage-row { grid-template-columns: 1fr; }
  .manage-row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .panel { padding: 20px; }
  .modal { padding: 22px; }
  .reason-grid { grid-template-columns: repeat(2, 1fr); }
  .link-line { grid-template-columns: 20px minmax(0, 1fr) 92px 26px; gap: 6px; }
  .code-slot .input { padding: 10px 8px; font-size: 12px; }
  .code-add { font-size: 10.5px; min-height: 36px; }
  .detect-strip { grid-column: 2 / -1; }
  /* 窄屏收紧链接行间距，让「网盘名 · 链接 N」不被提取码与按钮挤成省略号 */
  .drive-row { gap: 6px; padding: 8px; }
  .drive-name { font-size: 12px; }
  .drive-code { padding: 2px 6px; }
  .drive-actions { gap: 4px; }
  .drive-btn { padding: 3px 5px; font-size: 10.5px; gap: 2px; }
  .drive-btn svg { width: 11px; height: 11px; }
  .drive-redirect { margin-left: 4px; padding: 1px 4px; }
  .domain-row { grid-template-columns: minmax(0, 1fr) 140px 30px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* 极窄屏（≤360px）单行放不下四块内容：名称独占首行，
   「复制 / 打开」按钮与提取码换到第二行，保持名称完整可见 */
@media (max-width: 360px) {
  .drive-row { flex-wrap: wrap; }
  .drive-icon { width: 24px; height: 24px; }
  .drive-name { flex: 1 1 calc(100% - 34px); }
  .drive-actions { margin-left: 30px; }
  .drive-code { margin-left: auto; }
  /* 顶部四个导航链接在 320px 会顶出 14px，再收紧左右内边距 */
  .nav-links { gap: 0; }
  .nav-link { padding: 5px 4px; }
  .domain-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .domain-row .select { grid-column: 1 / -1; }
  .domain-foot { align-items: stretch; }
  .domain-foot .btn { flex: 1 1 auto; }
}

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