/* Shared selection tools. All selectors are namespaced to protect existing themes. */
body[data-selection-theme] {
    --sel-ink: #2b2f35;
    --sel-accent: #a46412;
    --sel-soft: #eaf0f2;
    --sel-line: #dce3e5;
    --sel-muted: #596b76;
}
body[data-selection-theme="blue"] { --sel-ink: #285bdd; --sel-soft: #edf2ff; }
body[data-selection-theme="urban"] { --sel-ink: #242a30; --sel-accent: #805d38; --sel-soft: #edf0f2; }
body[data-selection-theme="gongkaohong"] { --sel-ink: #b0202b; --sel-accent: #885b14; --sel-soft: #faedef; }
body[data-selection-theme="campus"] { --sel-ink: #164b3d; --sel-soft: #eef3e8; }
.sel-page { margin: 0; background: #f3f5f5; color: #2b2f35; font: 14px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif; }
.sel-tools, .sel-main, .sel-nav, .sel-dock, .sel-drawer, .sel-entry, .sel-toast { box-sizing: border-box; font: 14px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif; }
.sel-tools *, .sel-main *, .sel-nav *, .sel-dock *, .sel-drawer * { box-sizing: border-box; }
.sel-main [hidden], .sel-drawer[hidden], .sel-dock[hidden], .sel-entry[hidden] { display: none !important; }
.sel-button, .sel-select, .sel-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--sel-line);
    border-radius: 4px;
    background: #fff;
    color: var(--sel-ink);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}
.sel-button:hover, .sel-tabs button:hover { background: var(--sel-soft); color: var(--sel-ink); }
.sel-button:focus-visible, .sel-select:focus-visible, .sel-tools input:focus-visible { outline: 2px solid var(--sel-accent); outline-offset: 3px; }
.sel-button:disabled, .sel-select:disabled { opacity: .6; cursor: not-allowed; }
.sel-primary, .sel-tabs button[aria-pressed="true"] { background: var(--sel-accent, #e60012); color: white; border-color: var(--sel-ink); }
.sel-primary:hover { background: var(--sel-accent, #e60012); color: white; filter: brightness(.92); }
.sel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; color: var(--sel-ink); }
.sel-tools label { display: inline-flex; align-items: center; gap: 5px; margin: 0; min-height: 36px; font-weight: 400; cursor: pointer; }
.sel-tools input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--sel-ink); }
.sel-tools .sel-select { max-width: 150px; font-size: 12px; }
.ra-list li.sel-analytics-row {
    flex-wrap: wrap;
}
.ra-list li.sel-analytics-row > .sel-tools {
    flex: 0 0 100%;
    min-width: 0;
    padding-top: 4px;
}
.sel-member-links { border: 1px solid var(--sel-line); padding: 12px; margin: 12px 0; background: #fff; border-radius: 6px; }
.sel-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-bottom: 1px solid var(--sel-line); padding: 10px max(16px, calc((100% - 1100px) / 2)); }
.sel-nav a { color: var(--sel-ink); text-decoration: none; }
.sel-nav nav { display: flex; align-items: center; gap: 14px; }
.sel-main { max-width: 1100px; padding: 18px 14px 110px; margin: auto; }
.sel-main h1 { margin: 0; font-size: 23px; color: var(--sel-ink); }
.sel-main h2, .sel-drawer h2 { margin: 0; font-size: 17px; color: var(--sel-ink); }
.sel-main p { margin: 5px 0; }
.sel-muted { color: var(--sel-muted); font-size: 12px; }
.sel-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.sel-card { background: #fff; border: 1px solid var(--sel-line); border-radius: 6px; margin: 10px 0; padding: 14px; }
.sel-card a, .sel-table a { color: var(--sel-ink); text-decoration: none; }
.sel-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sel-tag { display: inline-block; background: var(--sel-soft); padding: 3px 7px; border-radius: 3px; color: var(--sel-ink); font-size: 12px; white-space: nowrap; }
.sel-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; border-block: 1px solid var(--sel-line); padding: 8px 0; margin: 10px 0; }
.sel-metrics b { display: block; color: var(--sel-ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.sel-metrics span { color: var(--sel-muted); font-size: 12px; }
.sel-table-wrap { overflow-x: auto; border: 1px solid var(--sel-line); border-radius: 6px; background: white; margin-top: 12px; }
.sel-table { width: 100%; border-spacing: 0; table-layout: fixed; color: #2b2f35; }
.sel-table td, .sel-table th { padding: 10px 14px; border-right: 1px solid var(--sel-line); border-bottom: 1px solid var(--sel-line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sel-table thead th { background: var(--sel-soft); }
.sel-table th:first-child { position: sticky; left: 0; z-index: 1; width: 118px; background: #f8fafb; color: var(--sel-muted); font-weight: 400; }
.sel-table strong { font-size: 21px; color: var(--sel-ink); }
.sel-table .sel-select { width: 100%; }
.sel-bars { margin: 8px 0; max-width: 430px; }
.sel-bar { display: grid; grid-template-columns: 30px minmax(45px, 1fr) 52px; align-items: center; gap: 6px; font-size: 11px; color: var(--sel-muted); }
.sel-track { height: 6px; background: var(--sel-soft); }
.sel-fill { height: 100%; background: var(--sel-accent, #e60012); }
.sel-bar:last-child .sel-fill { background: var(--sel-accent); }
.sel-explanation { color: var(--sel-muted); font-size: 12px; margin-top: 12px; }
.sel-explanation summary { cursor: pointer; padding: 8px 0; }
.sel-empty { padding: 25px 15px; background: #fff; border: 1px solid var(--sel-line); border-radius: 6px; margin: 12px 0; }
.sel-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 12px 0; }
.sel-dock { position: fixed; z-index: 990; bottom: 0; inset-inline: 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--sel-line); display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--sel-ink); }
body.sel-has-selection { padding-bottom: 75px !important; }
.sel-dock b { font-size: 20px; color: var(--sel-accent); }
.sel-entry { position: fixed; right: 12px; top: 45%; z-index: 980; box-shadow: 0 3px 14px #17394b18; }
.sel-entry-symbol { font-size: 19px; line-height: 1; }
.sel-entry-label { margin: 0 6px; }
.sel-entry-count { min-width: 20px; text-align: center; font-size: 12px; font-weight: 800; }
.sel-drawer { position: fixed; z-index: 1010; top: 90px; bottom: 85px; right: 12px; width: 340px; max-width: calc(100vw - 24px); overflow-y: auto; padding: 15px; background: white; border: 1px solid var(--sel-line); border-radius: 7px; box-shadow: 0 6px 30px #17394b22; }
.sel-drawer > .sel-button { float: right; }
.sel-drawer p { color: var(--sel-muted); }
.sel-toast { position: fixed; z-index: 1100; bottom: 90px; left: 50%; transform: translateX(-50%); background: #343a40; color: white; padding: 9px 14px; border-radius: 5px; max-width: 90vw; }
.sel-toast:empty { display: none; }
@media (max-width: 700px) {
    .sel-main { padding: 12px 10px 100px; }
    .sel-main h1 { font-size: 18px; }
    .sel-main h2 { font-size: 16px; }
    .sel-nav { padding: 6px 12px; font-size: 12px; }
    .sel-nav a { min-height: 44px; display: inline-flex; align-items: center; }
    .sel-nav nav { gap: 10px; }
    .sel-tools { gap: 8px; }
    .sel-tools label, .sel-button, .sel-select { min-height: 44px; }
    .sel-metrics { gap: 4px; }
    .sel-metrics b { font-size: 17px; }
    .sel-metrics span { font-size: 11px; }
    .sel-table th:first-child { width: 84px; font-size: 12px; }
    .sel-table td, .sel-table th { padding: 9px; }
    .sel-entry { position: static; display: flex; width: max-content; margin: 8px 10px; box-shadow: none; }
    .sel-drawer { top: 65px; bottom: 80px; }
    .sel-dock { gap: 8px; justify-content: space-between; font-size: 12px; }
}
@media print {
    .sel-tools, .sel-dock, .sel-entry, .sel-drawer, .sel-toast { display: none !important; }
}
