/* filedrop — 淺色／深色自動切換 */
:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1f2328; --muted: #6b7280; --line: #e4e7ec;
  --brand: #237585; --brand-ink: #fff; --brand-soft: #e2f3f5; --grad: linear-gradient(135deg, #2b5a78, #4fcfd9); --danger: #c62828; --ok: #15803d;
  --radius: 14px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1b1e24; --ink: #e8eaee; --muted: #9aa3af; --line: #2c313a;
    --brand: #5fd2dc; --brand-ink: #08201f; --brand-soft: #15343a; --danger: #ff8a80; --ok: #5fd08a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
main { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
main.share { max-width: 440px; padding-top: 12vh; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
button, .btn {
  font: inherit; border: 0; cursor: pointer; border-radius: 10px; padding: 9px 14px; min-height: 40px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary, button.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost, button.ghost { background: transparent; color: var(--muted); }
.btn.danger, button.danger { background: transparent; color: var(--danger); }
.btn.block, button.block { width: 100%; }
.btn.sm, button.sm { min-height: 32px; padding: 4px 10px; font-size: .88rem; }
button:disabled { opacity: .5; cursor: default; }
button:hover:not(:disabled), .btn:hover { filter: brightness(.96); }
input { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.top .logo { font-size: 1.6rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.brand img { height: 30px; width: auto; display: block; }
.brand .sep { width: 1px; height: 22px; background: var(--line); }
.brand h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; }
.ico-svg { width: 1.15em; height: 1.15em; flex: none; }
.drop .up { width: 56px; height: 56px; display: block; margin: 0 auto; transition: transform .2s; }
.drop:hover .up, .drop.over .up { transform: translateY(-3px); }
.btn.primary, button.primary { background: var(--brand); }
.share .logo-top { display: flex; justify-content: center; margin-bottom: 14px; }
.share .logo-top img { height: 34px; }

/* 上傳區 */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card);
  padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { font-size: 2.2rem; line-height: 1; }
.drop b { display: block; margin: 8px 0 2px; }
.dropmask { position: fixed; inset: 0; background: rgba(35, 117, 133, .15); border: 4px dashed var(--brand); z-index: 40; display: grid; place-items: center; pointer-events: none; }
.dropmask div { background: var(--brand); color: var(--brand-ink); padding: 14px 24px; border-radius: 12px; font-weight: 700; font-size: 1.2rem; }

/* 上傳進度 */
.queue { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.queue li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.queue li.done .bar i { background: var(--ok); }
.queue li.err { border-color: var(--danger); }

/* 檔案清單 */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.files li + li { border-top: 1px solid var(--line); }
.files .ico { font-size: 1.6rem; width: 36px; text-align: center; flex: none; }
.files .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .acts { display: flex; gap: 4px; flex: none; }
.files li.fresh { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--brand-soft); } }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }

.section-h { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 8px; }
.section-h h2 { font-size: 1.05rem; margin: 0; }

/* 分享面板 */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--card); border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; }
.dialog h3 { margin: 0 0 4px; }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.choices button.on { background: var(--brand); color: var(--brand-ink); }
.linkbox { display: flex; gap: 6px; }
.linkbox input { font-size: .85rem; }
.linkbox button { flex: none; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); }

/* 分享下載頁 */
.share .card { text-align: center; padding: 28px 20px; }
.share .file-ico { font-size: 3rem; }
.share .fname { word-break: break-all; margin: 8px 0 4px; }
.share .btn { margin-top: 16px; min-height: 48px; font-size: 1.05rem; }

@media (max-width: 560px) {
  .files .acts .lbl { display: none; }
  .choices { grid-template-columns: repeat(2, 1fr); }
}
.files .ico .ico-svg { width: 26px; height: 26px; color: var(--brand); }
.src .ico-svg { width: 1em; height: 1em; vertical-align: -2px; margin-right: 2px; color: var(--brand); }
.dialog h3.row { gap: 8px; }
