﻿[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #080a0f;
  --card: #10141c;
  --card-2: #0c1017;
  --line: #1e2530;
  --line-2: #2a323f;
  --text: #e8ecf3;
  --dim: #8b95a5;
  --accent: #6ea8ff;
  --accent-2: #a06bff;
  --ok: #35d07f;
  --warn: #ffb84d;
  --err: #ff5f6d;
}

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 12% -10%, #16203a 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #1b1430 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding-bottom: 40px;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  background: rgba(8, 10, 15, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .3px; font-size: 15.5px; }
.brand span { color: #fff; }
.stats { color: var(--dim); font-size: 13px; }
.stats b { color: var(--accent); font-variant-numeric: tabular-nums; }

main { max-width: 720px; margin: 0 auto; padding: 18px 14px 0; }

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px -30px #000;
}
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint { margin: 0 0 16px; color: var(--dim); font-size: 12.5px; line-height: 1.65; }

/* modes */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.mode { position: relative; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 13px 6px 11px;
  border: 1px solid var(--line-2); border-radius: 13px;
  background: #0e131b; text-align: center;
  font-size: 13.5px; font-weight: 600; transition: .16s;
}
.mode span i { font-style: normal; font-size: 20px; line-height: 1.2; }
.mode span small { font-weight: 400; color: var(--dim); font-size: 11px; }
.mode input:checked + span {
  border-color: var(--accent);
  background: linear-gradient(180deg, #16233d, #101826);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, .12);
}
.mode input:checked + span small { color: #9db9e6; }

/* rows */
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.row > label { width: 66px; flex: 0 0 66px; color: var(--dim); font-size: 13px; }
.row > label b { color: var(--accent); font-variant-numeric: tabular-nums; }

input[type="text"], select {
  flex: 1; min-width: 0;
  background: #0b0f16; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  outline: none; transition: .15s;
}
input[type="text"]:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: #5c6675; }

input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px;
  background: var(--line-2); border-radius: 4px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid #0b0f16; cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent);
}

/* buttons */
button {
  font-family: inherit; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line-2); background: #1a202b; color: var(--text);
  border-radius: 10px; padding: 10px 16px; transition: .15s;
}
button:hover { border-color: #3a4557; background: #1f2735; }
button:active { transform: translateY(1px); }
button.primary {
  width: 100%; margin-top: 6px; padding: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
  border: none; color: #fff;
  background: linear-gradient(135deg, #4f8dff, #7a5cff 55%, #b06bff);
  box-shadow: 0 14px 30px -16px #6b7bff;
}
button.primary:disabled { opacity: .55; cursor: default; transform: none; }
button.mini { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
button.warn { color: var(--warn); border-color: #4a3a1e; }
button.danger { color: var(--err); border-color: #4a2026; }

.result-box {
  margin-top: 14px; padding: 13px;
  border: 1px dashed #2e4a7a; border-radius: 12px;
  background: #0d1727; font-size: 13px; word-break: break-all;
}
.result-box .k { color: var(--dim); }
.result-box .u { color: #9fc4ff; font-family: ui-monospace, Menlo, Consolas, monospace; }
.result-box .code { color: var(--ok); font-weight: 700; }

/* lookup */
.lookup-result { margin-top: 14px; }
.lookup-card {
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px; background: #0c1119;
}
.lookup-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lookup-top .code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--ok); font-weight: 700; margin-right: auto;
}
.lookup-card .meta { color: var(--dim); font-size: 12px; margin-top: 6px; }
.lookup-card .url {
  margin-top: 6px; font-size: 11.5px; color: #7f9fcf;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all;
}

/* list */
.list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--dim); font-size: 13px; padding: 8px 0; }

.item {
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px; background: #0c1119;
}
.item.new { border-color: #2f6f4d; box-shadow: 0 0 0 3px rgba(53, 208, 127, .08); }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; color: #a9b6c9;
}
.item .meta { color: var(--dim); font-size: 12px; margin-top: 6px; }
.item .url {
  font-size: 11.5px; color: #7f9fcf; margin-top: 6px; word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.item .ops { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap;
}
.badge.photo { color: #6ea8ff; border-color: #24405f; background: #0d1926; }
.badge.video { color: #ff8fb1; border-color: #4a2437; background: #1a0d14; }
.badge.audio { color: #7de3c1; border-color: #1e4a3d; background: #0b1a17; }
.badge.off { color: #ff8080; border-color: #4a2026; background: #1a0c0f; }

/* viewer */
.viewer[hidden] { display: none; }
.viewer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 10, .88); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.viewer-panel {
  width: min(860px, 100%); max-height: 88vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 16px; padding: 16px;
}
.viewer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.viewer-head h3 { margin: 0; font-size: 15px; }
.viewer-head .sub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.viewer-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.media { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #070a0f; }
.media img, .media video { display: block; width: 100%; height: auto; }
.media audio { width: 100%; padding: 10px; }
.media-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 11px; color: var(--dim);
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.media-foot .acts { display: flex; gap: 6px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 18px);
  background: #1b2230; border: 1px solid var(--line-2);
  color: var(--text); padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: .22s; z-index: 90; max-width: 90vw; text-align: center;
  box-shadow: 0 20px 40px -24px #000;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: #2f6f4d; color: #b6f0d0; }
.toast.err { border-color: #6f2f37; color: #ffc4c8; }

.foot { text-align: center; color: #4d5765; font-size: 11.5px; padding: 6px 0 30px; }

@media (max-width: 480px) {
  main { padding: 14px 10px 0; }
  .card { padding: 15px; border-radius: 14px; }
  .row > label { width: 56px; flex: 0 0 56px; }
  .modes { gap: 7px; }
  .mode span { padding: 11px 4px 9px; font-size: 12.5px; }
}
