/* filesq toolkit · shared site.css · filelink variant (max-width 760) */
:root {
  --ink: #0f1729; --sub: #5a6a80; --bg: #ffffff;
  --panel: #f6f8fb; --panel-2: #eef2f8; --line: #e4e9f1;
  --ok: #059669; --bad: #c0392b; --warn: #d97706;
  --accent: #2563eb; --accent-soft: rgba(37,99,235,.08);
  --shadow-sm: 0 1px 2px rgba(15,23,41,.06), 0 1px 1px rgba(15,23,41,.04);
  --shadow: 0 4px 12px rgba(15,23,41,.08), 0 2px 4px rgba(15,23,41,.04);
  --shadow-lg: 0 12px 32px rgba(15,23,41,.12), 0 4px 8px rgba(15,23,41,.06);
  --radius: 10px; --radius-lg: 16px; --maxw: 1200px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.65; font-size: 16px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 40px 72px; }

.site-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 40px; gap: 16px; }
.site-header .logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.site-header .logo:hover { text-decoration: none; }
.logo-mark { color: var(--accent); flex-shrink: 0; }
.site-header nav { display: flex; gap: 22px; font-size: 15px; }
.site-header nav a { color: var(--sub); text-decoration: none; }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }

.hero { margin: 12px 0 44px; }
.hero h1 { font-size: clamp(30px, 4.8vw, 46px); line-height: 1.18; font-weight: 700; letter-spacing: -0.01em; }
.hero .answer { color: var(--sub); font-size: 20px; margin: 14px 0 22px; max-width: 580px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 18px 0 8px; }
.trust-row .pill { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.panel.tight { padding: 20px; }
.card { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-top: 14px; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; box-shadow: var(--shadow-sm); }
.card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.card .muted { margin-top: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 0; border-radius: var(--radius); padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .18s ease, background .18s ease; font-family: inherit; line-height: 1; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--panel); }
.btn.pill { padding: 7px 14px; border-radius: 999px; font-size: 14px; }
.btn.pill.active { outline: 2px solid var(--accent); outline-offset: 1px; }

.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 12px; transition: border-color .2s, background .2s; background: #fff; }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .drop-hint { text-align: center; padding: 36px 12px; }
.bar-track { background: var(--panel-2); border-radius: 6px; height: 8px; margin: 10px 0; overflow: hidden; }
.bar-fill { background: var(--accent); height: 8px; border-radius: 6px; width: 0%; transition: width .2s; }

table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--sub); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { transition: background .12s; }
tbody tr:nth-child(even) { background: var(--panel); }
tbody tr:hover { background: var(--accent-soft); }

input, button, select, textarea { font: inherit; color: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; width: 100%;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
details { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-top: 10px; background: #fff; transition: border-color .15s; }
details[open] { border-color: var(--accent); }
summary { font-weight: 600; cursor: pointer; }
summary::marker { color: var(--accent); }

.crumbs { font-size: 14px; color: var(--sub); margin-bottom: 16px; }
.crumbs ol { list-style: none; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs li { display: flex; gap: 6px; align-items: center; }
.crumbs li::after { content: "\203A"; color: var(--line); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--sub); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

.related-box { margin-top: 32px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.related-box h2 { margin-top: 0; }
.related-box ul { list-style: none; padding: 0; }
.related-box li { padding: 6px 0; }
.related-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.related-chips a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.related-chips a:hover { border-color: var(--accent); color: var(--accent); }

.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.section-grid a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; transition: border-color .15s, transform .15s; }
.section-grid a:hover { border-color: var(--accent); transform: translateY(-1px); }
.section-grid .muted { display: block; margin-top: 4px; font-size: 13px; }

.site-footer { margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--sub); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand .logo-mark { color: var(--accent); }
.footer-brand a { color: var(--sub); text-decoration: none; }
.footer-brand a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--sub); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-sep { color: var(--line); }

h1 { font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 22px; font-weight: 650; margin: 36px 0 12px; letter-spacing: -0.005em; }
h3 { font-size: 17px; font-weight: 650; margin: 22px 0 8px; }
.answer { color: var(--sub); margin: 12px 0 28px; max-width: 600px; }
.meta { color: var(--sub); font-size: 14px; margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.muted { color: var(--sub); font-size: 14px; }
.tag { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--sub); text-decoration: none; margin-right: 6px; }
.tag:hover { color: var(--accent); border-color: var(--accent); }
.privacy-badge { display: inline-flex; align-items: center; gap: 6px; background: #ecfdf5; color: var(--ok); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }

.error-state { text-align: center; padding: 60px 20px; }
.error-state h1 { font-size: 26px; margin-bottom: 12px; }
.error-state p { color: var(--sub); max-width: 460px; margin: 0 auto 20px; }

@media (max-width: 640px) {
  .wrap { padding: 16px 14px 96px; }
  .site-header { padding: 8px 0 24px; }
  .site-header nav { gap: 14px; font-size: 14px; }
  .hero h1 { font-size: 26px; }
  .panel { padding: 18px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── APP 风格底部 TAB（768px 以下激活）──────────────────────── */
.brand-name { letter-spacing: -.01em; }
.top-nav .signin-link { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); transition: border-color .15s, color .15s; }
.top-nav .signin-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.app-tabs { display: none; }
@media (max-width: 768px) {
  .site-header .top-nav { display: none; }
  .site-header { justify-content: center; padding: 10px 0 22px; }
  .site-header .logo { font-size: 20px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .wrap { padding-bottom: 88px; }
  .app-tabs {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 50;
    background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .app-tabs a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--sub); text-decoration: none; font-size: 11px; font-weight: 500;
    padding: 4px 12px; border-radius: 10px; min-width: 64px;
    transition: color .15s;
  }
  .app-tabs a:active { transform: scale(.94); }
  .app-tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
  .app-tabs a.active { color: var(--accent); }
  .app-tabs .tab-badge {
    position: absolute; top: 2px; right: 8px;
    background: var(--accent); color: #fff; font-size: 9px;
    border-radius: 999px; min-width: 14px; height: 14px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
  }
  .app-tabs a { position: relative; }
}

/* ── header 登录态（current_user 模板全局，base.html）──────── */
.header-actions form { margin: 0; }
button.hdr-btn { cursor: pointer; font-family: inherit; }

/* ── My Links 管理列 icon 按钮（account.html）──────────────── */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--sub); background: #fff;
  transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ── QR 弹出框（上传完成就地展示，不跳新页）────────────────── */
.qr-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.qr-modal[hidden] { display: none; }
.qr-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 41, .55); }
.qr-modal__box {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-lg); text-align: center;
  max-width: 340px; width: calc(100% - 32px); max-height: calc(100vh - 48px); overflow: auto;
}
.qr-modal__name { font-weight: 600; word-break: break-all; }
.qr-modal__box img { display: block; margin: 12px auto; width: 240px; height: 240px; background: #fff; }
