/* Short-link visual layer. No API, authentication or business behavior changes. */
:root {
  --brand: #17594d;
  --brand-soft: #edf5f1;
  --ink: #202925;
  --muted: #66716b;
  --line: #dfe5df;
  --bg: #f4f6f3;
  --card: #ffffff;
  --danger: #a33232;
}
html { color-scheme: light; }
body { font-size: 14px; line-height: 1.65; }
button, input, select, a.btn { font: inherit; }
button, a.btn { transition: background .15s, border-color .15s, box-shadow .15s; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #95bcad; outline-offset: 3px;
}
header.top {
  min-height: 72px; padding: 14px max(24px, calc((100% - 1232px) / 2));
  background: #fff; color: var(--ink); border-bottom: 1px solid var(--line);
}
header.top h1 { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 750; }
header.top h1::before {
  content: "琢"; display: grid; place-items: center; width: 38px; height: 38px;
  background: #e8dfbe; color: #453d27; border-radius: 11px; font: 25px/1 serif;
}
header.top .who { opacity: 1; color: var(--muted); gap: 16px; }
header.top button.ghost {
  min-height: 36px; padding: 5px 14px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); border-radius: 8px;
}
header.top button.ghost:hover { background: var(--bg); }
main { max-width: 1280px; padding: 28px 24px 48px; }
.card { padding: 24px; margin-bottom: 20px; border-radius: 16px; box-shadow: 0 3px 12px #23342a04; }
.card h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: .01em; }
main > .card > h2 { display: flex; align-items: center; gap: 10px; }
main > .card > h2::before { content:""; width:4px; height:18px; border-radius:3px; background:var(--brand); }
label { margin: 0 0 7px; font-size: 13px; font-weight: 600; color: #43534b; }
input[type="text"], input[type="url"], input[type="datetime-local"], select {
  min-width: 0; min-height: 44px; padding: 10px 12px; border-color: #d7dfd8; border-radius: 9px; background: #fcfdfb;
}
input::placeholder { color:#77857c; opacity: 1; }
input:focus, select:focus { outline: 3px solid #e1efe6; border-color: var(--brand); background: #fff; }
.row { grid-template-columns: minmax(0,1fr) minmax(0,1.55fr) minmax(0,.85fr); gap: 18px; }
.row > div { min-width: 0; }
details.adv { margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf0eb; }
details.adv summary { margin:0; padding:3px 0; color:var(--brand); font-size:13px; }
details.adv[open] summary { margin-bottom: 16px; }
details.adv .row { grid-template-columns: repeat(4,minmax(0,1fr)); }
.actions { margin-top:18px; gap:14px; }
button.primary, .login a.btn { min-height: 42px; padding: 9px 22px; border-radius: 9px; letter-spacing: .01em; }
button.primary:hover:not(:disabled), .login a.btn:hover { background:#103f36; }
button.primary:disabled { cursor: not-allowed; }
button.mini { min-height: 32px; padding: 4px 11px; border-radius: 7px; line-height: 1.5; white-space: nowrap; }
button.mini:hover { background:#f0f5f0; border-color:#a3b8aa; }
button.mini.danger { border-color: #ecd7d7; background: #fff; }
button.mini.danger:hover { background: #fff1f0; border-color: #d6aaaa; }
.toolbar { gap: 10px; padding: 0 0 18px; margin:0; }
.toolbar input { max-width: 540px; flex: 1 1 180px; }
.toolbar button { min-height:44px; padding:8px 18px; }
#list { min-width:0; }
table { table-layout: fixed; font-size:14px; }
thead { background: #f5f7f3; }
th,td { padding:16px 12px; border-color: #e7ece6; overflow-wrap: anywhere; }
th { padding-top:12px; padding-bottom:12px; font-size:12px; font-weight:600; letter-spacing:.04em; }
th:first-child { width:24%; border-radius:8px 0 0 8px; }
th:nth-child(2) { width:22%; }
th:nth-child(3) { width:23%; }
th:nth-child(4) { width:8%; }
th:nth-child(5) { width:9%; }
th:last-child { width:14%; border-radius:0 8px 8px 0; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background: #fafcf9; }
td .url { font-size:12px; line-height:1.7; overflow-wrap:anywhere; word-break:break-word; }
td:first-child .url { color:var(--brand); font-weight:600; }
td:nth-child(2) { font-weight:650; }
td .muted { font-weight:400; font-size:12px; margin-top:5px; }
td:nth-child(3) .url { max-height:6.8em; overflow:auto; color:#66716b; scrollbar-width:thin; }
td:nth-child(4) { font-variant-numeric:tabular-nums; font-weight:700; }
td:nth-child(4) .muted { white-space:nowrap; }
td:last-child > div { gap:6px !important; }
.tag { white-space:nowrap; padding:4px 9px; line-height:1.5; font-weight:600; border-radius:6px; }
.tag.off { background:#f8eded; color:#943737; }
.empty { padding:54px 18px; background:#f8faf6; border:1px dashed #dce4dc; border-radius:10px; }
.login { width:calc(100% - 32px); max-width:460px; margin:clamp(48px,12vh,120px) auto 40px; }
.login .card { padding:36px 32px 32px; box-shadow:0 16px 48px #22362c0a; }
.login .card::before { content:"琢"; display:grid; place-items:center; width:52px; height:52px; margin:0 auto 22px; background:#e8dfbe; color:#453d27; border-radius:16px; font:32px/1 serif; }
.login h2 { font-size:23px; margin-bottom:12px; }
.login .muted { font-size:14px; line-height:1.8; margin:8px 0; }
.login a.btn { display:block; margin-top:24px; }
#login-hint:empty { display:none; }
dialog { max-height:calc(100dvh - 40px); border-radius:16px; width:min(580px,calc(100% - 32px)); box-shadow:0 24px 80px #10241c25; }
dialog::backdrop { background:#15261e66; }
dialog .body { padding:26px; }
dialog h3 { font-size:20px; margin-bottom:20px; }
dialog label { margin-top:16px; }
dialog .foot { position:sticky; bottom:0; padding:16px 26px; background:#fff; border-color:var(--line); }
dialog .foot .mini { min-height:42px; padding:8px 18px; }
.stat-grid { grid-template-columns:1fr 1fr; gap:14px; }
.stat-grid div { padding:18px; background:#f0f6f0; }
.stat-grid b { font-size:30px; font-variant-numeric:tabular-nums; margin-top:5px; }
.dist { margin:20px 0; }
.dist li { padding:9px 0; border-bottom:1px solid #edf0eb; }
#toast { max-width:calc(100% - 32px); box-shadow:0 6px 24px #18392a26; border-radius:10px; text-align:center; }
body.embedded { background:#f5f7f3; }
body.embedded main { max-width:none; padding:20px; }
body.embedded .card { border-radius:12px; padding:20px; margin-bottom:16px; box-shadow:none; }
body.embedded .card:last-child { margin-bottom:0; }
body.embedded .login { margin:40px auto; }
body.embedded .login .card { padding:28px; }
@media (max-width:1000px) {
  th,td { padding-left:8px; padding-right:8px; }
  th:first-child { width:23%; } th:nth-child(2) { width:21%; } th:nth-child(3) { width:23%; } th:last-child { width:16%; }
  .row { gap:12px; } details.adv .row { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  header.top { padding:14px 18px; } header.top h1 { font-size:18px; }
  header.top .who { max-width:100%; font-size:12px; gap:10px; }
  main { padding:18px 14px 32px; } .card { padding:18px; border-radius:12px; }
  .row { grid-template-columns:1fr; gap:14px; }
  table,tbody,tr,td { display:block; width:100%; }
  thead { display:none; }
  tr { padding:16px; margin-bottom:12px; border:1px solid var(--line); border-radius:10px; background:#fff; }
  tbody tr:last-child { margin-bottom:0; }
  td { display:grid; grid-template-columns:54px minmax(0,1fr); gap:8px 10px; padding:8px 0; border:0; font-weight:400; }
  td::before { content:attr(data-label); font:12px/1.8 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif; color:var(--muted); }
  td:first-child > div:last-child { grid-column:2; margin-top:0 !important; }
  td:nth-child(2) .muted,td:nth-child(4) .muted { grid-column:2; margin-top:0; }
  td:nth-child(3) .url { max-height:5.1em; }
  td:nth-child(2) { font-weight:600; }
  td .tag { width:fit-content; }
  td:last-child { margin-top:8px; padding-top:14px; border-top:1px solid #edf0eb; }
  td:last-child > div { gap:8px !important; }
  .toolbar input { max-width:none; }
  body.embedded main { padding:14px; } body.embedded .card { padding:16px; }
  body.embedded .login { margin:24px auto; }
}
@media (max-width:420px) {
  details.adv .row { grid-template-columns:1fr; }
  header.top .who span { max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  header.top h1::before { width:32px; height:32px; font-size:22px; }
  .login .card { padding:28px 22px; }
  dialog .body { padding:20px; } dialog .foot { padding:14px 20px; }
}
@media (prefers-reduced-motion:reduce) { button,a.btn,#toast { transition:none; } }
