/* FullWidget 組件市場 — the control center's language: graphite, one mint accent, monospaced figures. */
:root {
  --bg: #0e1013;
  --panel: #14171c;
  --raise: #1b1f26;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --fg: #e9ecef;
  --muted: #959ca6;
  --faint: #6a717b;
  --accent: #7de2c4;
  --accent-soft: rgba(125, 226, 196, 0.12);
  --accent-ink: #0b1512;
  --warn: #ffb547;
  --r-lg: 14px;
  --r-sm: 8px;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, "Microsoft JhengHei UI", "PingFang TC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --num: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --slide: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--fg); font: 15px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2)); background: rgba(14, 16, 19, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand b { font-weight: 650; }
.brand span span { color: var(--muted); }
.links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--fg); }
#l-submit { color: var(--accent); }
.langs { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 99px; }
.langs button { border: 0; background: transparent; color: var(--muted); padding: 2px 9px; border-radius: 99px; font-size: 12.5px; }
.langs button.on { background: var(--raise); color: var(--fg); }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }

/* ── hero ── */
.hero { padding: 56px 0 28px; }
.hero h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
.hero p { margin: 12px 0 0; max-width: 46em; color: var(--muted); font-size: 15.5px; }
.hero p b { color: var(--fg); font-weight: 600; }

/* ── filters ── */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.04); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.search input:focus { border-color: rgba(125, 226, 196, 0.55); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.03); }
.seg button { border: 0; background: transparent; color: var(--muted); height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: 13px; }
.chip .num { font-size: 11.5px; color: var(--faint); }
.chip:hover { color: var(--fg); border-color: var(--line-strong); }
.chip.on { background: var(--accent-soft); border-color: rgba(125, 226, 196, 0.28); color: var(--accent); font-weight: 600; }
.chip.on .num { color: inherit; opacity: 0.75; }

/* ── cards ── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 16px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line);
  cursor: pointer; transition: border-color 0.2s, transform 0.25s var(--slide); }
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the preview sits on a painted wallpaper, as on a desktop */
.thumb { display: grid; place-items: center; height: 150px; padding: 16px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(90% 80% at 88% 100%, rgba(52, 120, 255, 0.55), transparent 65%), radial-gradient(70% 60% at 10% 0%, rgba(20, 50, 140, 0.5), transparent 70%), linear-gradient(150deg, #050a1a, #0b1d4d 55%, #15368c); }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.32)); transition: transform 0.3s var(--slide); }
.thumb .icon { width: 56px; height: 56px; }
.card:hover .thumb img { transform: scale(1.03); }
.card h3 { margin: 2px 0 0; font-size: 16px; font-weight: 600; }
.by { font-size: 12.5px; color: var(--faint); }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 2px; }
.perm { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.perm.warn { background: rgba(255, 181, 71, 0.12); color: var(--warn); }
.perm.none { background: transparent; padding: 1px 0; color: var(--faint); }

.state { padding: 60px 0; text-align: center; color: var(--muted); }
.state:empty { display: none; }
.state button { margin-top: 10px; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: transparent; color: var(--fg); font-size: 14px; text-decoration: none; white-space: nowrap; transition: background 0.15s, transform 0.1s; }
.btn:hover { background: rgba(255, 255, 255, 0.05); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── detail ── */
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--panel); color: var(--fg); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); overflow: auto; }
dialog::backdrop { background: rgba(5, 7, 10, 0.6); backdrop-filter: blur(3px); }
dialog[open] { animation: rise 0.28s var(--slide); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.d-head { display: flex; gap: 14px; align-items: center; padding: 22px 22px 0; }
.d-head img { width: 44px; height: 44px; flex: none; }
.d-head h2 { margin: 0; font-size: 21px; }
.d-close { margin-left: auto; align-self: flex-start; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.d-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg); }
.d-body { padding: 16px 22px 22px; display: grid; gap: 18px; }
.d-body > p { margin: 0; color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shots figure { margin: 0; }
.shots .thumb { height: 128px; padding: 12px; }
.shots figcaption { margin-top: 6px; font-size: 12px; color: var(--faint); text-align: center; }
.d-perms { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.d-perms li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.d-perms li::before { content: ""; width: 8px; height: 8px; margin: 7px 0 0 6px; border-radius: 50%; background: var(--accent); }
.d-perms li.warn::before { background: var(--warn); }
.d-perms b { display: block; font-weight: 600; font-size: 14px; }
.d-perms span { font-size: 13px; color: var(--muted); }
.d-label { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.04em; color: var(--faint); text-transform: uppercase; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--faint); }
.facts dd { margin: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.d-hint { font-size: 13px; color: var(--muted); }

/* ── footer ── */
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--muted); }

@media (max-width: 640px) {
  /* the header keeps the name and the languages; how to submit is in the footer */
  .links a { display: none; }
  .hero { padding-top: 32px; }
  .bar { flex-direction: column; align-items: stretch; }
  .search { flex: none; max-width: none; }
  .seg { align-self: flex-start; }
  .shots { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
