












:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-bg: #f5f7fb;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-border: #d7dde8;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05);
    --tap-min: 44px;
    --gap: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;            
    line-height: 1.6;           
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;          
    min-width: 0;
}

img, video, canvas, table {
    max-width: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover, a:focus-visible {
    text-decoration: underline;
}

h1, h2, h3 {
    line-height: 1.35;
    margin: 0 0 .5em;
}

p {
    margin: 0 0 .8em;
}

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


.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    flex: 1;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-min);
    padding: 0 12px;
    border-radius: 8px;
    color: var(--color-text);
    font-weight: 500;
}

.main-nav a:hover {
    background: #eef2f9;
}

.main-nav a:active {
    background: #e2e8f5;
    transform: translateY(1px);
}

.main-nav a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.main-nav a.active {
    color: var(--color-primary);
    background: rgba(37, 99, 235, .08);
}

.auth-area {
    display: flex;
    align-items: center;
    gap: var(--gap);
    flex-wrap: wrap;
}

.user-chip {
    color: var(--color-muted);
    font-size: 14px;
}

.inline-form {
    display: inline;
    margin: 0;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap-min);
    min-width: var(--tap-min);
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn + .btn {
    margin-left: var(--gap);
}

.btn:hover {
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .4);
    outline-offset: 1px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-primary:active {
    background: #1e40af;
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-ghost:hover {
    background: rgba(37, 99, 235, .06);
}

.btn-ghost:active {
    background: rgba(37, 99, 235, .14);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
}

.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}


.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    min-height: var(--tap-min);
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    background: #fff;
    color: var(--color-text);
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.field-row {
    display: flex;
    align-items: center;
    gap: var(--gap);
    flex-wrap: wrap;
}

.checkbox-label,
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--tap-min);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input,
.radio-label input {
    width: 20px;
    height: 20px;
    flex: none;
}

.field-error {
    color: var(--color-danger);
    font-size: 14px;
    margin-top: 6px;
}

.pw-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.pw-wrap input {
    flex: 1;
    min-width: 0;
}

.toggle-btn {
    flex: none;
    min-height: var(--tap-min);
    min-width: 56px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    color: var(--color-text);
    font-size: 14px;
    cursor: pointer;
}

.toggle-btn:focus-visible {
    outline: 2px solid var(--color-primary);
}

.toggle-btn:active {
    background: #eef2f9;
}


.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-head .card-title,
.page-head .card-sub {
    margin-bottom: 6px;
}

.card-sub {
    color: var(--color-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


.auth-card {
    max-width: 460px;
    margin: 40px auto 56px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
}

.auth-sub {
    color: var(--color-muted);
}

.auth-switch {
    text-align: center;
    margin-top: 18px;
}


.flash {
    max-width: 1080px;
    margin: 12px auto 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid transparent;
}

.flash-notice {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.flash-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.verify-banner {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
}


.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 32px 16px;
    text-align: center;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dropzone.dragover,
.dropzone:hover {
    border-color: var(--color-primary);
    background: #eff6ff;
}

.dropzone:active {
    border-color: var(--color-primary-dark);
}

.dropzone:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .4);
}

.dropzone input[type="file"] {
    display: none;
}

.progress-wrap {
    height: 12px;
    background: #e5e9f2;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 6px;
    transition: width .2s ease;
}

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.status-pending   { background: #fef3c7; color: #92400e; }
.status-queued    { background: #fef3c7; color: #92400e; }
.status-parsing   { background: #dbeafe; color: #1e40af; }
.status-success   { background: #dcfce7; color: #166534; }
.status-failed    { background: #fee2e2; color: #991b1b; }


.q-card {
    border-left: 4px solid var(--color-primary);
}

.q-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.q-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
}

.opt-letter {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .08);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 14px;
}

.opt-text {
    flex: 1;
    min-width: 0;
}

.review-line {
    margin: 6px 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.score-line {
    font-size: 18px;
    margin: 8px 0;
}

.weak-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.paper-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.type-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.q-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
}

.q-stem {
    white-space: normal;         
    word-break: break-word;
    overflow-wrap: anywhere;
    margin: 10px 0;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-height: var(--tap-min);
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    word-break: break-word;      
    overflow-wrap: anywhere;
}

.option-item:hover {
    border-color: var(--color-primary);
}

.option-item:active {
    background: #eff6ff;
}

.option-item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .4);
    outline-offset: 1px;
}

.option-item.selected {
    border-color: var(--color-primary);
    background: #eff6ff;
    font-weight: 500;
}

.option-item.correct {
    border-color: var(--color-success);
    background: #f0fdf4;
}

.option-item.incorrect {
    border-color: var(--color-danger);
    background: #fef2f2;
}

.material-box {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-warning);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.textarea-auto {
    min-height: 120px;
    resize: vertical;
}

.bkt-track {
    height: 16px;
    background: #e5e9f2;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.bkt-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #d97706, #16a34a);
    border-radius: 8px;
    transition: width .4s ease;
}

.weak-list li {
    margin-bottom: 12px;
}


.table-card {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table-card th,
.table-card td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

.table-card th {
    background: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}

.table-card tr:last-child td {
    border-bottom: none;
}


.stat-card {
    text-align: center;
}

.stat-num {
    font-size: 30px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-label {
    color: var(--color-muted);
    font-size: 14px;
    margin-top: 4px;
}


.pager {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0;
}

.pager a, .pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    color: var(--color-text);
}

.pager a:active {
    background: #eef2f9;
}

.pager a:focus-visible {
    outline: 2px solid var(--color-primary);
}

.pager .current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}


.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
    margin-top: 48px;
    font-size: 14px;
    color: var(--color-muted);
    text-align: center;
}

.page-body {
    padding-top: 24px;
    padding-bottom: 24px;
}


.muted { color: var(--color-muted); font-size: 14px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.text-center { text-align: center; }

.loading-dots::after {
    content: "...";
    animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
    0%   { content: ""; }
    25%  { content: "."; }
    50%  { content: ".."; }
    75%  { content: "..."; }
}

.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 400% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
    min-height: 18px;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: 0 0; }
}






@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


@media (max-width: 768px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }

    .table-responsive {
        display: block;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        background: #fff;
        border: 1px solid var(--color-border);
        border-radius: 10px;
        padding: 8px 12px;
        margin-bottom: 12px;
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px dashed var(--color-border);
        padding: 8px 4px;
    }

    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        flex: none;
        color: var(--color-muted);
    }

    .table-responsive td:last-child {
        border-bottom: none;
    }
}


@media (max-width: 414px) {
    .header-inner {
        gap: 8px;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;      
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        padding: 0 10px;
        white-space: nowrap;
    }

    .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .stat-num { font-size: 26px; }
}


@media (max-width: 360px) {
    .container { padding: 0 12px; }

    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

    .btn + .btn { margin-left: 0; margin-top: var(--gap); }

    .btn-block + .btn-block { margin-top: var(--gap); }

    .auth-card { padding: 22px 16px; }
}


.upload-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    background:
        radial-gradient(circle at 92% 12%, rgba(37, 99, 235, .16), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #eef5ff 52%, #f7f9ff 100%);
    border-color: #dbe8fb;
    overflow: hidden;
}
.upload-hero-main { max-width: 760px; }
.upload-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e6efff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
}
.upload-hero h1 { margin: 0 0 8px; }
.upload-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.upload-chip {
    padding: 5px 10px;
    border: 1px solid #d7e5fb;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    color: #31537c;
    font-size: 12px;
}
.upload-hero-art {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    color: #2563eb;
    opacity: .9;
}
.upload-panel { border-color: #e1e8f2; }
.upload-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.upload-section-head h2 { margin: 0 0 4px; font-size: 17px; }
.upload-section-head p { margin: 0; }
.upload-section-badge {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
}
.upload-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    background: #fbfdff;
}
.upload-category-actions { display: flex; gap: 8px; padding-bottom: 2px; }
.upload-dropzone {
    position: relative;
    margin-top: 14px;
    padding: 34px 20px;
    border: 1.5px dashed #b9cff0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #2563eb;
    background: #f0f7ff;
    transform: translateY(-1px);
}
.upload-dropzone .dropzone-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #e8f1ff;
    color: #2563eb;
}
.upload-dropzone p { margin: 4px 0; }
.upload-progress-box { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f7faff; }
.file-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid #e5ecf5;
    border-radius: 12px;
    background: #fff;
}
.file-row:hover { border-color: #cbdcf5; box-shadow: 0 4px 14px rgba(24, 57, 106, .05); }
.file-name { margin: 0 0 5px; font-weight: 600; color: #1e293b; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
@media (max-width: 720px) {
    .upload-hero { flex-direction: column; }
    .upload-hero-art { display: none; }
    .upload-category-row { grid-template-columns: 1fr; }
    .upload-category-actions { padding-bottom: 0; }
    .file-row { flex-direction: column; }
    .file-actions { justify-content: flex-start; }
}


.ai-progress-box { max-width: 520px; }
.ai-progress-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ai-progress-head h3 { margin: 0; }
.ai-progress-spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: 3px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-progress-box.is-done .ai-progress-spinner,
.ai-progress-box.is-error .ai-progress-spinner { display: none; }
.ai-progress-box.is-done { border-top: 4px solid #16a34a; }
.ai-progress-box.is-error { border-top: 4px solid #dc2626; }
.ai-progress-status {
    margin: 14px 0 8px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #f4f8ff;
    color: #1e3a8a;
    font-size: 13px;
}
.ai-progress-box.is-error .ai-progress-status { background: #fef2f2; color: #991b1b; }
.ai-progress-box.is-done .ai-progress-status { background: #f0fdf4; color: #166534; }
.ai-progress-text { margin: 8px 0; font-size: 14px; }
.ai-progress-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }


.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(2px);
}
.modal-box {
    position: fixed;
    z-index: 1001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 540px);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.modal-box h3 {
    margin: 0 0 8px;
    font-size: 19px;
    color: #0f172a;
}
.modal-box .muted { margin-top: 4px; }
.modal-box .field:first-of-type { margin-top: 16px; }
.modal-box .field-row { display: flex; flex-wrap: wrap; gap: 10px; }
body.modal-open { overflow: hidden; }
@media (max-width: 560px) {
    .modal-box { width: calc(100vw - 28px); padding: 20px; border-radius: 14px; }
}


.diag-group {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #e5ecf5;
    border-radius: 12px;
    background: #fbfdff;
}
.diag-group:first-child { margin-top: 0; }
.diag-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.diag-group-head strong { color: #0f172a; }
.diag-sep { margin: 0 5px; color: #94a3b8; }
.diag-group .weak-list { margin-top: 10px; }


.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.report-grid section {
    padding: 12px 14px;
    border: 1px solid #e5ecf5;
    border-radius: 10px;
    background: #fbfdff;
}
.report-grid h3 { margin: 0 0 6px; font-size: 14px; color: #1e3a8a; }
.report-grid p { margin: 0; }
@media (max-width: 720px) {
    .report-grid { grid-template-columns: 1fr; }
}


.diag-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.diag-toggle .diag-group-head { flex: 1; margin: 0; }
.diag-chevron {
    flex: 0 0 auto;
    padding: 3px 9px;
    border: 1px solid #dbe5f2;
    border-radius: 999px;
    color: #2563eb;
    background: #eff6ff;
    font-size: 12px;
}
.diag-body { margin-top: 8px; }


.history-detail-box { width: min(94vw, 900px); max-height: 88vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; }
.modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { background: #e2e8f0; }
.history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.history-summary > div { padding: 10px 12px; border: 1px solid #e5ecf5; border-radius: 9px; background: #fbfdff; }
.history-summary strong { display: block; margin-top: 3px; font-size: 17px; color: #1e3a8a; }
.history-detail-list { display: grid; gap: 10px; }
.history-detail-item { padding: 12px 14px; border: 1px solid #e5ecf5; border-radius: 10px; background: #fff; }
.history-detail-item .q-head { border-bottom: 1px dashed #e2e8f0; }
.history-detail-item .q-stem { margin: 6px 0; }
.history-answer { margin: 4px 0; font-size: 13px; }
.history-answer strong { color: #374151; }
.history-report { margin-top: 12px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 10px; background: #f8fbff; }
.history-report h4 { margin: 0 0 6px; color: #1e3a8a; }
@media (max-width: 620px) {
    .history-summary { grid-template-columns: 1fr; }
    .history-detail-box { width: calc(100vw - 20px); }
}


.workspace-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    border: 1px solid #dbe8fb;
    border-radius: 16px;
    background:
        radial-gradient(circle at 92% 8%, rgba(37, 99, 235, .14), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #eef5ff 52%, #f8faff 100%);
    margin-bottom: 16px;
}
.workspace-hero-main { max-width: 720px; }
.workspace-hero h1 { margin: 0 0 7px; font-size: 25px; line-height: 1.25; color: #0f172a; }
.workspace-hero p { margin: 0; color: #52637a; font-size: 14px; line-height: 1.65; }
.workspace-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 9px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e6efff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.workspace-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.workspace-chips span {
    padding: 4px 9px;
    border: 1px solid #d7e5fb;
    border-radius: 999px;
    background: rgba(255,255,255,.75);
    color: #31537c;
    font-size: 12px;
}
.workspace-stat {
    min-width: 132px;
    padding: 16px 18px;
    border: 1px solid #dbe8fb;
    border-radius: 13px;
    background: rgba(255,255,255,.8);
    text-align: center;
}
.workspace-stat span, .workspace-stat small { display: block; color: #64748b; font-size: 12px; }
.workspace-stat strong { display: block; margin: 3px 0; color: #1d4ed8; font-size: 30px; line-height: 1.1; }
.workspace-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.section-heading.compact { margin-bottom: 10px; }
.section-heading h2 { margin: 0 0 3px; font-size: 18px; color: #0f172a; }
.section-heading .card-sub { margin: 0; }
.soft-badge {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
}
.dashboard-section { border-color: #e3eaf4; }
.table-wrap { width: 100%; overflow-x: auto; }
.history-table-compact { min-width: 720px; }


.filter-card { border-color: #e3eaf4; }
.filter-form-modern {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-form-modern .field { margin: 0; }
.filter-form-modern .field-grow { grid-column: span 2; }
.filter-form-modern .field-actions { display: flex; gap: 8px; align-items: end; }
.question-results { margin-top: 16px; }
.question-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.question-grid .q-card { margin: 0; height: 100%; border-color: #e3eaf4; }
.question-grid .q-card:hover { border-color: #bfd6f5; box-shadow: 0 5px 18px rgba(30, 64, 120, .06); }
.question-grid .q-stem { font-size: 14px; line-height: 1.6; }
.question-grid .q-options { font-size: 13px; }
.question-grid .q-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }


.compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}
.compose-form-card { border-color: #e3eaf4; }
.compose-form-card #compose-form { display: grid; gap: 2px; }
.compose-side {
    border-color: #dbe8fb;
    background: linear-gradient(180deg, #fbfdff, #f4f9ff);
}
.compose-side h3 { margin: 0 0 10px; font-size: 16px; color: #0f172a; }
.guide-list { margin: 0; padding-left: 18px; color: #52637a; font-size: 13px; line-height: 1.8; }
.guide-list li + li { margin-top: 7px; }
.guide-list strong { color: #1e3a8a; }
.btn-block { width: 100%; margin-top: 4px; }
.compose-recent { margin-top: 16px; border-color: #e3eaf4; }
.paper-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.paper-grid .paper-card { margin: 0; height: 100%; }
.paper-grid .paper-head h3 { font-size: 15px; line-height: 1.4; }
.paper-grid .paper-card .btn { margin-top: 8px; }

@media (max-width: 980px) {
    .filter-form-modern { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    .compose-layout { grid-template-columns: 1fr; }
    .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .workspace-hero { flex-direction: column; align-items: stretch; padding: 20px; }
    .workspace-stat { min-width: 0; }
    .filter-form-modern { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-form-modern .field-grow { grid-column: span 2; }
    .question-grid, .paper-grid { grid-template-columns: 1fr; }
}


#history-table th:last-child,
#history-table td:last-child { min-width: 210px; white-space: nowrap; }
.table-actions { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.table-actions .btn { min-height: 34px; padding: 0 12px; font-size: 13px; }
.filter-form-modern .field-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    display: flex;
    gap: 8px;
    padding-top: 2px;
}
.filter-form-modern .field-actions .btn { min-height: 38px; min-width: 86px; }


.filter-form-modern { align-items: start; }
.filter-form-modern > .field { align-self: start; }
.filter-form-modern .field-actions { align-self: end; }


.account-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #e5ecf5;
    border-radius: 10px;
    background: #fbfdff;
    font-size: 13px;
    color: #64748b;
}
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.verify-banner .inline-form { display: inline-flex; margin: 0; }
.verify-banner a { color: #1d4ed8; text-decoration: underline; }
