/* ============================================================
   正典论文核校系统 — Dark theme with blue accents
   ============================================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a28;
    --bg-card-hover: #1f1f32;
    --border: #2a2a3d;
    --text-primary: #e8e8f0;
    --text-secondary: #8a8aa0;
    --text-muted: #5a5a70;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #1e3a5f;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient-title: linear-gradient(135deg, #60a5fa 0%, #3b82f6 30%, #818cf8 60%, #6366f1 100%);
    --gradient-btn: linear-gradient(135deg, #3b82f6, #2563eb);
    --gradient-btn-hover: linear-gradient(135deg, #60a5fa, #3b82f6);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset ----------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global dark scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1a1a28; }
::-webkit-scrollbar-thumb { background: #3a3a50; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a60; }
html { scrollbar-width: thin; scrollbar-color: #3a3a50 #1a1a28; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

a { color: var(--blue-500); text-decoration: none; }
a:hover { color: #93c5fd; }

/* Layout ---------------------------------------------------- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
}

/* Header ---------------------------------------------------- */
.header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    display: block;
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(96, 165, 250, 0.28);
    box-shadow: 0 5px 14px rgba(59, 130, 246, 0.20);
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 14px; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--blue-500); }

.btn-logout {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* User dropdown menu */
.user-menu { position: relative; cursor: pointer; user-select: none; }
.user-menu-trigger {
    color: var(--text-primary); font-size: 14px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); transition: all 0.2s;
    display: inline-block;
}
.user-menu:hover .user-menu-trigger { border-color: var(--blue-500); }
.user-dropdown {
    display: none; position: absolute; right: 0; top: 100%; margin-top: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); min-width: 160px; z-index: 999;
    box-shadow: var(--shadow); padding: 8px 0;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
    display: block; padding: 8px 16px; font-size: 13px;
    color: var(--text-secondary) !important; white-space: nowrap;
}
.user-dropdown a:hover { background: var(--bg-card-hover); color: var(--text-primary) !important; }

/* Hero / Landing --------------------------------------------- */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 28px 24px 64px;
}

.hero-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: block;
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(96, 165, 250, 0.32);
    margin-bottom: 32px;
    box-shadow:
        0 12px 34px rgba(37, 99, 235, 0.26),
        0 0 52px rgba(59, 130, 246, 0.18);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.hero-slogan {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    letter-spacing: 4px;
}

/* Feature Cards --------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1100px;
    width: 100%;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 23px 24px;
    text-align: left;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--blue-500);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    text-align: center;
}

.feature-subtitle {
    font-size: 12px !important;
    color: var(--text-primary) !important;
    line-height: 1.6 !important;
    margin-bottom: 12px;
    text-align: center;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 2.0;
    text-align: center;
}

@media (max-width: 800px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth page ------------------------------------------------- */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 14px;
}

/* Form elements ---------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
    color: #5a5a78;
    font-size: 12px;
    line-height: 1.8;
}

textarea.form-input {
    font-size: 13px;
    line-height: 1.8;
    scrollbar-width: thin;
    scrollbar-color: #3a3a50 #1a1a28;
}

/* Webkit scrollbar */
textarea.form-input::-webkit-scrollbar {
    width: 8px;
}
textarea.form-input::-webkit-scrollbar-track {
    background: #1a1a28;
    border-radius: 4px;
}
textarea.form-input::-webkit-scrollbar-thumb {
    background: #3a3a50;
    border-radius: 4px;
}
textarea.form-input::-webkit-scrollbar-thumb:hover {
    background: #4a4a60;
}

select.form-input {
    opacity: 0.7;
    transition: opacity 0.2s;
    background: #1a1a2e;
    color: #c0c0d0;
    color-scheme: dark;
    border: 1px solid var(--border);
}
select.form-input option {
    background: #1a1a2e;
    color: #c0c0d0;
}
select.form-input:hover,
select.form-input:focus {
    opacity: 1;
    background: #222238;
}

/* Buttons ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: var(--gradient-btn-hover);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-block { width: 100%; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--blue-500);
    color: var(--blue-500);
}
.btn-outline:hover {
    background: rgba(59, 130, 246, 0.08);
}

.btn-lg { padding: 14px 40px; font-size: 16px; }

/* Upload area ------------------------------------------------ */
.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 45px 40px 75px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--blue-500);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.06);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.upload-primary-text {
    font-size: 20px;
    margin-bottom: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-primary);
}

/* Pricing cards ---------------------------------------------- */
.pricing-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px auto;
}
.pricing-grid:has(> .pricing-card:only-child) {
    grid-template-columns: minmax(220px, 280px);
    justify-content: center;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pricing-card:hover,
.pricing-card.selected {
    border-color: var(--blue-500);
    background: var(--bg-card-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.pricing-card .tier-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pricing-card .tier-range {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pricing-card .tier-price {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Result display --------------------------------------------- */
.result-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 24px;
}

.result-panel h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--blue-500);
}

/* Toast / Messages ------------------------------------------- */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast-success { background: #065f46; color: #a7f3d0; border: 1px solid #059669; }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid #dc2626; }
.toast-info { background: var(--blue-900); color: #bfdbfe; border: 1px solid var(--blue-500); }

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }
.htmx-request #upload-content { display: none; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading spinner -------------------------------------------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--blue-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer ----------------------------------------------------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-registration {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 8px;
}

.footer-registration a {
    color: inherit;
}

.footer-registration a:hover {
    color: var(--blue-500);
}

.footer-mps-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-mps-icon {
    display: block;
    width: 16px;
    height: auto;
    flex: 0 0 auto;
}

.footer-separator {
    color: var(--border);
}

/* Responsive ------------------------------------------------- */
@media (max-width: 640px) {
    .hero-title { font-size: 28px; }
    .hero-slogan { font-size: 14px; letter-spacing: 2px; }
    .auth-card { padding: 24px; }
    .pricing-grid { grid-template-columns: 1fr 1fr; }
    .footer-registration { flex-direction: column; gap: 2px; }
    .footer-separator { display: none; }
}

/* Utilities -------------------------------------------------- */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Status badge ----------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { color: var(--warning); background: rgba(245, 158, 11, 0.1); }
.badge-paid { color: var(--success); background: rgba(34, 197, 94, 0.1); }
.badge-processing { color: var(--blue-500); background: rgba(59, 130, 246, 0.1); }
.badge-completed { color: var(--blue-500); background: rgba(59, 130, 246, 0.15); }

/* SSE progress stream --------------------------------------- */
.progress-stream {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}
/* Empty progress area takes no space until processing starts. */
.progress-stream:empty {
    display: none;
}
/* Requirement textareas are taller and column labels a bit larger. */
textarea.form-input {
    min-height: 220px !important;
}
[data-module] label {
    font-size: 16px !important;
}
/* Module process buttons are slightly smaller. */
#module-panel .btn-primary,
#file-workspace .btn-primary {
    padding: 8px 24px;
    font-size: 14px;
}

/* Module selector tabs --------------------------------------- */
.module-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 14px;
    margin-bottom: 8px;
}
.module-tabs .module-tab {
    min-width: 0;
    width: 100%;
    white-space: nowrap;
}

.module-tab {
    box-sizing: border-box;
    height: 40px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    appearance: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: all 0.2s;
}
.module-tab:hover,
.module-tab.active {
    border-color: var(--blue-500);
    color: var(--blue-500);
    background: rgba(59, 130, 246, 0.06);
}

.module-tab-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}
.module-tab-item::before {
    content: "";
    box-sizing: border-box;
    min-height: 16px;
    align-self: center;
}
.module-tab-item[data-badge]:not([data-badge=""])::before {
    content: attr(data-badge);
    padding: 1px 7px;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 999px;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.10);
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.module-tab-note {
    min-height: 14px;
    width: max-content;
    align-self: center;
    color: var(--text-muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
}
.module-tab.done {
    background: #1a3a6a;
    border-color: #2563eb;
    color: #93c5fd;
}
.module-tab.done.active {
    background: #1e40af;
    border-color: #3b82f6;
    color: #bfdbfe;
}
}

/* Progress bar for processing */
.progress-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 12px;
}
.progress-bar-track {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Compact result bar */
.result-bar {
    transition: all 0.3s;
}
.result-bar:hover {
    border-color: var(--blue-500) !important;
}

/* Preview area — always visible, full width */
#preview-area {
    width: 100%;
    max-width: 1000px;
    margin: 24px auto 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    min-height: 80px;
    overflow: hidden;
}
#preview-area iframe {
    width: 100%;
    min-height: 90vh;
    border: none;
    display: block;
}

/* V3 formatting review -------------------------------------- */
.template-import-row {
    margin-top: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: transparent;
    text-align: center;
    flex-wrap: wrap;
}
.template-format-panel {
    margin-top: 24px;
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    text-align: center;
}
.template-format-heading {
    margin-bottom: 16px;
    background: var(--gradient-title);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 16px;
    font-weight: 700;
}
.template-import-form,
#template-import-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.template-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.template-import-button {
    width: 112px;
    min-width: 112px;
    margin: 0;
    white-space: nowrap;
}
.template-import-explainer {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}
.template-import-loading {
    flex: 0 0 100%;
    width: min(420px, 100%);
    color: var(--blue-500);
    font-size: 12px;
    text-align: center;
}
.htmx-request.htmx-indicator.template-import-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.template-import-progress-track {
    display: block;
    width: min(360px, 100%);
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
}
.template-import-progress-bar {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
    animation: templateImportProgress 1.2s ease-in-out infinite;
}
@keyframes templateImportProgress {
    from { transform: translateX(-120%); }
    to { transform: translateX(300%); }
}
@media (prefers-reduced-motion: reduce) {
    .template-import-progress-bar {
        width: 100%;
        animation: none;
        opacity: 0.75;
    }
}
#template-import-status { flex: 0 0 100%; }
#template-import-status:empty { display: none; }

.format-review-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 44px 0 100px;
    position: relative;
}
.format-review-shell::before {
    content: "";
    position: fixed;
    inset: 56px 0 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 8%, rgba(59, 130, 246, 0.12), transparent 34%),
        radial-gradient(circle at 84% 16%, rgba(99, 102, 241, 0.09), transparent 30%),
        linear-gradient(180deg, #0c0c14 0%, var(--bg-primary) 52%);
}
.review-hero {
    padding: 30px 32px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(30, 58, 95, 0.42), rgba(26, 26, 40, 0.94) 52%),
        var(--bg-card);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}
.review-hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -110px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 50%;
    box-shadow: 0 0 0 36px rgba(59, 130, 246, 0.035), 0 0 0 74px rgba(99, 102, 241, 0.025);
}
.review-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 12px;
}
.review-breadcrumb a { color: var(--text-secondary); }
.review-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: end;
    gap: 40px;
    position: relative;
    z-index: 1;
}
.review-kicker {
    color: #60a5fa;
    font-size: 11px;
    letter-spacing: 2.6px;
    font-weight: 700;
    margin-bottom: 10px;
}
.review-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    margin-bottom: 12px;
    letter-spacing: -0.8px;
}
.review-hero p { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.review-source-card {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(10, 10, 15, 0.54);
    border: 1px solid rgba(96, 165, 250, 0.16);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.review-source-label {
    width: fit-content;
    padding: 3px 9px;
    border-radius: 999px;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.13);
    font-size: 11px;
    font-weight: 700;
}
.review-source-card strong { font-size: 14px; overflow-wrap: anywhere; }
.review-source-card small { color: var(--text-muted); line-height: 1.6; }
.review-notice {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding: 10px 14px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 9px;
    background: rgba(245, 158, 11, 0.07);
    color: #fbbf24;
    font-size: 12px;
}
.review-toolbar {
    margin: 18px 0;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(26, 26, 40, 0.88);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    position: sticky;
    top: 68px;
    z-index: 20;
    backdrop-filter: blur(14px);
}
.review-counts { display: flex; gap: 26px; }
.review-counts div { display: flex; align-items: baseline; gap: 7px; }
.review-counts strong { color: #93c5fd; font-size: 18px; }
.review-counts span { color: var(--text-muted); font-size: 12px; }
.professional-toggle {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
}
.professional-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 0 4px rgba(90, 90, 112, 0.12);
}
.professional-toggle[aria-pressed="true"] {
    border-color: var(--blue-500);
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.1);
}
.professional-toggle[aria-pressed="true"] .professional-toggle-dot {
    background: #60a5fa;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.review-section {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(26, 26, 40, 0.9);
    overflow: hidden;
    animation: reviewReveal 0.38s both;
    animation-delay: calc(var(--section-order) * 35ms);
}
.review-section[data-basic-visible="false"],
.review-rule-row[data-basic-visible="false"],
.review-field[data-basic-visible="false"] { display: none; }
.show-professional .review-section[data-basic-visible="false"] { display: block; }
.show-professional .review-rule-row[data-basic-visible="false"] { display: grid; }
.show-professional .review-field[data-basic-visible="false"] { display: flex; }
.review-section-header {
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.055), transparent 60%);
}
.review-section-number {
    color: #60a5fa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding-top: 4px;
}
.review-section-header h2 { font-size: 17px; margin-bottom: 4px; }
.review-section-header p { color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.review-section-body { padding: 4px 22px; }
.review-rule-row {
    min-height: 76px;
    padding: 13px 0;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid rgba(42, 42, 61, 0.72);
}
.review-rule-row:last-child { border-bottom: 0; }
.review-rule-title { display: flex; flex-direction: column; gap: 5px; }
.review-rule-title strong { font-size: 13px; color: #d6d6e2; }
.review-rule-title small { color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.review-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
}
.review-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.review-field.is-default { opacity: 0.66; }
.review-field-label {
    min-height: 16px;
    color: var(--text-muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.review-field-label em {
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(138, 138, 160, 0.1);
    color: var(--text-muted);
    font-size: 9px;
    font-style: normal;
}
.review-input-wrap { position: relative; display: flex; align-items: center; }
.review-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 7px 9px;
    border: 1px solid #303047;
    border-radius: 7px;
    background: #111119;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}
.review-input-wrap:has(.review-unit) .review-input { padding-right: 40px; }
.review-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.11);
}
.review-unit {
    position: absolute;
    right: 9px;
    color: var(--text-muted);
    font-size: 9px;
    pointer-events: none;
}
.review-actions {
    margin-top: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius);
    background: linear-gradient(110deg, rgba(30, 58, 95, 0.34), var(--bg-card));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
}
.review-actions > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.review-actions strong { font-size: 14px; }
.review-actions span { color: var(--text-muted); font-size: 11px; }
.review-action-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.review-action-buttons .btn { padding: 10px 18px; font-size: 13px; text-decoration: none; }

.format-processing-shell { max-width: 880px; min-height: calc(100vh - 120px); }
.processing-hero { margin-bottom: 18px; }
.processing-card {
    min-height: 240px;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow);
}
.processing-card h2 { margin: 14px 0 8px; font-size: 20px; }
.processing-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.processing-orbit {
    width: 56px;
    height: 56px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 50%;
    position: relative;
    animation: processingSpin 1.5s linear infinite;
}
.processing-orbit span {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #60a5fa;
    top: -5px;
    left: 23px;
    box-shadow: 0 0 18px #3b82f6;
}
.processing-status-line {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}
.processing-status-line strong { color: #93c5fd; }
.review-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
    margin-bottom: 18px;
}
.review-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.35s ease;
}
.processing-result-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: #dbeafe;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    font-size: 22px;
    font-weight: 800;
}
.processing-error .processing-result-mark {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}
.processing-result-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
}
.processing-result-stats span {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 11px;
}
.processing-result-stats strong { color: var(--text-primary); }

@keyframes reviewReveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes processingSpin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .module-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .review-hero-grid { grid-template-columns: 1fr; gap: 20px; }
    .review-rule-row { grid-template-columns: 1fr; gap: 10px; }
    .review-actions { align-items: flex-start; flex-direction: column; }
    .review-action-buttons { width: 100%; justify-content: flex-start; }
}
@media (max-width: 560px) {
    .module-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #template-import-form { width: 100%; }
    .template-import-explainer { flex-basis: 100%; }
    .format-review-shell { width: min(100% - 24px, 1180px); padding-top: 20px; }
    .review-hero { padding: 22px 18px; }
    .review-toolbar { top: 62px; align-items: flex-start; }
    .review-counts { gap: 12px; flex-direction: column; }
    .review-section-body { padding: 4px 14px; }
    .review-section-header { padding: 16px; }
    .review-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-action-buttons .btn { width: 100%; }
    .processing-card { padding: 28px 18px; }
}
@media (max-width: 420px) {
    .module-tab-note {
        width: auto;
        white-space: normal;
    }
}

/* Compact GUI-aligned formatting review --------------------- */
.gui-review-shell {
    width: min(1180px, calc(100% - 32px));
    padding: 28px 0 72px;
}
.gui-review-window {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}
.gui-review-header {
    position: relative;
    padding: 32px 170px 27px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 50% -70%, rgba(59, 130, 246, 0.2), transparent 56%),
        var(--bg-card);
}
.gui-review-header-copy {
    max-width: 820px;
    margin: 0 auto;
}
.gui-review-header h1 {
    margin: 0 0 11px;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(28px, 3.4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 2px;
}
.gui-review-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}
.gui-review-header .professional-toggle {
    position: absolute;
    top: 32px;
    right: 24px;
}
.review-summary-view {
    padding: 26px;
    background: var(--bg-secondary);
}
.review-summary-heading {
    margin: 8px 0 28px;
    padding: 5px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.review-summary-heading > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.review-summary-heading strong {
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}
.review-summary-heading span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}
.review-summary-total {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    color: #93c5fd !important;
    background: rgba(59, 130, 246, 0.12);
}
.review-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}
.review-summary-card {
    min-width: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(59, 130, 246, 0.035), transparent 42%),
        var(--bg-card);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.review-summary-card > header {
    min-height: 54px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.07), transparent);
}
.review-summary-card > header > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.review-summary-card > header strong {
    flex: 0 0 auto;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
}
.review-summary-card > header span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-summary-card > header em {
    flex: 0 0 auto;
    color: #93c5fd;
    font-size: 10px;
    font-style: normal;
}
.review-common-lines {
    flex: 1;
    padding: 12px 18px 16px;
}
.review-common-line {
    margin: 0;
    padding: 7px 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    color: #d6d6e2;
    font-size: 12px;
    line-height: 1.7;
    border-bottom: 1px solid rgba(42, 42, 61, 0.52);
}
.review-common-line:last-child { border-bottom: 0; }
.review-common-label {
    color: var(--text-secondary);
    white-space: nowrap;
}
.review-common-text {
    min-width: 0;
    overflow-wrap: anywhere;
}
.review-common-line.is-nested {
    padding-left: 22px;
    color: var(--text-secondary);
}
.review-summary-card-body { padding: 3px 11px 7px; }
.review-summary-row {
    min-width: 0;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    border-bottom: 1px solid rgba(42, 42, 61, 0.6);
}
.review-summary-row:last-child { border-bottom: 0; }
.review-summary-row > strong {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}
.review-summary-row > strong small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 400;
}
.review-summary-values {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 7px;
}
.review-summary-value {
    min-width: 0;
    padding: 3px 7px;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    border: 1px solid rgba(59, 130, 246, 0.11);
    border-radius: 6px;
    background: rgba(10, 10, 15, 0.34);
    white-space: nowrap;
}
.review-summary-value small {
    color: var(--text-muted);
    font-size: 9px;
}
.review-summary-value b {
    max-width: 180px;
    overflow: hidden;
    color: #d6d6e2;
    font-size: 10px;
    font-weight: 500;
    text-overflow: ellipsis;
}
.review-summary-empty {
    padding: 34px 20px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}
.review-editor-view { display: none; }
.show-professional .review-summary-view { display: none; }
.show-professional .review-editor-view { display: block; }
.review-workspace {
    min-height: 470px;
    display: grid;
    grid-template-columns: 174px minmax(0, 1fr);
}
.gui-review-meta {
    min-height: 38px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px 28px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}
.gui-review-meta strong { color: var(--text-primary); font-weight: 600; }
.review-category-tabs {
    padding: 12px 9px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
}
.review-navigation-title {
    padding: 3px 9px 8px;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
}
.review-category-tab {
    width: 100%;
    height: 37px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    appearance: none;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.review-category-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}
.review-category-tab.active {
    border-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
}
.review-category-tab[hidden],
.review-category-panel[hidden],
.review-rule-row[hidden],
.review-field[hidden] {
    display: none !important;
}
.gui-review-form { padding: 0; }
.review-editor-main { min-width: 0; }
.review-category-panels {
    min-height: 370px;
    background: var(--bg-secondary);
}
.gui-review-shell .review-category-panel {
    display: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--bg-secondary);
    box-shadow: none;
    animation: none;
}
.gui-review-shell .review-category-panel.active { display: block; }
.review-category-header {
    min-height: 50px;
    padding: 11px 17px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.review-category-header h2 {
    margin: 0;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 15px;
    font-weight: 800;
}
.review-category-header span {
    color: var(--text-muted);
    font-size: 11px;
}
.gui-review-shell .review-section-body { padding: 0; }
.review-rule-card {
    margin: 10px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 9px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
.review-rule-card-body { padding: 4px 0; }
.review-rule-card-header {
    position: relative;
    min-height: 0;
    padding: 11px 12px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    background: transparent;
}
.review-rule-card-header > strong {
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}
.review-card-state {
    position: absolute;
    right: 11px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 9px;
}
.review-card-state.is-recognized {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
}
.review-card-state.is-partial,
.review-card-state.is-default {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
}
.gui-review-shell .review-rule-row {
    min-height: 49px;
    padding: 7px 11px;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 0;
    background: transparent;
}
.gui-review-shell .review-rule-row:nth-child(odd) {
    background: transparent;
}
.gui-review-shell .review-rule-row:last-child { border-bottom: 0; }
.gui-review-shell .review-rule-row.is-wide-control {
    grid-template-columns: 130px minmax(0, 1fr);
}
.gui-review-shell .review-rule-row.is-field-only {
    grid-template-columns: minmax(0, 1fr);
}
.gui-review-shell .review-rule-row.is-wide-control .review-fields {
    grid-template-columns: minmax(0, 1fr);
}
.gui-review-shell .review-rule-row.is-wide-control .review-field {
    grid-template-columns: 110px minmax(0, 1fr) auto;
}
.gui-review-shell .review-rule-row.is-wide-control .review-input {
    width: 100%;
}
.gui-review-shell .review-rule-title {
    padding-top: 0;
}
.gui-review-shell .review-rule-title strong {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}
.gui-review-shell .review-rule-title small { display: none; }
.gui-review-shell .review-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 7px;
}
.gui-review-shell .review-field {
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
}
.gui-review-shell .review-input-wrap {
    min-width: 0;
    flex: 1 1 auto;
}
.show-professional .gui-review-shell .review-field[data-basic-visible="false"] {
    display: grid;
}
.gui-review-shell .review-field-label {
    min-height: 0;
    flex: 0 0 auto;
    order: 0;
    color: var(--text-secondary);
    font-size: 10px;
    white-space: nowrap;
}
.gui-review-shell .review-input-wrap { order: 1; }
.gui-review-shell .review-field.is-default { opacity: 1; }
.gui-review-shell .review-default-mark {
    flex: 0 0 auto;
    order: 2;
    color: #fbbf24;
    font-size: 9px;
    font-weight: 600;
    font-style: normal;
    white-space: nowrap;
}
.gui-review-shell .review-input {
    min-width: 0;
    height: 31px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 11px;
}
.gui-review-shell .review-unit {
    right: 8px;
    font-size: 10px;
}
.review-advanced-settings {
    margin: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-secondary);
}
.review-advanced-settings > summary {
    min-height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    list-style: none;
}
.review-advanced-settings > summary::-webkit-details-marker { display: none; }
.review-advanced-settings > summary em {
    color: var(--text-muted);
    font-size: 9px;
    font-style: normal;
}
.review-advanced-settings[open] > summary {
    border-bottom: 1px solid var(--border);
}
.review-advanced-body .review-rule-card { margin: 8px; }
.gui-review-actions {
    margin: 0;
    padding: 14px 18px;
    position: relative;
    justify-content: flex-end;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-secondary);
}
.gui-review-actions > div:first-child {
    position: absolute;
    left: 50%;
    align-items: center;
    text-align: center;
    transform: translateX(-50%);
}
.gui-review-actions strong { font-size: 12px; }
.gui-review-actions span { font-size: 10px; }
.gui-review-shell .professional-toggle {
    flex: 0 0 auto;
    min-width: 112px;
    height: 34px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 12px;
}

@media (max-width: 820px) {
    .gui-review-shell { width: min(100% - 20px, 1080px); padding-top: 12px; }
    .gui-review-header { padding: 25px 20px 20px; }
    .gui-review-header .professional-toggle {
        position: static;
        margin: 17px auto 0;
    }
    .gui-review-meta { flex-wrap: wrap; gap: 6px 14px; }
    .review-summary-grid { grid-template-columns: 1fr; }
    .review-workspace { display: block; }
    .review-category-tabs {
        padding: 8px 10px 0;
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        scrollbar-width: thin;
    }
    .review-navigation-title { display: none; }
    .review-category-tab {
        width: auto;
        min-width: max-content;
        border-radius: 7px 7px 0 0;
    }
    .gui-review-shell .review-rule-row {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 8px;
    }
    .gui-review-shell .review-rule-title { padding-top: 0; }
    .gui-review-shell .review-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gui-review-actions > div:first-child {
        position: static;
        width: 100%;
        align-items: center;
        text-align: center;
        transform: none;
    }
}

@media (max-width: 520px) {
    .gui-review-header { padding: 17px 15px; }
    .gui-review-meta { padding: 8px 15px; }
    .review-category-header { padding: 12px 15px; }
    .gui-review-shell .review-rule-row { padding: 10px 14px; }
    .review-summary-view { padding: 12px; }
    .review-summary-heading > div { display: block; }
    .review-summary-row { grid-template-columns: 1fr; gap: 5px; }
    .gui-review-shell .review-fields { grid-template-columns: 1fr; }
    .gui-review-shell .review-field {
        flex-direction: row;
    }
    .gui-review-actions { align-items: stretch; }
    .gui-review-actions .review-action-buttons { width: 100%; }
    .gui-review-actions .btn { flex: 1; }
}

/* docx-preview / PDF preview wrapper */
.docx-preview-wrapper {
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 0;
    margin-top: 0;
    width: 100%;
    height: 88vh;
}
.docx-preview-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}
}
.docx-preview-wrapper .docx-wrapper {
    background: #fff;
    box-shadow: none;
    margin: 0 auto;
    max-width: 100%;
}
.docx-preview-wrapper .docx-wrapper section {
    background: #fff;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.docx-preview-wrapper .docx-wrapper {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    margin: 0 auto;
    max-width: 100%;
}
.docx-preview-wrapper .docx-wrapper section {
    background: #fff;
    padding: 72px 96px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    min-height: 29.7cm;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
/* WEB_REVIEW_PANEL_FILL_20260725 */
.gui-review-shell .review-workspace,
.gui-review-shell .review-editor-main,
.gui-review-shell .review-category-panels,
.gui-review-shell .review-category-panel,
.gui-review-shell .review-category-header,
.gui-review-shell .review-section-body {
    background: var(--bg-secondary);
}

.gui-review-shell .review-editor-main,
.gui-review-shell .review-category-panels,
.gui-review-shell .review-category-panel.active {
    min-height: 470px;
}

.gui-review-shell .review-category-panels,
.gui-review-shell .review-category-panel.active {
    height: 100%;
}

.gui-review-shell .review-section-body {
    min-height: 420px;
}
