:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #98a0b0;
  --accent: #f26e22;
  --ok: #35c07a;
  --warn: #e3b341;
  --err: #f0616d;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.head { display: flex; align-items: center; gap: 12px; padding: 6px 2px 2px; }
.head img { border-radius: 10px; }
h1 { font-size: 19px; margin: 0; letter-spacing: .2px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; flex: 1; }

.step {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.badge {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.off { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.bad { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.badge.quiet { border-style: dashed; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

input[type=url], input[type=text], input[type=password] {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px;
}
input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }

button {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: filter .15s, background .15s;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button:not(:disabled):hover { filter: brightness(1.12); }
.primary { background: var(--accent); color: #fff; }
.ghost { background: var(--card-2); color: var(--text); border-color: var(--line); }
.link { background: none; border: none; color: var(--muted); font-size: 12px; padding: 2px 4px; }

.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.hint.bad { color: var(--err); }

.lock { font-size: 13px; }
#authForm input { flex: 1 1 120px; }

.hint.lead { margin: 0; }

code {
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; color: var(--text);
}

.feeds { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feeds:empty { display: none; }
.feed {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 12px;
}
.feed-top { display: flex; align-items: baseline; gap: 8px; }
.feed-title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-url { color: var(--muted); font-size: 11.5px; word-break: break-all; margin-top: 2px; }
.feed-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.feed-err { color: var(--err); font-size: 12px; margin-top: 6px; }
.latest { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.latest li { font-size: 12.5px; padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest a { color: var(--muted); text-decoration: none; }
.latest a:hover { color: var(--text); }

.log-card { background: transparent; }
.log {
  margin: 0; max-height: 190px; overflow: auto;
  font: 11.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); white-space: pre-wrap; word-break: break-word;
}

.foot {
  display: flex; justify-content: space-between; gap: 10px;
  color: var(--muted); font-size: 11.5px; padding: 0 4px;
}
