/* 技术标格式检查 —— 内部页面样式
   视觉沿用合同审查页（internal-contract-review.css）的配色与组件形态，
   命名统一用 ab- 前缀，不依赖、也不覆盖其他内部页面的样式表。 */

:root {
    --ab-bg: #f5f6f8;
    --ab-surface: #ffffff;
    --ab-border: #e3e6ec;
    --ab-text: #1f2430;
    --ab-muted: #6b7280;
    --ab-primary: #1a5fb4;
    --ab-primary-dark: #16509a;
    --ab-primary-soft: #eef4fc;
    --ab-blocking: #d92d20;
    --ab-blocking-bg: #fef3f2;
    --ab-major: #d97706;
    --ab-major-bg: #fffaeb;
    --ab-minor: #2563eb;
    --ab-minor-bg: #eff6ff;
    --ab-review: #6b7280;
    --ab-review-bg: #f3f4f6;
}

body {
    background: var(--ab-bg);
    color: var(--ab-text);
}

.ab-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 20px 40px;
}

[hidden] { display: none !important; }

/* ── Topbar ─────────────────────────────────────────── */
.ab-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--ab-border);
    margin-bottom: 20px;
}

.ab-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ab-muted);
}
.ab-breadcrumb a { color: var(--ab-muted); text-decoration: none; }
.ab-breadcrumb a:hover { color: var(--ab-primary); }
.ab-breadcrumb strong { color: var(--ab-text); }
.ab-breadcrumb .sep { color: #c3c8d2; }

.ab-topbar-right { display: flex; align-items: center; gap: 12px; }
.ab-user { font-size: 14px; color: var(--ab-muted); }

/* ── 提示条 ──────────────────────────────────────────── */
.ab-notice {
    display: flex;
    gap: 12px;
    background: #fff8eb;
    border: 1px solid #f6d9a8;
    color: #7a4a0a;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}
.ab-notice i { margin-top: 4px; }

.ab-error {
    background: var(--ab-blocking-bg);
    border: 1px solid #f4c3bf;
    color: var(--ab-blocking);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── 卡片 ────────────────────────────────────────────── */
.ab-card {
    background: var(--ab-surface);
    border: 1px solid var(--ab-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.ab-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    margin: 0 0 12px;
}
.ab-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ab-primary);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.ab-subtitle { font-size: 15px; margin: 20px 0 8px; }
.ab-hint { color: var(--ab-muted); font-size: 14px; line-height: 1.7; margin: 0 0 12px; }
.ab-muted { color: var(--ab-muted); font-size: 13px; }
.ab-danger { color: var(--ab-blocking); }

/* ── 表单 ────────────────────────────────────────────── */
.ab-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.ab-input {
    border: 1px solid var(--ab-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ab-text);
    background: #fff;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}
textarea.ab-input { width: 100%; resize: vertical; line-height: 1.6; }
.ab-input:focus { outline: none; border-color: var(--ab-primary); box-shadow: 0 0 0 3px var(--ab-primary-soft); }
.ab-input-narrow { flex: 0 0 auto; width: auto; }
.ab-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }


/* ── 按钮 ────────────────────────────────────────────── */
.ab-btn {
    border: 1px solid var(--ab-border);
    background: var(--ab-surface);
    color: var(--ab-text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, border-color .15s;
}
.ab-btn:hover:not(:disabled) { border-color: #c9cedb; background: #f8f9fb; }
.ab-btn:disabled { opacity: .55; cursor: not-allowed; }
.ab-btn-primary { background: var(--ab-primary); border-color: var(--ab-primary); color: #fff; }
.ab-btn-primary:hover:not(:disabled) { background: var(--ab-primary-dark); border-color: var(--ab-primary-dark); }
.ab-btn-ghost { border-color: transparent; background: transparent; color: var(--ab-muted); }
.ab-btn-ghost:hover:not(:disabled) { background: #eceef3; }
.ab-btn-danger { color: var(--ab-blocking); border-color: #f4c3bf; }
a.ab-btn { text-decoration: none; }
a.ab-btn.is-done { background: #fff; color: var(--ab-primary); border-color: var(--ab-primary); }
a.ab-btn.is-disabled { opacity: .45; pointer-events: none; }

.ab-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.ab-placeholder { color: var(--ab-muted); font-size: 14px; padding: 18px 0; text-align: center; }

/* ── 检查规则：Word 功能区（Ribbon）───────────────────
   参照 Office Fluent：浅灰选项卡条 + Word 蓝下划线、白色功能区、
   组之间细竖线分隔、组名在组底部居中、24px 高的紧凑控件。 */
.ab-card-rules { padding-bottom: 20px; }
.ab-card-head .ab-hint { margin-bottom: 14px; }

.rb {
    --rb-blue: #185abd;
    --rb-blue-soft: #e6effa;
    --rb-blue-line: #a9c6ec;
    --rb-bar: #f3f2f1;
    --rb-line: #e1dfdd;
    --rb-control: #c8c6c4;
    --rb-caption: #605e5c;
    --rb-ink: #252423;
    border: 1px solid var(--rb-line);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    font-family: "Segoe UI", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    color: var(--rb-ink);
}

.rb-bar {
    display: flex;
    align-items: stretch;
    background: var(--rb-bar);
    border-bottom: 1px solid var(--rb-line);
    min-width: 0;
}

/* 模式开关占「文件」选项卡的位置：Word 里那一格是实心蓝 */
.rb-mode {
    display: flex;
    flex-shrink: 0;
    background: var(--rb-blue);
    padding: 0 4px;
}
.rb-mode button {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font: inherit;
    font-size: 13px;
    padding: 0 12px;
    cursor: pointer;
    position: relative;
    transition: color .12s, background-color .12s;
}
.rb-mode { gap: 2px; padding: 5px; }
.rb-mode button { border-radius: 3px; }
.rb-mode button[aria-checked="true"] { color: var(--rb-blue); font-weight: 600; background: #fff; }
.rb-mode button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.rb-tabs {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.rb-tabs::-webkit-scrollbar { display: none; }
.rb-tab {
    position: relative;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    color: var(--rb-ink);
    padding: 10px 14px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color .12s, color .12s;
}
.rb-tab::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 2px 2px 0 0;
    background: var(--rb-blue);
    transform: scaleX(0);
    transition: transform .16s cubic-bezier(0.23, 1, 0.32, 1);
}
.rb-tab.is-active { color: var(--rb-blue); font-weight: 600; }
.rb-tab.is-active::after { transform: scaleX(1); }
.rb-tab:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
    .rb-tab:hover { background: #e9e8e7; }
    .rb-mode button:hover { color: #fff; }
}
.rb-badge {
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--rb-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 17px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

/* 功能区主体：组横排，超宽时横向滚动（Word 窗口变窄时也是收折而不是换行） */
.rb-body {
    display: flex;
    align-items: stretch;
    min-height: 132px;
    overflow-x: auto;
    background: #fff;
}
.rb-body > .ab-placeholder { flex: 1; align-self: center; }
.rb-group {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 10px 12px 4px;
    position: relative;
}
.rb-group + .rb-group::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: var(--rb-line);
}
.rb-group-inner { flex: 1; display: flex; gap: 12px; align-items: flex-start; }
.rb-caption {
    text-align: center;
    font-size: 12px;
    color: var(--rb-caption);
    padding: 6px 0 4px;
    white-space: nowrap;
}

/* 行：复选框 + 标签 + 控件 */
.rb-rows { display: flex; flex-direction: column; gap: 6px; }
.rb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    border-radius: 3px;
    padding: 0 4px;
    margin: 0 -4px;
    transition: background-color .5s;
}
.rb-row.is-flash { background: #fff4ce; transition: none; }
.rb-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    min-width: 4.4em;
    cursor: pointer;
    white-space: nowrap;
    color: var(--rb-caption);
}
.rb-row.is-on .rb-check { color: var(--rb-ink); font-weight: 600; }
.rb-check input, .rb-mini-check input { accent-color: var(--rb-blue); width: 15px; height: 15px; margin: 0; }
.rb-review { color: #a19f9d; font-size: 12px; font-weight: normal; }
.rb-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rb-row:not(.is-on) .rb-fields { opacity: .6; }
.rb-row:not(.is-on) .rb-fields:focus-within { opacity: 1; }
.rb-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--rb-caption); }
.rb-unit { font-size: 12px; color: var(--rb-caption); }
.rb-mini-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--rb-caption); cursor: pointer; }

.rb-input {
    height: 26px;
    border: 1px solid var(--rb-control);
    border-radius: 2px;
    padding: 0 6px;
    font: inherit;
    font-size: 13px;
    color: var(--rb-ink);
    background: #fff;
    box-sizing: border-box;
    width: 7.5em;
    transition: border-color .12s;
}
select.rb-input { padding-right: 2px; width: auto; min-width: 5em; }
.rb-input-num { width: 4.4em; font-variant-numeric: tabular-nums; }
.rb-input-len { width: 5.2em; font-variant-numeric: tabular-nums; }
.rb-input-size { width: 5.2em; }
.rb-input-font { width: 9.5em; }
.rb-input-wide { width: 13em; }
.rb-input:focus { outline: none; border-color: var(--rb-blue); box-shadow: inset 0 -1px 0 var(--rb-blue); }
@media (hover: hover) and (pointer: fine) {
    .rb-input:hover:not(:focus) { border-color: #8a8886; }
}

/* 页边距：Word「页面设置」对话框里的上下左右 2×2 */
.rb-layout-grid { flex-direction: column; align-items: flex-start; }
.rb-layout-grid .rb-fields { display: grid; grid-template-columns: auto auto; gap: 6px 12px; }
.rb-layout-stack { flex-direction: column; align-items: flex-start; }
.rb-layout-stack .rb-fields { flex-direction: column; align-items: flex-start; }

/* 样式库：Word「开始」选项卡的样式框 */
.rb-gallery {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    gap: 2px;
    border: 1px solid var(--rb-line);
    padding: 2px;
    border-radius: 2px;
}
.rb-style {
    border: 1px solid transparent;
    background: #fff;
    height: 60px;
    padding: 3px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font: inherit;
    border-radius: 2px;
    transition: background-color .12s, border-color .12s;
}
.rb-style-sample { color: var(--rb-ink); line-height: 1.2; margin-top: 6px; }
.rb-style-0 { font-size: 13px; }
.rb-style-1 { font-size: 16px; font-weight: 600; }
.rb-style-2 { font-size: 14.5px; font-weight: 600; }
.rb-style-3 { font-size: 13.5px; font-weight: 600; }
.rb-style-name { font-size: 11.5px; color: var(--rb-caption); display: inline-flex; align-items: center; gap: 3px; }
.rb-style.is-active { background: var(--rb-blue-soft); border-color: var(--rb-blue-line); }
.rb-style.is-active .rb-style-name { color: var(--rb-blue); }
.rb-style:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
    .rb-style:not(.is-active):hover { background: var(--rb-bar); }
}
.rb-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--rb-blue); display: inline-block; }

/* 开关按钮：Word 的「加粗 / 倾斜」按下态 */
.rb-toggles {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(60px, auto));
    gap: 2px;
}
.rb-rows + .rb-toggles { border-left: 1px dashed var(--rb-line); padding-left: 10px; }
.rb-toggle, .rb-icon-btn {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    font: inherit;
    color: var(--rb-ink);
    transition: background-color .12s, border-color .12s, transform .1s;
}
.rb-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 6px 4px;
}
.rb-toggle.is-large { padding: 8px 10px 6px; min-height: 84px; justify-content: center; }
.rb-toggle-icon { position: relative; font-size: 15px; height: 18px; display: inline-flex; align-items: center; }
.rb-toggle.is-large .rb-toggle-icon { font-size: 26px; height: 32px; }
.rb-swatch { position: absolute; left: -2px; right: -2px; bottom: -3px; height: 3px; background: #252423; }
.rb-toggle-label { font-size: 12px; white-space: nowrap; color: var(--rb-caption); }
.rb-toggle.is-pressed, .rb-icon-btn.is-pressed { background: var(--rb-blue-soft); border-color: var(--rb-blue-line); }
.rb-toggle.is-pressed .rb-toggle-icon, .rb-icon-btn.is-pressed { color: var(--rb-blue); }
.rb-toggle.is-pressed .rb-toggle-label { color: var(--rb-ink); font-weight: 600; }
.rb-toggle:active, .rb-icon-btn:active { transform: scale(0.97); }
.rb-toggle:focus-visible, .rb-icon-btn:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
    .rb-toggle:not(.is-pressed):hover, .rb-icon-btn:not(.is-pressed):hover { background: var(--rb-bar); }
}

.rb-align { display: flex; gap: 2px; }
.rb-icon-btn { width: 32px; height: 30px; font-size: 14px; }
.rb-align-note { font-size: 12px; color: var(--rb-caption); margin-top: 8px; white-space: nowrap; }
.rb-group-inner:has(.rb-align) { flex-direction: column; gap: 0; align-items: center; }

/* 状态栏：已设定的检查项 */
.rb-status {
    border-top: 1px solid var(--rb-line);
    background: var(--rb-bar);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--rb-caption);
}
.rb-status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.rb-status-head strong { color: var(--rb-blue); font-variant-numeric: tabular-nums; }
.rb-link { border: 0; background: none; color: var(--rb-blue); font: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 4px; }
.rb-link:hover { text-decoration: underline; }
.rb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rb-chip {
    border: 1px solid var(--rb-line);
    background: #fff;
    border-radius: 3px;
    padding: 2px 8px;
    font: inherit;
    font-size: 12px;
    color: var(--rb-ink);
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color .12s;
}
@media (hover: hover) and (pointer: fine) {
    .rb-chip:hover { border-color: var(--rb-blue-line); color: var(--rb-blue); }
}

@media (prefers-reduced-motion: reduce) {
    .rb-tab::after, .rb-toggle, .rb-icon-btn, .rb-row { transition: none; }
}

/* 手机：组纵向堆叠，组名移到组上方，控件整行 */
@media (max-width: 720px) {
    .rb-bar { flex-direction: column; }
    .rb-mode { padding: 4px; justify-content: stretch; }
    .rb-mode button { flex: 1; padding: 7px 0; border-radius: 3px; }
    .rb-body { flex-direction: column; overflow-x: visible; min-height: 0; }
    .rb-group { padding: 4px 12px 12px; flex-direction: column-reverse; }
    .rb-group + .rb-group::before { left: 12px; right: 12px; top: 0; bottom: auto; width: auto; height: 1px; }
    .rb-caption { text-align: left; font-weight: 600; color: var(--rb-ink); padding: 10px 0 8px; }
    .rb-group-inner { flex-direction: column; align-items: stretch; }
    .rb-group-inner:has(.rb-align) { align-items: flex-start; }
    .rb-row { flex-wrap: wrap; }
    .rb-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .rb-toggles { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
    .rb-rows + .rb-toggles { border-left: 0; padding-left: 0; border-top: 1px dashed var(--rb-line); padding-top: 8px; }
    .rb-toggle.is-large { min-height: 0; }
    .rb-input-wide { width: 100%; }
    .rb-fields { flex: 1 1 100%; padding-left: 21px; }
    .rb-layout-grid .rb-fields, .rb-layout-stack .rb-fields { padding-left: 21px; }
}

/* ── 上传 ────────────────────────────────────────────── */
.ab-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px dashed #c9cedb;
    border-radius: 12px;
    padding: 26px 16px;
    color: var(--ab-muted);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ab-drop input { display: none; }
.ab-drop i { font-size: 28px; color: var(--ab-primary); }
.ab-drop.is-over, .ab-drop:hover { border-color: var(--ab-primary); background: var(--ab-primary-soft); }
.ab-drop.has-file { border-style: solid; color: var(--ab-text); }
.ab-drop strong { word-break: break-all; }

.ab-progress { margin-top: 14px; }
.ab-progress-bar { height: 8px; background: #eef0f4; border-radius: 999px; overflow: hidden; }
.ab-progress-bar span { display: block; height: 100%; width: 0; background: var(--ab-primary); transition: width .3s; }
.ab-progress-text { font-size: 13px; color: var(--ab-muted); margin-top: 6px; }

/* ── 结果 ────────────────────────────────────────────── */
.ab-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ab-tile { border-radius: 10px; padding: 12px; text-align: center; }
.ab-tile-num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.ab-tile-label { font-size: 13px; }
.ab-sev-blocking { background: var(--ab-blocking-bg); color: var(--ab-blocking); }
.ab-sev-major { background: var(--ab-major-bg); color: var(--ab-major); }
.ab-sev-minor { background: var(--ab-minor-bg); color: var(--ab-minor); }
.ab-sev-review { background: var(--ab-review-bg); color: var(--ab-review); }
.ab-sev-tag-blocking { background: var(--ab-blocking-bg); color: var(--ab-blocking); }
.ab-sev-tag-major { background: var(--ab-major-bg); color: var(--ab-major); }
.ab-sev-tag-minor { background: var(--ab-minor-bg); color: var(--ab-minor); }
.ab-sev-tag-review { background: var(--ab-review-bg); color: var(--ab-review); }

.ab-group { border: 1px solid var(--ab-border); border-radius: 10px; padding: 0 12px; margin-bottom: 8px; }
.ab-group > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 0;
    font-size: 14px;
}
.ab-group-rule { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ab-group-rule code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ab-muted); margin-left: 4px; }
.ab-group-total { color: var(--ab-muted); font-size: 13px; white-space: nowrap; }
.ab-advice { font-size: 13px; line-height: 1.7; margin: 0 0 8px; }
.ab-examples { list-style: none; margin: 0 0 10px; padding: 0; }
.ab-examples li { border-top: 1px dashed var(--ab-border); padding: 7px 0; }
.ab-example-msg { font-size: 13px; line-height: 1.6; }
.ab-example-meta { font-size: 12px; color: var(--ab-muted); overflow-wrap: anywhere; }

.ab-disclaimer { color: var(--ab-muted); font-size: 13px; line-height: 1.7; margin-top: 18px; }

@media (max-width: 640px) {
    .ab-shell { padding: 12px 16px 32px; }
    .ab-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
