:root {
  --bg: #f5f6f8; --card: #fff; --text: #1c1e21; --muted: #6b7280;
  --border: #e3e5e8; --primary: #2563eb; --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --card: #1b1e24; --text: #e8eaed; --muted: #9aa0a8; --border: #2b2f37; --primary: #4c8dff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 18px; }
.actions { display: flex; gap: 4px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.icon-btn.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.host-info { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 13px; word-break: break-all; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.host-info.ok .dot { background: var(--ok); }
.host-info.fail .dot { background: var(--danger); }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
input[type=search], input[type=url] { flex: 1; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); margin-bottom: 12px; font-size: 14px; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.item .icon { font-size: 24px; flex: none; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 12px; color: var(--muted); }
.item .meta.soon { color: var(--warn); }
.item .meta.expired { color: var(--danger); }
.item .btns { display: flex; gap: 6px; flex: none; }
dialog { width: min(440px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 6px; font-size: 18px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20; }
[hidden] { display: none !important; }
@media (max-width: 480px) { .item { flex-wrap: wrap; } .item .btns { width: 100%; } .item .btns .btn { flex: 1; } }
