/* gr-pad 样式 v2：浅/深双主题、桌面双栏、类型标签、缩略图网格、对话框、代码高亮 */
* { box-sizing: border-box; }
:root {
  --bg: #f5f7fb; --card: #ffffff; --card2: #f7f9fc; --line: #e4e9f2; --line2: #d7dfeb;
  --fg: #1f2937; --muted: #7b8798; --accent: #2f6df6; --accent-soft: #eaf1ff;
  --green: #12a374; --green-soft: #e6f7f1; --amber: #c2820a; --amber-soft: #fdf3dd;
  --danger: #e0483c; --danger-soft: #fdefee;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 8px 24px rgba(16, 32, 64, .06);
  --shadow-sm: 0 1px 2px rgba(16, 32, 64, .06);
  --code-bg: #f4f6fa; --viewer-bg: #0e1116; --ph: #a9b4c4;
  --hl-c: #8b98a9; --hl-s: #1a7f5a; --hl-n: #b45309; --hl-k: #7c3aed; --hl-f: #2563eb; --hl-p: #0f766e;
  --glow1: #e3ecff; --glow2: #e6f7f1;
}
/* 深色变量：跟随系统（未手动指定 light 时），或手动 data-theme=dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #0f141b; --card: #171d26; --card2: #1d2430; --line: #26303d; --line2: #303c4b;
    --fg: #e6ebf2; --muted: #8b97a8; --accent: #5b8cff; --accent-soft: #1b2a47;
    --green: #2fc48f; --green-soft: #143327; --amber: #e0a43a; --amber-soft: #3a2c12;
    --danger: #ff6b5e; --danger-soft: #3a1f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --code-bg: #111720; --viewer-bg: #0a0d12; --ph: #5d6979;
    --hl-c: #6b7a8c; --hl-s: #7ee2b8; --hl-n: #f6b26b; --hl-k: #c4a1ff; --hl-f: #7fb2ff; --hl-p: #5fd3c8;
    --glow1: #16223a; --glow2: #10291f;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0f141b; --card: #171d26; --card2: #1d2430; --line: #26303d; --line2: #303c4b;
  --fg: #e6ebf2; --muted: #8b97a8; --accent: #5b8cff; --accent-soft: #1b2a47;
  --green: #2fc48f; --green-soft: #143327; --amber: #e0a43a; --amber-soft: #3a2c12;
  --danger: #ff6b5e; --danger-soft: #3a1f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --code-bg: #111720; --viewer-bg: #0a0d12; --ph: #5d6979;
  --hl-c: #6b7a8c; --hl-s: #7ee2b8; --hl-n: #f6b26b; --hl-k: #c4a1ff; --hl-f: #7fb2ff; --hl-p: #5fd3c8;
  --glow1: #16223a; --glow2: #10291f;
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0; color: var(--fg); min-height: 100vh; padding-bottom: 64px;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--glow1) 0%, transparent 70%),
    radial-gradient(760px 380px at 92% 4%, var(--glow2) 0%, transparent 65%),
    var(--bg);
  background-attachment: fixed;
  font: 16px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .2s, color .2s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", "Courier New", monospace; }

/* ---------- 顶栏 ---------- */
header.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 0 14px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
header.top::before { content: ""; position: absolute; inset: 0 -20px; background: color-mix(in srgb, var(--bg) 82%, transparent); z-index: -1; }
header.top h1 { font-size: 20px; margin: 0; letter-spacing: .3px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
header.top h1 img { width: 26px; height: 26px; border-radius: 7px; }
header.top h1 a { color: inherit; }
header.top .sub { color: var(--muted); font-size: 12.5px; }
header.top .spacer { flex: 1; }
.usage { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.usage .meter { width: 72px; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.usage .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }

/* ---------- 布局：桌面双栏 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.col-left { position: sticky; top: 78px; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } .col-left { position: static; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); transition: background .2s, border-color .2s;
}
.card h2 { font-size: 13px; margin: 0 0 12px; color: var(--muted); font-weight: 700; letter-spacing: .6px; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }

/* ---------- 表单控件 ---------- */
textarea, input[type=text], input[type=password], input[type=search] {
  width: 100%; background: var(--card2); border: 1px solid var(--line);
  color: var(--fg); border-radius: 11px; padding: 10px 13px; font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea::placeholder, input::placeholder { color: var(--ph); }
textarea {
  min-height: 160px; max-height: 60vh; resize: vertical; background: var(--card2);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", "Courier New", monospace; font-size: 16px; line-height: 1.8; tab-size: 2;
}
textarea:focus, input:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.counter { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }

/* 编辑器工具条 + 预览 */
.editor-tabs { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.editor-tabs button { border: 0; background: transparent; color: var(--muted); padding: 4px 11px; border-radius: 7px; font: inherit; font-size: 12.5px; cursor: pointer; }
.editor-tabs button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.preview {
  min-height: 160px; max-height: 60vh; overflow: auto; background: var(--card2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--line2); color: var(--fg); cursor: pointer;
  border-radius: 10px; padding: 8px 15px; font: inherit; line-height: 1.4;
  box-shadow: var(--shadow-sm); transition: .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--card2); border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #4a82ff, #2f6df6); border-color: #2a61dd; color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(47, 109, 246, .3), 0 6px 16px rgba(47, 109, 246, .22);
}
.btn.primary:hover { background: linear-gradient(180deg, #3d78ff, #2861e6); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--card2); color: var(--fg); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { padding: 6px 9px; }

/* ---------- 拖拽上传区 ---------- */
.drop {
  border: 1.5px dashed var(--line2); border-radius: 14px; padding: 26px 20px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--card2); transition: .15s;
}
.drop b { color: var(--accent); }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.drop .big { font-size: 28px; margin-bottom: 4px; }
.uplist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.uprow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.uprow .nm { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uprow .bar { grid-column: 1 / -1; margin-top: 0; }
.uprow.done .bar i { background: var(--green); }
.uprow.fail .bar i { background: var(--danger); }
.bar { height: 6px; background: var(--line); border-radius: 5px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #4a82ff, #12a374); transition: width .2s; }

/* ---------- 类型标签 / 视图切换 ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: var(--card2); color: var(--muted); border-radius: 20px;
  padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; transition: .15s; display: inline-flex; gap: 5px; align-items: center;
}
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip b { font-weight: 600; opacity: .7; font-size: 11px; }
.tabs .spacer { flex: 1; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.item {
  display: flex; gap: 13px; align-items: center; padding: 11px 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; transition: .15s; position: relative;
}
.item:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(16, 32, 64, .07); }
.item .ico {
  font-size: 19px; width: 42px; height: 42px; flex: none; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--card2);
}
.item .ico img, .item .ico video { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .meta { flex: 1; min-width: 0; }
.item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .nm a { color: var(--fg); }
.item .nm a:hover { color: var(--accent); text-decoration: none; }
.item .desc { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.item .desc .tag { flex: none; }
.item .acts { display: flex; gap: 6px; flex: none; }
.item .acts .btn { opacity: .85; }
.item:hover .acts .btn { opacity: 1; }

/* 缩略图网格（图片 / 视频） */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card2);
  aspect-ratio: 1; display: block; transition: .15s;
}
.tile .tmedia { display: block; width: 100%; height: 100%; }
.tile:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--viewer-bg); }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 9px 7px; color: #fff; font-size: 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; pointer-events: none;
}
.tile .tacts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.tile:hover .tacts, .tile:focus-within .tacts { opacity: 1; }
.tile .tacts .btn { padding: 4px 7px; font-size: 12px; background: rgba(255, 255, 255, .92); color: #1f2937; border-color: transparent; }
.tile .tag { position: absolute; left: 6px; top: 6px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 20px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); vertical-align: 1.5px; white-space: nowrap;
}
.tag.perm { color: var(--green); background: var(--green-soft); border-color: transparent; }
.tag.soon { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.tag.hidden { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.empty { text-align: center; color: var(--muted); padding: 34px 0; }
.empty .big { font-size: 34px; margin-bottom: 6px; }

/* 骨架屏 */
.skel { height: 64px; border-radius: 13px; background: linear-gradient(90deg, var(--card2) 25%, var(--line) 37%, var(--card2) 63%); background-size: 400% 100%; animation: skel 1.3s ease infinite; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 11px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(16, 32, 64, .25); opacity: 0; pointer-events: none; transition: .2s; z-index: 99; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #12a374; }
.toast.err { background: var(--danger); }

/* ---------- 对话框 ---------- */
dialog.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--card); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); width: min(420px, 92vw); }
dialog.dlg::backdrop { background: rgba(10, 14, 22, .45); backdrop-filter: blur(3px); }
dialog.dlg form { padding: 20px 22px 18px; }
dialog.dlg h3 { margin: 0 0 12px; font-size: 16px; }
dialog.dlg .dlg-text { margin: 0 0 6px; color: var(--muted); line-height: 1.6; }
dialog.dlg .dlg-acts { justify-content: flex-end; margin-top: 14px; }

/* ---------- 详情页 ---------- */
.viewer {
  background: var(--viewer-bg); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow);
}
.viewer video, .viewer img { display: block; width: 100%; max-height: 72vh; }
.viewer img { background: var(--card); object-fit: contain; }
.viewer audio { display: block; width: 100%; padding: 14px; background: var(--card); }
.note-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 16px; box-shadow: var(--shadow); overflow: hidden; }
.note-box .note-tools { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card2); flex-wrap: wrap; }
.note-box .note-tools .spacer { flex: 1; }
pre.note {
  white-space: pre-wrap; word-break: break-word; margin: 0; padding: 16px 18px; max-height: 68vh; overflow: auto;
  font: 13.5px/1.8 ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", "Courier New", monospace; counter-reset: ln;
}
pre.note.lines .ln { display: block; padding-left: 3.2em; position: relative; }
pre.note.lines .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 2.4em; text-align: right; color: var(--ph); user-select: none; }
.md { padding: 6px 18px 14px; line-height: 1.75; max-height: 68vh; overflow: auto; }
.kv { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.kv b { color: var(--fg); font-weight: 600; }
.share { display: flex; gap: 8px; }
.share input { flex: 1; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.share + .share { margin-top: 8px; }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr canvas { border-radius: 10px; background: #fff; padding: 8px; border: 1px solid var(--line); }

/* ---------- Markdown 渲染 ---------- */
.md h1, .md h2, .md h3, .md h4 { margin: 1em 0 .5em; line-height: 1.35; color: var(--fg); letter-spacing: 0; text-transform: none; }
.md h1 { font-size: 1.55em; } .md h2 { font-size: 1.3em; } .md h3 { font-size: 1.12em; } .md h4 { font-size: 1em; }
.md p { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.5em; margin: .5em 0; }
.md li.task { list-style: none; margin-left: -1.3em; }
.md blockquote { margin: .8em 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--card2); border-radius: 0 8px 8px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: .9em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.md img { max-width: 100%; border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: .95em; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--card2); }
pre.code { position: relative; margin: .8em 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
pre.code .code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 12px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--card2); }
pre.code .copy-code { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
pre.code .copy-code:hover { background: var(--line); color: var(--fg); }
pre.code code { display: block; padding: 12px 14px; overflow: auto; font: 13px/1.65 ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", monospace; background: transparent; border: 0; white-space: pre; }
.hl .c, pre .c { color: var(--hl-c); font-style: italic; }
.hl .s, pre .s { color: var(--hl-s); }
.hl .n, pre .n { color: var(--hl-n); }
.hl .k, pre .k { color: var(--hl-k); font-weight: 600; }
.hl .f, pre .f { color: var(--hl-f); }
.hl .p, pre .p { color: var(--hl-p); }

/* ---------- 手机底部操作栏 ---------- */
.mbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: 84px; }
  .wrap { padding: 0 13px; }
  .card { padding: 15px 15px; border-radius: 14px; }
  header.top { padding: 12px 0 10px; margin-bottom: 14px; }
  header.top::before { inset: 0 -13px; }
  header.top h1 { font-size: 17px; }
  header.top .sub { display: none; }
  .item .acts .btn span { display: none; }
  .item .ico { width: 36px; height: 36px; font-size: 17px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .tile .tacts { opacity: 1; }
  .mbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); gap: 8px;
  }
  .mbar a { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; color: var(--muted); font-size: 12px; line-height: 1.3; }
  .mbar a b { display: block; font-size: 18px; font-weight: 400; }
  .mbar a:hover, .mbar a:active { background: var(--card2); color: var(--fg); text-decoration: none; }
}

/* 2026-09: clearer typography and a quiet blue workspace. */
:root {
  --bg: #f2f5fa; --card: #fff; --card2: #f7f9fc;
  --fg: #17243b; --muted: #637087; --ph: #758198;
  --line: #e2e8f1; --line2: #cbd5e4; --accent: #255de0; --accent-soft: #edf3ff;
  --shadow: 0 4px 24px #20365908; --shadow-sm: 0 1px 2px #20365906;
  --glow1: #e7eeff; --glow2: #eef3fc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #101722; --card: #182230; --card2: #131d2b;
    --fg: #edf2fc; --muted: #a6b4cb; --ph: #8a9bb5;
    --line: #29374c; --line2: #41516c; --accent: #8aadff; --accent-soft: #203452;
    --shadow: 0 4px 24px #0002; --glow1: #16223a; --glow2: #142133;
  }
}
:root[data-theme=dark] {
  --bg: #101722; --card: #182230; --card2: #131d2b;
  --fg: #edf2fc; --muted: #a6b4cb; --ph: #8a9bb5;
  --line: #29374c; --line2: #41516c; --accent: #8aadff; --accent-soft: #203452;
  --shadow: 0 4px 24px #0002; --glow1: #16223a; --glow2: #142133;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 10px 18px; background: var(--card); z-index: 100; }
.skip-link:focus { top: 10px; }
:where(button,a,input,textarea,select):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.ui-icon { display: inline-block; width: 19px; height: 19px; vertical-align: middle; flex: none; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.wrap { max-width: 1380px; padding: 0 32px; }
header.top { padding: 25px 0 22px; margin-bottom: 28px; gap: 16px; }
header.top h1 { font-size: 24px; gap: 10px; letter-spacing: -.7px; }
header.top h1 img { width: 33px; height: 33px; border-radius: 10px; }
header.top .sub { padding-left: 16px; border-left: 1px solid var(--line2); font-size: 14px; }
.usage { font-size: 13px; gap: 12px; margin-right: 8px; }
.usage .meter { width: 60px; height: 5px; }
.layout { grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); gap: 28px; }
.col-left { position: static; min-width: 0; }
.col-right { min-width: 0; }
.card { padding: 24px; border-radius: 18px; margin-bottom: 22px; }
.card h2 { font-size: 17px; color: var(--fg); letter-spacing: -.3px; margin-bottom: 20px; gap: 10px; }
.section-icon { color: var(--accent); }
.section-icon .ui-icon { width: 21px; height: 21px; }
#secNote { border-top: 3px solid var(--accent); }
#title { margin: 0 0 10px; background: transparent; font-size: 19px; font-weight: 600; padding: 11px 13px; }
#text { min-height: 240px; padding: 16px; }
.preview { min-height: 240px; padding: 16px; overflow-wrap: anywhere; }
.editor-tabs button { min-height: 34px; font-size: 14px; padding: 5px 13px; }
.editor-meta { display: flex; justify-content: space-between; gap: 12px; margin: 9px 0 20px; color: var(--muted); font-size: 12px; }
.counter { font-size: 12px; }
.editor-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.expiry-select { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
select { font: inherit; color: var(--fg); border: 1px solid var(--line); border-radius: 7px; background: var(--card2); padding: 7px 25px 7px 8px; max-width: 100%; }
.check { font-size: 14px; gap: 8px; }
.check input { width: 17px; height: 17px; }
.editor-actions { gap: 8px; padding-top: 3px; }
.editor-actions #clearDraft { margin-left: auto; padding: 10px; }
.btn { border-radius: 9px; font-size: 14px; min-height: 42px; gap: 7px; box-shadow: none; justify-content: center; }
.btn.sm { font-size: 14px; min-height: 36px; padding: 6px 10px; }
.btn.primary { background: #255de0; border-color: #255de0; box-shadow: 0 4px 12px #255de020; }
.btn.primary:hover { background: #194cc8; }
.btn.primary.danger { background: var(--danger); border-color: var(--danger); }
.btn:hover { transform: none; }
.helper { font-size: 13px; color: var(--muted); margin: 12px 0 0; line-height: 1.7; }
kbd { font: inherit; }
#noteHint { font-size: 14px; color: var(--muted); margin-top: 8px; }
#noteHint:empty { display: none; }
.text-button { padding: 0; font: inherit; border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; }
.drop { display: flex; width: 100%; flex-direction: column; align-items: center; padding: 26px 16px; font: inherit; border: 1.5px dashed var(--line2); }
.upload-symbol { width: 48px; height: 48px; color: var(--accent); background: var(--accent-soft); border-radius: 13px; margin-bottom: 13px; }
.upload-symbol .ui-icon { width: 25px; height: 25px; }
.drop strong { color: var(--fg); font-size: 15px; font-weight: 500; }
.drop strong span { color: var(--accent); font-weight: 600; }
.drop .helper { margin-top: 6px; }
.upload-expiry { margin-top: 15px; }
.privacy-note { display: flex; gap: 9px; color: var(--muted); font-size: 13px; line-height: 1.8; padding: 0 5px; }
.privacy-note > [data-icon] { align-self: flex-start; margin-top: 3px; }
.list-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 12px; }
.list-heading h2 { margin-bottom: 5px; }
.list-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.tabs { gap: 5px; margin-bottom: 18px; }
.chip { font-size: 14px; border-radius: 8px; padding: 7px 9px; background: transparent; border-color: transparent; min-height: 38px; }
.chip.on { border-color: transparent; }
.chip .ui-icon { width: 16px; height: 16px; }
.chip b { font-size: 12px; }
.search-field { position: relative; display: flex; align-items: center; margin-bottom: 8px; }
.search-field > span { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 40px; font-size: 14px; min-height: 44px; }
.list-status { font-size: 12px; color: var(--muted); margin: 10px 0 16px; min-height: 20px; }
.list { gap: 12px; }
.item { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 0 13px; padding: 17px 16px 12px; border-radius: 12px; }
.item .ico { width: 46px; height: 46px; grid-row: 1; color: var(--accent); background: var(--accent-soft); margin-top: 3px; }
.item .ico .ui-icon { width: 22px; height: 22px; }
.item .nm { font-size: 15px; white-space: normal; line-height: 1.55; }
.item .nm a { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-preview { font-size: 13px; color: var(--muted); margin: 4px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .desc { font-size: 12px; gap: 8px; flex-wrap: wrap; white-space: normal; }
.tag { font-size: 12px; padding: 2px 7px; }
.item .acts { grid-column: 2; justify-content: flex-end; margin-top: 8px; gap: 4px; flex-wrap: wrap; }
.item .acts .btn { min-height: 32px; padding: 5px 8px; font-size: 13px; border-color: transparent; color: var(--muted); background: transparent; opacity: 1; }
.item .acts .btn:hover { background: var(--accent-soft); color: var(--accent); }
.item .acts .btn.danger:hover { color: var(--danger); }
.grid { grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 14px; }
.tile .tacts { opacity: 1; }
.tile .tacts .btn { min-height: 34px; }
.empty { padding: 50px 16px; font-size: 14px; }
.empty strong { color: var(--fg); display: block; font-weight: 500; font-size: 17px; }
.empty p { margin: 8px 0 0; }
.empty-symbol { margin: 0 auto 20px; background: var(--accent-soft); width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--accent); }
.empty-symbol svg { width: 28px; height: 28px; }
.save-result { margin-top: 20px; border: 1px solid var(--line2); background: var(--accent-soft); border-radius: 12px; padding: 16px; font-size: 14px; }
.result-heading { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.result-heading button { margin-left: auto; }
.save-result p { margin: 7px 0 12px; font-size: 13px; color: var(--muted); }
.save-result input { font-size: 14px; margin-bottom: 12px; min-width: 0; }
.uprow { grid-template-columns: minmax(0,1fr) auto; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); font-size: 13px; }
.uprow .nm { grid-column: 1; }
.uprow .st { grid-column: 1; overflow-wrap: anywhere; }
.upload-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 4px; }
.uprow .bar { grid-column: 1 / -1; }
.uprow.fail .st { color: var(--danger); }
.uprow.done .st { color: var(--green); }
.page-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 26px; padding: 20px 0; color: var(--muted); font-size: 12px; }
.toast { z-index: 999; bottom: 24px; }
.toast.ok { background: #087b55; }
.share input { min-width: 0; font-size: 14px; }
.qr canvas { max-width: 100%; }
pre.note, pre.code code { font-size: 14px; }
.note-box .note-tools { padding: 12px; }
body:not(.workspace) header h1 { min-width: 0; flex: 1; font-size: 20px; overflow-wrap: anywhere; }
body:not(.workspace) .kv { font-size: 14px; }
@media (max-width: 1100px) {
  .wrap { padding: 0 24px; }
  .layout { gap: 20px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .card { padding: 20px; }
  .chip { padding: 6px 8px; }
  .chip [data-icon] { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .wrap { max-width: 760px; }
  .chip [data-icon] { display: inline-flex; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  header.top { padding: 16px 0; gap: 9px; margin-bottom: 20px; }
  header.top h1 { font-size: 21px; }
  .usage { font-size: 12px; margin-right: 0; gap: 0; }
  .usage .meter { display: none; }
  .card { padding: 18px; border-radius: 15px; margin-bottom: 18px; }
  .card h2 { font-size: 16px; }
  .card h2 .check { font-size: 13px; }
  .editor-options { gap: 10px; }
  .editor-actions .btn { min-height: 44px; padding: 9px 11px; }
  .editor-actions #clearDraft { padding: 9px; }
  #title { font-size: 18px; }
  .search-field input { font-size: 16px; }
  .item { padding: 14px; grid-template-columns: 36px minmax(0,1fr); gap: 0 10px; }
  .item .ico { width: 36px; height: 36px; }
  .item .acts .btn { min-width: 40px; min-height: 40px; }
  .item .acts .btn span { display: inline; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-footer { margin-top: 8px; padding-bottom: 30px; }
  .page-footer span:last-child { display: none; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); font-size: 14px; width: max-content; }
  .mbar a { font-size: 12px; color: var(--muted); }
  .mbar a b { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
  .mbar a .ui-icon { width: 21px; height: 21px; }
  .share { flex-wrap: wrap; }
  .share input { flex-basis: 100%; }
  .qr > div { min-width: 0 !important; width: 100%; }
}
@media (max-width: 420px) {
  header.top { flex-wrap: wrap; }
  .usage { order: 5; width: 100%; justify-content: flex-end; }
  .card { padding: 16px; }
  .chip { padding: 6px 7px; gap: 4px; }
  .chip .ui-icon { display: none; }
  .editor-actions { gap: 3px; }
  .editor-actions .btn { font-size: 13px; }
  .editor-actions #clearDraft { margin-left: 0; }
  .upload-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
