/* 测试页共用亮色样式。新页只链本文件，不要再复制暗色 CSS。 */
:root {
    --bg: #f6f7f8;
    --surface: #ffffff;
    --text: #1b1d21;
    --muted: #5c6370;
    --line: #e4e6ea;
    --accent: #1a73e8;
    --ok: #0d7a3f;
    --ok-bg: #e8f6ee;
    --bad: #c62828;
    --bad-bg: #fdecea;
    --wait: #8a5a00;
    --wait-bg: #fff6e5;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    padding: 16px 16px 36px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
}
.mono, .kv th, .ready, .pill, .foot, .raw, #log, .url, .stamp .word, .sid, .tile .mark, .badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mast { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mast .kicker { font-size: 12px; color: var(--muted); }
.mast h1 { font-size: 22px; font-weight: 650; line-height: 1.25; margin: 4px 0 6px; color: var(--text); letter-spacing: -0.02em; }
.mast p { color: var(--muted); font-size: 13px; max-width: 40em; }

.ready {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
    background: var(--surface);
    border-radius: 4px;
}
.ready.is-on { border-color: #b7e0c6; color: var(--ok); background: var(--ok-bg); }
.ready.is-off { border-color: #f5c2c0; color: var(--bad); background: var(--bad-bg); }
.ready.is-wait { border-color: #f0d59a; color: var(--wait); background: var(--wait-bg); }

.outside {
    display: none;
    margin-bottom: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.outside h2 { font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: 6px; }
.outside p { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.outside img {
    display: block;
    width: 180px;
    height: 180px;
    background: #fff;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.outside .url, .url, .share .url {
    font-size: 12px;
    color: var(--accent);
    word-break: break-all;
    text-decoration: none;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.card-hd { overflow: hidden; margin-bottom: 8px; }
.card-hd .idx {
    float: left;
    font-size: 12px;
    color: var(--muted);
    margin-right: 8px;
    line-height: 22px;
}
.card-hd h2 {
    float: left;
    font-size: 15px;
    font-weight: 650;
    line-height: 22px;
    color: var(--text);
}

.pill {
    float: right;
    font-size: 11px;
    line-height: 20px;
    padding: 0 8px;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 999px;
    background: var(--bg);
}
.pill.wait { border-color: #f0d59a; color: var(--wait); background: var(--wait-bg); }
.pill.ok { border-color: #b7e0c6; color: var(--ok); background: var(--ok-bg); }
.pill.fail { border-color: #f5c2c0; color: var(--bad); background: var(--bad-bg); }
.pill.skip { color: var(--muted); }

.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td {
    text-align: left;
    vertical-align: top;
    padding: 6px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
}
.kv th { width: 36%; color: var(--muted); font-weight: 500; padding-right: 8px; font-size: 12px; }
.kv td { color: var(--text); word-break: break-all; }

.raw {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg);
    color: #3a4048;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 40vh;
    overflow: auto;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.hero {
    margin: 0 0 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.hero .label { font-size: 12px; color: var(--muted); }
.hero .value { font-size: 18px; font-weight: 650; line-height: 1.35; color: var(--text); margin-top: 4px; word-break: break-word; }
.hero.is-empty .value { color: var(--muted); font-weight: 500; }
.hero.is-on { border-color: #b7e0c6; background: var(--ok-bg); }
.hero.is-on .value { color: var(--ok); }
.hero.is-off { border-color: #f5c2c0; background: var(--bad-bg); }
.hero.is-off .value { color: var(--bad); }
.hero.is-warn { border-color: #f0d59a; background: var(--wait-bg); }
.hero.is-warn .value { color: var(--wait); }
.detail { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.note { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.row-btns, .actions { margin-top: 10px; overflow: hidden; }
.row-btns button, .actions button { margin: 0 8px 8px 0; }

button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: 600 14px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
    padding: 10px 14px;
    border-radius: 8px;
}
button:active { opacity: 0.8; }
button:disabled { opacity: 0.45; }
button.ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
}

.logbar { overflow: hidden; margin: 16px 0 6px; }
.logbar b { float: left; font-size: 13px; line-height: 28px; color: var(--muted); font-weight: 600; }
#log {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 100px;
    max-height: 30vh;
    overflow-y: auto;
    border-radius: 8px;
}
#log .t { color: var(--muted); }
#log .ok { color: var(--ok); }
#log .err { color: var(--bad); }
#log .info { color: var(--accent); }

.foot { margin-top: 14px; color: var(--muted); font-size: 12px; }
.toast { display: none; margin-top: 8px; font-size: 12px; color: var(--ok); }
.toast.is-on { display: block; }
.toast.is-bad { color: var(--bad); }
.hidden { display: none; }

.stamp { display: none; margin: 8px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.stamp.is-on { display: block; }
.stamp.is-ok { border-color: #b7e0c6; background: var(--ok-bg); }
.stamp.is-fail { border-color: #f5c2c0; background: var(--bad-bg); }
.stamp.is-wait { border-color: #f0d59a; background: var(--wait-bg); }
.stamp .word { font-size: 16px; font-weight: 650; color: var(--text); }
.stamp.is-ok .word { color: var(--ok); }
.stamp.is-fail .word { color: var(--bad); }
.stamp .sub { color: var(--muted); font-size: 13px; }

.share { display: none; margin-top: 8px; padding: 8px 10px; background: var(--ok-bg); border: 1px solid #b7e0c6; border-radius: 8px; }
.share.is-on { display: block; }

.secret { margin-top: 8px; }
.secret-btns { margin-top: 8px; }

.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.stat { min-width: 72px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.stat b { display: block; font-size: 18px; line-height: 1.2; color: var(--text); }
.stat span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.stat.warn b { color: var(--wait); }
.stat.bad b { color: var(--bad); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.filters button {
    margin: 0;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
}
.filters button.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

#q {
    width: 100%;
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
    padding: 9px 10px;
    margin: 0 0 10px;
    border-radius: 8px;
}

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid button.tile {
    width: 100%;
    margin: 0;
    padding: 8px 6px 7px;
    min-height: 92px;
    background: var(--bg);
    color: inherit;
    font: inherit;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.tile.is-on { border-color: var(--accent); }
.tile.is-bad { border-color: #f5c2c0; }
.tile.is-warn { border-color: #f0d59a; }
.icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.icon img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.icon .sid { font-size: 9px; line-height: 1.1; color: var(--muted); text-align: center; padding: 2px; word-break: break-all; }
.tile .name {
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    color: var(--text);
    max-height: 2.6em;
    overflow: hidden;
}
.tile .mark { display: block; margin-top: 4px; text-align: center; font-size: 9px; color: var(--bad); }
.tile .mark.warn { color: var(--wait); }
.empty { color: var(--muted); font-size: 12px; padding: 8px 0; }
#detail { display: none; }
#detail.is-on { display: block; }
.badge {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 2px 6px;
    border: 1px solid var(--line);
    font-size: 10px;
    line-height: 1.4;
    color: var(--muted);
    border-radius: 4px;
}
.badge.bad { border-color: #f5c2c0; color: var(--bad); background: var(--bad-bg); }
.badge.warn { border-color: #f0d59a; color: var(--wait); background: var(--wait-bg); }

.tabbar-label {
    margin: 10px 0 6px;
    font-size: 12px;
    color: var(--muted);
}
.tabbar-preview {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
    margin: 0 0 8px;
}
.tabbar-preview button.tab {
    flex: 1;
    margin: 0;
    padding: 8px 4px 6px;
    min-width: 0;
    min-height: 62px;
    background: transparent;
    color: inherit;
    font: inherit;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.tabbar-preview button.tab + button.tab { border-left: 1px solid var(--line); }
.tabbar-preview button.tab.is-on { background: var(--bg); }
.tabbar-preview button.tab.is-drop { opacity: 0.42; }
.tabbar-preview button.tab.is-warn { background: var(--wait-bg); }
.tabbar-preview .tab-icon {
    width: 22px;
    height: 22px;
    margin: 0 auto 4px;
    background: var(--bg);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.tabbar-preview .tab-icon img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tabbar-preview .tab-icon .sid { font-size: 8px; line-height: 1.1; color: var(--muted); text-align: center; padding: 1px; word-break: break-all; }
.tabbar-preview .tab-name {
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    color: var(--text);
    max-height: 2.5em;
    overflow: hidden;
}
.tabbar-preview .tab-type {
    display: block;
    margin-top: 2px;
    text-align: center;
    font-size: 9px;
    color: var(--muted);
}
.tabbar-preview .tab-type.bad { color: var(--bad); }
.tabbar-preview .tab-type.warn { color: var(--wait); }
#tabDetail { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
#tabDetail.is-on { display: block; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"], textarea, select {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.date-hero { margin: 0 0 8px; }
.date-hero .label { font-size: 12px; color: var(--muted); }
.date-hero .value { font-size: 20px; font-weight: 650; margin-top: 2px; }
.date-hero.is-null .value { color: var(--muted); font-weight: 500; }
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
button.mode, .mode {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    font-weight: 500;
}
button.mode.is-on, .mode.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.picked, .preview { color: var(--muted); font-size: 13px; margin: 6px 0; }
.basis-hd { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
#dateWrap.is-off { display: none; }
