/* ============================================================
   #12 文字反转 · 镜像实验室设计系统（rvt-）
   雾紫白 + 靛紫 + 电光洋红 + 冰蓝辅助；浅色为默认主题
   深色由 :root[data-theme="dark"] 整套覆盖，跟随导航 #themeToggle
   ============================================================ */
.rvt-page, .rvt-modal, .rvt-toast {
    --rvt-bg: #f5f2fc;
    --rvt-bg2: #ece6fa;
    --rvt-panel: #ffffff;
    --rvt-panel2: #f8f5fe;
    --rvt-ink: #241a49;
    --rvt-sub: #6c6289;
    --rvt-line: #e0d8f2;
    --rvt-line2: #c9bceb;
    --rvt-brand: #45319c;
    --rvt-brand2: #2f1f73;
    --rvt-magenta: #d3389b;
    --rvt-magenta-soft: #fce8f5;
    --rvt-blue: #3b74d9;
    --rvt-warn: #b4591e;
    --rvt-ok: #2b7a68;
    --rvt-shadow: 0 14px 34px rgba(60, 40, 130, .12);
    --rvt-shadow-sm: 0 4px 13px rgba(60, 40, 130, .09);
    --rvt-r: 14px;
    --rvt-font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    --rvt-mono: "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
}
:root[data-theme="dark"] .rvt-page,
:root[data-theme="dark"] .rvt-modal,
:root[data-theme="dark"] .rvt-toast {
    --rvt-bg: #141021;
    --rvt-bg2: #1c1730;
    --rvt-panel: #1d1733;
    --rvt-panel2: #241d3d;
    --rvt-ink: #ece5ff;
    --rvt-sub: #aa9dc9;
    --rvt-line: #342a55;
    --rvt-line2: #4b3c78;
    --rvt-brand: #b9a6ff;
    --rvt-brand2: #d4c8ff;
    --rvt-magenta: #ff8bd0;
    --rvt-magenta-soft: #3b1f3b;
    --rvt-blue: #8fb6ff;
    --rvt-warn: #ffb27a;
    --rvt-ok: #79d7b4;
    --rvt-shadow: 0 14px 34px rgba(0, 0, 0, .38);
    --rvt-shadow-sm: 0 4px 13px rgba(0, 0, 0, .30);
}
.rvt-page { background: var(--rvt-bg); color: var(--rvt-ink); font-family: var(--rvt-font); font-size: 14px; line-height: 1.78; padding: 0 0 64px; min-height: 62vh; }
.rvt-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 18px 0; }
.rvt-page .detail-breadcrumb { font-size: 12.5px; color: var(--rvt-sub); margin: 8px 0 18px; }
.rvt-page .detail-breadcrumb a { color: var(--rvt-sub); text-decoration: none; }
.rvt-page .detail-breadcrumb a:hover { color: var(--rvt-magenta); }
.rvt-page .detail-breadcrumb .current { color: var(--rvt-brand); font-weight: 700; }
.rvt-page h1 { font-size: 39px; font-weight: 850; letter-spacing: -1px; line-height: 1.16; margin: 0 0 12px; }

/* ---------- 首屏 ---------- */
.rvt-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: stretch; margin-bottom: 24px; }
.rvt-kicker { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: 1.5px; font-weight: 800; color: var(--rvt-brand); margin-bottom: 14px; }
.rvt-kicker-line { width: 26px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--rvt-brand), var(--rvt-magenta)); }
.rvt-sub { font-size: 15px; line-height: 1.95; color: var(--rvt-sub); margin: 0 0 18px; max-width: 600px; }
.rvt-sub b { color: var(--rvt-ink); font-weight: 750; }
.rvt-facts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rvt-fact { background: var(--rvt-panel); border: 1px solid var(--rvt-line); border-radius: 12px; padding: 9px 17px; min-width: 112px; box-shadow: var(--rvt-shadow-sm); border-bottom: 3px solid var(--rvt-line2); }
.rvt-fact b { display: block; font-size: 21px; font-family: var(--rvt-mono); font-weight: 800; line-height: 1.3; }
.rvt-fact span { font-size: 11.5px; color: var(--rvt-sub); }
.rvt-fact-hot { border-bottom-color: var(--rvt-magenta); background: var(--rvt-magenta-soft); }
.rvt-fact-hot b { color: var(--rvt-magenta); }
.rvt-points { list-style: none; padding: 0; margin: 0; }
.rvt-points li { font-size: 12.5px; color: var(--rvt-sub); line-height: 2.05; }

.rvt-input-card { background: var(--rvt-panel); border: 1px solid var(--rvt-line2); border-radius: 16px; padding: 14px; box-shadow: var(--rvt-shadow); display: flex; flex-direction: column; min-width: 0; }
.rvt-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.rvt-card-label { font-size: 11.5px; font-weight: 750; color: var(--rvt-brand); letter-spacing: .3px; }
.rvt-input-card textarea {
    flex: 1; min-height: 176px; resize: vertical; border: 1px solid var(--rvt-line); border-radius: 10px;
    background: var(--rvt-panel2); color: var(--rvt-ink); padding: 13px 14px; font-family: var(--rvt-mono);
    font-size: 14px; line-height: 1.9; box-sizing: border-box; width: 100%;
}
.rvt-input-card textarea:focus { outline: 2px solid var(--rvt-magenta); outline-offset: 0; }
.rvt-input-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rvt-input-foot > span { font-size: 11px; color: var(--rvt-sub); }
.rvt-input-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 通用件 ---------- */
.rvt-btn { border: 1px solid var(--rvt-line2); background: var(--rvt-panel); color: var(--rvt-ink); border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: transform .12s, box-shadow .12s; }
.rvt-btn:hover { transform: translateY(-1px); box-shadow: var(--rvt-shadow-sm); }
.rvt-btn-main { background: var(--rvt-brand); border-color: var(--rvt-brand2); color: #fff; }
:root[data-theme="dark"] .rvt-btn-main { color: #17102e; }
.rvt-btn-main:hover { background: var(--rvt-brand2); }
.rvt-mini { border: 1px solid var(--rvt-line2); background: var(--rvt-panel2); color: var(--rvt-sub); border-radius: 7px; padding: 5px 10px; font-size: 11.5px; font-weight: 650; cursor: pointer; font-family: inherit; }
.rvt-mini:hover { color: var(--rvt-magenta); border-color: var(--rvt-magenta); }
.rvt-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 11px; }
.rvt-section-head h2 { font-size: 19px; font-weight: 800; margin: 0; }
.rvt-section-head h2 span { font-size: 12.5px; font-weight: 500; color: var(--rvt-sub); }
.rvt-card { background: var(--rvt-panel); border: 1px solid var(--rvt-line); border-radius: var(--rvt-r); padding: 16px; box-shadow: var(--rvt-shadow-sm); min-width: 0; }
.rvt-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 11px; }
.rvt-card-head h3 { font-size: 14.5px; font-weight: 800; margin: 0; }
.rvt-badge { font-size: 11px; color: var(--rvt-brand); background: var(--rvt-magenta-soft); border: 1px solid var(--rvt-line); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.rvt-empty { font-size: 12px; color: var(--rvt-sub); }

/* ---------- 模式卡 ---------- */
.rvt-modes { margin-bottom: 20px; }
.rvt-mode-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rvt-mode {
    display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; font-family: inherit;
    background: var(--rvt-panel); border: 1px solid var(--rvt-line); border-radius: 12px; padding: 12px 13px;
    box-shadow: var(--rvt-shadow-sm); transition: transform .12s, border-color .12s;
}
.rvt-mode:hover { transform: translateY(-2px); border-color: var(--rvt-magenta); }
.rvt-mode.is-on { border-color: var(--rvt-brand); background: linear-gradient(150deg, var(--rvt-panel), var(--rvt-magenta-soft)); box-shadow: 0 0 0 2px rgba(211,56,155,.16); }
.rvt-mode b { font-size: 14px; color: var(--rvt-ink); }
.rvt-mode span { font-size: 11.5px; color: var(--rvt-sub); line-height: 1.5; }
.rvt-mode small { font-size: 10.5px; color: var(--rvt-magenta); }

/* ---------- 镜像双栏 ---------- */
.rvt-mirror { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); gap: 0; align-items: stretch; margin-bottom: 18px; }
.rvt-pane { background: var(--rvt-panel); border: 1px solid var(--rvt-line); border-radius: var(--rvt-r) 0 0 var(--rvt-r); overflow: hidden; min-width: 0; }
.rvt-pane-out { border-radius: 0 var(--rvt-r) var(--rvt-r) 0; border-color: var(--rvt-magenta); }
.rvt-pane-head { display: flex; justify-content: space-between; gap: 8px; padding: 9px 14px; background: var(--rvt-panel2); border-bottom: 1px solid var(--rvt-line); font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--rvt-brand); }
.rvt-pane-out .rvt-pane-head { color: var(--rvt-magenta); background: var(--rvt-magenta-soft); }
.rvt-pane-tag { font-weight: 600; letter-spacing: 0; color: var(--rvt-sub); }
.rvt-pane-body { min-height: 172px; max-height: 320px; overflow: auto; }
.rvt-pane-body pre { margin: 0; padding: 14px; font-family: var(--rvt-mono); font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; color: var(--rvt-ink); }
.rvt-pane-out .rvt-pane-body pre { color: var(--rvt-brand); }
:root[data-theme="dark"] .rvt-pane-out .rvt-pane-body pre { color: var(--rvt-brand2); }
.rvt-axis { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(180deg, transparent, var(--rvt-bg2), transparent); }
.rvt-axis-line { flex: 1; width: 1px; background: repeating-linear-gradient(180deg, var(--rvt-line2) 0 5px, transparent 5px 10px); }
.rvt-axis-arrow { width: 40px; height: 40px; border-radius: 50%; background: var(--rvt-brand); color: #fff; display: grid; place-items: center; font-size: 21px; box-shadow: var(--rvt-shadow-sm); }
.rvt-axis-label { font-size: 9px; letter-spacing: 1.2px; color: var(--rvt-sub); font-weight: 800; }

/* ---------- 选项 ---------- */
.rvt-controls { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; margin-bottom: 20px; align-items: start; }
.rvt-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--rvt-ink); padding: 5px 0; cursor: pointer; }
.rvt-check input { accent-color: var(--rvt-magenta); }
.rvt-field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 12px; font-size: 11.5px; color: var(--rvt-sub); font-weight: 650; }
.rvt-field select { border: 1px solid var(--rvt-line2); border-radius: 8px; padding: 7px 9px; background: var(--rvt-panel2); color: var(--rvt-ink); font-size: 12.5px; font-family: inherit; }
.rvt-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.rvt-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rvt-stat-grid > div { background: var(--rvt-panel2); border: 1px solid var(--rvt-line); border-radius: 10px; padding: 9px; text-align: center; }
.rvt-stat-grid b { display: block; font-size: 18px; font-family: var(--rvt-mono); color: var(--rvt-brand); }
.rvt-stat-grid span { font-size: 10.5px; color: var(--rvt-sub); }
.rvt-detect { list-style: none; padding: 0; margin: 0; }
.rvt-detect li { font-size: 11.5px; line-height: 1.75; color: var(--rvt-sub); padding: 5px 0 5px 18px; position: relative; border-bottom: 1px dashed var(--rvt-line); }
.rvt-detect li::before { content: "·"; position: absolute; left: 5px; color: var(--rvt-blue); font-weight: 800; }
.rvt-detect li.is-warn { color: var(--rvt-warn); }
.rvt-detect li.is-warn::before { content: "!"; }

/* ---------- 转义 / 批量 ---------- */
.rvt-lower { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.rvt-escape-list { display: flex; flex-direction: column; gap: 8px; }
.rvt-escape-row { border: 1px solid var(--rvt-line); border-radius: 9px; padding: 9px 11px; background: var(--rvt-panel2); min-width: 0; }
.rvt-escape-row .rvt-escape-name { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--rvt-brand); margin-bottom: 4px; }
.rvt-escape-row code { display: block; font-family: var(--rvt-mono); font-size: 11.5px; line-height: 1.6; word-break: break-all; color: var(--rvt-ink); max-height: 66px; overflow: auto; }
.rvt-table-scroll { overflow-x: auto; }
.rvt-table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 12px; }
.rvt-table th, .rvt-table td { padding: 8px 9px; border-bottom: 1px solid var(--rvt-line); text-align: left; vertical-align: top; }
.rvt-table th { font-size: 11.5px; color: var(--rvt-sub); background: var(--rvt-panel2); }
.rvt-table td { font-family: var(--rvt-mono); word-break: break-all; }
.rvt-table td.rvt-empty { text-align: center; font-family: var(--rvt-font); padding: 18px; }

/* ---------- 弹窗 / toast ---------- */
.rvt-modal[hidden] { display: none !important; }
.rvt-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: rgba(28, 18, 58, .62); padding: 18px; font-family: var(--rvt-font); color: var(--rvt-ink); }
.rvt-modal-card { background: var(--rvt-panel); border: 1px solid var(--rvt-line2); border-radius: 15px; padding: 24px; width: min(480px, 100%); box-shadow: var(--rvt-shadow); position: relative; }
.rvt-modal-card h3 { font-size: 19px; margin: 0 0 12px; font-weight: 800; }
.rvt-modal-card p { font-size: 13px; line-height: 1.85; color: var(--rvt-sub); margin: 0 0 10px; }
.rvt-modal-card input { width: 100%; box-sizing: border-box; font-family: var(--rvt-mono); font-size: 11.5px; padding: 9px; border: 1px solid var(--rvt-line2); border-radius: 8px; background: var(--rvt-panel2); color: var(--rvt-ink); margin-bottom: 14px; }
.rvt-modal-x { position: absolute; right: 11px; top: 8px; border: 0; background: transparent; color: var(--rvt-sub); font-size: 24px; cursor: pointer; line-height: 1; }
.rvt-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); background: var(--rvt-brand); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: var(--rvt-shadow); z-index: 950; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-family: var(--rvt-font); }
:root[data-theme="dark"] .rvt-toast { color: #17102e; }
.rvt-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
    .rvt-hero, .rvt-controls, .rvt-lower { grid-template-columns: minmax(0, 1fr); }
    .rvt-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rvt-page h1 { font-size: 32px; }
}
@media (max-width: 620px) {
    .rvt-wrap { padding: 12px 12px 0; }
    .rvt-page h1 { font-size: 27px; }
    .rvt-sub { font-size: 14px; line-height: 1.85; }
    .rvt-mirror { grid-template-columns: minmax(0, 1fr); }
    .rvt-pane, .rvt-pane-out { border-radius: var(--rvt-r); }
    .rvt-pane-out { margin-top: 10px; }
    .rvt-axis { flex-direction: row; height: 40px; }
    .rvt-axis-line { height: 1px; width: auto; background: repeating-linear-gradient(90deg, var(--rvt-line2) 0 5px, transparent 5px 10px); }
    .rvt-axis-label { display: none; }
    .rvt-arrow-holder { display: none; }
    .rvt-mode-grid { grid-template-columns: minmax(0, 1fr); }
    .rvt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
