/* ============================================================
   工程质量监督智能匹配Agent - 可爱简洁奶油风
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 私有文件库 ===== */
.file-library-card {
    max-width: 1100px;
    margin: 0 auto;
}

.file-library-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.file-auth-panel {
    max-width: 520px;
    margin: 40px auto;
    padding: 34px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #fffaf7, #fff3f4);
}

.file-auth-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.file-auth-panel h3 {
    margin: 0 0 8px;
}

.file-auth-panel p {
    margin: 0 0 20px;
    color: var(--text-secondary);
}

.file-auth-form {
    display: flex;
    gap: 10px;
}

.file-auth-form .form-control {
    flex: 1;
}

.file-upload-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: var(--cream-dark);
}

.file-picker {
    flex: 1;
}

.file-size-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

.file-category-select {
    width: 150px;
}

.file-storage-summary {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.file-list {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: #fffaf8;
}

.file-row-icon {
    flex: 0 0 auto;
    font-size: 24px;
}

.file-row-main {
    min-width: 0;
    flex: 1;
}

.file-row-name {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row-meta {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}

.file-row-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 720px) {
    .file-auth-form,
    .file-upload-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .file-category-select {
        width: 100%;
    }

    .file-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .file-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

:root {
    /* 奶油暖色系 - 更柔和更可爱 */
    --cream: #fef9f6;
    --cream-dark: #fdf3ee;
    --cream-deep: #f9ebe4;
    --peach: #f8b8a8;
    --peach-light: #fccbc0;
    --peach-soft: #ffe4dd;
    --peach-dark: #e89580;
    --rose: #ffc4d4;
    --rose-light: #ffdde6;
    --rose-soft: #fff2f6;
    --lavender: #e8dcf8;
    --lavender-soft: #f6f0fc;
    --mint: #c8eed8;
    --mint-soft: #f0faf4;
    --sky: #cde6f8;
    --sky-soft: #f0f8ff;
    --butter: #fce8b8;
    --butter-soft: #fff9ec;

    /* 文字 */
    --chocolate: #5c4540;
    --chocolate-light: #8a7068;
    --chocolate-soft: #b09890;
    --text-primary: #5c4540;
    --text-secondary: #9a8580;
    --text-hint: #c4b0aa;

    /* 功能色 */
    --success: #7dcc94;
    --success-soft: #e8f8ee;
    --warning: #f5c970;
    --warning-soft: #fff6e6;
    --danger: #e88888;
    --danger-soft: #fdeded;
    --info: #80b8e0;
    --info-soft: #eaf4fc;

    /* 灰阶 */
    --gray-50: #fffaf8;
    --gray-100: #fdf5f2;
    --gray-200: #f7ebe7;
    --gray-300: #eed8d1;
    --gray-400: #d8c0ba;
    --gray-500: #b8a29b;
    --gray-600: #8d7b75;
    --gray-700: #6d5e58;
    --gray-800: #4e423d;
    --gray-900: #3a302c;
    --border: #f2e0da;
    --border-light: #f8ede8;
    --bg: #fef6f2;
    --white: #ffffff;

    /* 圆角 - 更圆润更可爱 */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 999px;

    /* 阴影 - 更柔和 */
    --shadow-xs: 0 1px 3px rgba(232, 149, 128, 0.06);
    --shadow-sm: 0 2px 8px rgba(232, 149, 128, 0.08);
    --shadow: 0 4px 20px rgba(232, 149, 128, 0.10);
    --shadow-lg: 0 10px 36px rgba(232, 149, 128, 0.14);
    --shadow-soft: 0 6px 20px rgba(232, 149, 128, 0.10);
    --shadow-hover: 0 8px 28px rgba(232, 149, 128, 0.16);
}

body {
    font-family: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.65;
    background-image:
        radial-gradient(circle at 8% 15%, rgba(255, 196, 212, 0.18) 0%, transparent 30%),
        radial-gradient(circle at 92% 85%, rgba(248, 184, 168, 0.14) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(255, 221, 230, 0.05) 0%, transparent 40%);
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部标题栏 - 更柔和 ===== */
.app-header {
    background: linear-gradient(135deg, #f8a898 0%, #f6b8a8 35%, #ffc4d4 100%);
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    border-bottom: none;
}

.app-header::before {
    content: "";
    position: absolute;
    top: -60%;
    left: -5%;
    width: 50%;
    height: 220%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.app-header::after {
    content: "";
    position: absolute;
    bottom: -40%;
    right: -5%;
    width: 40%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    background: rgba(255,255,255,0.3);
    border-radius: var(--radius-lg);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: rotate(-5deg) scale(1.05);
}

.app-header h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.08);
    font-family: 'Quicksand', sans-serif;
}

.subtitle {
    font-size: 12px;
    opacity: 0.92;
    margin-top: 3px;
    color: #fffaf8;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-stats {
    display: flex;
    gap: 24px;
    background: rgba(255,255,255,0.22);
    padding: 8px 20px;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    font-family: 'Quicksand', sans-serif;
}

.stat-label {
    font-size: 11px;
    opacity: 0.9;
    color: #fff5f0;
    font-weight: 500;
}

/* AI配置按钮 */
.btn-ai-config {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.btn-ai-config:hover {
    background: rgba(255,255,255,0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.btn-ai-config-label {
    white-space: nowrap;
}

.ai-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s ease;
}

.ai-status-dot.active {
    background: #7dd87d;
    box-shadow: 0 0 6px rgba(125,216,125,0.6);
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== 导航标签 - 更圆润 ===== */
.tab-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Quicksand', sans-serif;
    position: relative;
}

.tab-btn:hover {
    background: var(--rose-soft);
    color: var(--peach-dark);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--peach) 0%, var(--rose) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(248, 184, 168, 0.4);
    transform: translateY(-1px);
}

.tab-icon {
    font-size: 16px;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 面板布局 ===== */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== 卡片 - 更圆润更可爱 ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 18px 22px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, var(--cream) 0%, white 100%);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Quicksand', sans-serif;
}

.card-body {
    padding: 20px 22px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.required {
    color: var(--danger);
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--cream);
    transition: all 0.25s ease;
    font-family: inherit;
    outline: none;
}

.form-control:focus {
    border-color: var(--peach);
    background: white;
    box-shadow: 0 0 0 3px rgba(248, 184, 168, 0.15);
}

.form-control::placeholder {
    color: var(--text-hint);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.textarea-lg {
    min-height: 140px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23c4b0aa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ===== 按钮 - 更可爱 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Quicksand', sans-serif;
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--peach) 0%, var(--peach-dark) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(248, 184, 168, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(248, 184, 168, 0.45);
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--peach-light);
    background: var(--rose-soft);
    color: var(--peach-dark);
}

.btn-cute {
    background: linear-gradient(135deg, var(--rose) 0%, var(--rose-light) 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(255, 196, 212, 0.35);
}

.btn-cute:hover {
    box-shadow: 0 6px 20px rgba(255, 196, 212, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #e07070 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(232, 136, 136, 0.35);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(232, 136, 136, 0.45);
}

.btn-mint {
    background: linear-gradient(135deg, var(--mint) 0%, #98dab2 100%);
    color: #2d6b4a;
    box-shadow: 0 3px 12px rgba(200, 238, 216, 0.4);
}

.btn-lavender {
    background: linear-gradient(135deg, var(--lavender) 0%, #c8b0f0 100%);
    color: #5a3d7a;
    box-shadow: 0 3px 12px rgba(232, 220, 248, 0.4);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
}

.btn-link {
    background: transparent;
    color: var(--peach-dark);
    text-decoration: none;
    padding: 4px 8px;
}

.btn-link:hover {
    background: var(--rose-soft);
}

.btn-icon {
    margin-right: 2px;
}

/* ===== AI内联状态条 ===== */
.ai-inline-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--lavender-soft);
    border: 1px solid var(--lavender);
    border-radius: var(--radius);
    margin-top: 14px;
    font-size: 13px;
}

.ai-inline-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-inline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s ease;
}

.ai-inline-dot.active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(125,204,148,0.5);
}

.ai-inline-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== 示例问题 ===== */
.example-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--butter-soft);
    border: 1px solid var(--butter);
    border-radius: var(--radius);
}

.example-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.example-item {
    padding: 5px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-item:hover {
    background: var(--peach-soft);
    border-color: var(--peach-light);
    color: var(--peach-dark);
    transform: translateY(-1px);
}

/* ===== 匹配结果 ===== */
.result-card .card-body {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.result-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-item {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.25s ease;
}

.match-item:hover {
    border-color: var(--peach-light);
    background: var(--rose-soft);
    box-shadow: var(--shadow-sm);
}

.match-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.match-reg-info {
    flex: 1;
}

.match-reg-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.match-reg-code {
    font-size: 12px;
    color: var(--peach-dark);
    font-weight: 500;
}

.match-clause-num {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.match-score {
    text-align: right;
    flex-shrink: 0;
}

.match-percentage {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
}

.match-percentage.high {
    color: var(--success);
}

.match-percentage.medium {
    color: var(--warning);
}

.match-percentage.low {
    color: var(--text-hint);
}

.match-level-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.match-level-badge.high {
    background: var(--success-soft);
    color: #4a8a5e;
}

.match-level-badge.medium {
    background: var(--warning-soft);
    color: #b8860b;
}

.match-level-badge.low {
    background: var(--gray-100);
    color: var(--text-hint);
}

.mandatory-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    background: var(--danger-soft);
    color: var(--danger);
    margin-left: 6px;
}

.match-clause-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 14px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-top: 8px;
}

.match-keywords {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.match-keywords-label {
    font-size: 11px;
    color: var(--text-hint);
}

.keyword-tag {
    padding: 2px 8px;
    background: var(--lavender-soft);
    border: 1px solid var(--lavender);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: #6b4d8a;
}

.match-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: flex-end;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-hint);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 12px;
    color: var(--text-hint);
}

.loading-state {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-state::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--peach);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 规章制度库 ===== */
.search-bar {
    margin-bottom: 14px;
}

.search-bar .form-control {
    background: white;
}

.regulation-list {
    max-height: 600px;
    overflow-y: auto;
}

.regulation-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.regulation-item:hover {
    border-color: var(--peach-light);
    background: var(--cream);
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.reg-item-info {
    flex: 1;
}

.reg-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.reg-item-code {
    font-size: 12px;
    color: var(--peach-dark);
    margin-top: 2px;
    font-weight: 500;
}

.reg-item-meta {
    font-size: 11px;
    color: var(--text-hint);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.reg-item-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.badge-mandatory {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-normal {
    background: var(--info-soft);
    color: var(--info);
}

.reg-item-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.reg-item-actions .btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
    min-width: auto !important;
}

.search-result-url {
    font-size: 11px;
    color: var(--text-hint);
    margin-top: 4px;
    word-break: break-all;
}

/* ===== 搜索/导入面板 ===== */
.search-import-panel {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.search-import-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.search-import-tab {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    background: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-import-tab:hover {
    border-color: var(--peach-light);
    color: var(--peach-dark);
}

.search-import-tab.active {
    background: linear-gradient(135deg, var(--peach) 0%, var(--rose) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(248, 184, 168, 0.3);
}

.search-import-content {
    display: none;
}

.search-import-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.search-result-item {
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    border-color: var(--peach-light);
    background: var(--rose-soft);
}

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* ===== PDF上传 ===== */
.pdf-mode-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pdf-mode-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.pdf-mode-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: white;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
}

.pdf-mode-option:hover {
    border-color: var(--peach-light);
    background: var(--cream);
}

.pdf-mode-option input[type="radio"] {
    accent-color: var(--peach);
    cursor: pointer;
}

.pdf-mode-hint {
    font-size: 11px;
    color: var(--text-hint);
}

.pdf-upload-area {
    border: 2.5px dashed var(--peach-light);
    border-radius: var(--radius-lg);
    padding: 44px 30px;
    text-align: center;
    background: var(--cream);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pdf-upload-area:hover {
    border-color: var(--peach);
    background: var(--rose-soft);
    transform: scale(1.005);
}

.pdf-upload-area.dragover {
    border-color: var(--peach-dark);
    background: var(--peach-soft);
    transform: scale(1.01);
}

.pdf-upload-icon {
    font-size: 46px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.pdf-upload-area:hover .pdf-upload-icon {
    transform: scale(1.1) rotate(-3deg);
}

.pdf-upload-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.pdf-upload-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

.pdf-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--cream-deep);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--peach) 0%, var(--rose) 50%, var(--lavender) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    width: 0%;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.pdf-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

.pdf-deep-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pdf-deep-stat {
    background: var(--mint-soft);
    border: 1px solid var(--mint);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    text-align: center;
    min-width: 80px;
}

.pdf-deep-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Quicksand', sans-serif;
}

.pdf-deep-stat-label {
    font-size: 11px;
    color: var(--text-hint);
    margin-top: 2px;
}

/* ===== 通知书预览 ===== */
.notice-preview {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 300px;
}

.notice-content {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-primary);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ===== 问题清单 ===== */
.problem-row {
    background: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
}

.problem-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.problem-row-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--peach-dark);
}

.problem-match-result {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--lavender-soft);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #6b4d8a;
}

.matched-ref {
    display: inline-block;
    margin-right: 4px;
    padding: 2px 8px;
    background: white;
    border: 1px solid var(--lavender);
    border-radius: var(--radius-full);
    margin-bottom: 4px;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 69, 64, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, var(--cream) 0%, white 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Quicksand', sans-serif;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-hint);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.modal-body {
    padding: 20px 22px;
}

.modal-hint {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--butter-soft);
    border: 1px solid var(--butter);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    margin-top: 14px;
}

/* ===== 提供商卡片 ===== */
.provider-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.provider-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    background: white;
}

.provider-card:hover {
    border-color: var(--peach-light);
    background: var(--cream);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.provider-card.selected {
    border-color: var(--peach);
    background: var(--rose-soft);
    box-shadow: 0 4px 16px rgba(248, 184, 168, 0.2);
}

.provider-card-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.provider-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.provider-card-desc {
    font-size: 11px;
    color: var(--text-hint);
    margin-top: 3px;
}

/* ===== AI分析 ===== */
.ai-analysis-box {
    background: var(--lavender-soft);
    border: 1px solid var(--lavender);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-badge {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, var(--lavender) 0%, #c8b0f0 100%);
    color: #5a3d7a;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.ai-analysis-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

.ai-reason {
    font-size: 12px;
    color: #6b4d8a;
    background: var(--lavender-soft);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.hybrid-banner {
    background: linear-gradient(135deg, var(--peach-soft) 0%, var(--rose-soft) 100%);
    border: 1px solid var(--peach-light);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--peach-dark);
    margin-bottom: 12px;
    text-align: center;
}

.hybrid-section {
    margin-bottom: 16px;
}

.hybrid-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

/* ===== 开关 ===== */
.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.switch-label input[type="checkbox"] {
    display: none;
}

.switch {
    width: 38px;
    height: 22px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    transition: background 0.3s ease;
}

.switch::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.switch-label input:checked + .switch {
    background: linear-gradient(135deg, var(--peach) 0%, var(--rose) 100%);
}

.switch-label input:checked + .switch::after {
    transform: translateX(16px);
}

.switch-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== LLM配置 ===== */
.provider-info {
    background: var(--info-soft);
    border: 1px solid var(--sky);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
}

.provider-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.provider-info-label {
    font-weight: 600;
    color: var(--text-primary);
}

.provider-info-link {
    color: var(--info);
    text-decoration: none;
    font-weight: 500;
}

.provider-info-link:hover {
    text-decoration: underline;
}

.provider-info-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.api-key-input-group {
    display: flex;
    gap: 6px;
}

.api-key-input-group .form-control {
    flex: 1;
}

.api-key-toggle {
    padding: 10px 14px !important;
    min-width: auto !important;
}

.test-result {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-top: 12px;
}

.test-result.success {
    background: var(--success-soft);
    color: #4a8a5e;
    border: 1px solid var(--success);
}

.test-result.error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ===== AI功能说明 ===== */
.ai-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-feature-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--cream);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.ai-feature-item:hover {
    border-color: var(--peach-light);
    background: var(--rose-soft);
    transform: translateX(3px);
}

.ai-feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ai-feature-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.ai-feature-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== 状态面板 ===== */
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-active {
    color: var(--success) !important;
}

.status-inactive {
    color: var(--text-hint) !important;
}

/* ===== 规范详情弹窗 ===== */
.clause-detail {
    padding: 12px 14px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
}

.clause-detail-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--peach-dark);
    margin-bottom: 4px;
}

.clause-detail-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== 复核 ===== */
.review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.review-item {
    padding: 12px 14px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.review-pass {
    color: var(--success);
    font-weight: 600;
}

.review-fail {
    color: var(--danger);
    font-weight: 600;
}

.review-comment {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.review-corrected {
    font-size: 12px;
    color: var(--peach-dark);
    background: var(--peach-soft);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin-top: 6px;
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 360px;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    background: linear-gradient(135deg, var(--success) 0%, #5cb878 100%);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #e07070 100%);
}

.toast.info {
    background: linear-gradient(135deg, var(--info) 0%, #6ba8d8 100%);
}

/* ===== 页脚 ===== */
.app-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-hint);
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.5);
}

/* ===== 滚动条 - 可爱风格 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cream);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--peach-light);
    border-radius: var(--radius-full);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--peach);
}

/* ===== 批量操作栏 ===== */
.batch-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--danger-soft) 0%, var(--rose-soft) 100%);
    border: 1px solid var(--rose);
    border-radius: var(--radius);
    margin: 10px 0;
    animation: fadeIn 0.25s ease;
}

.batch-count {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    margin-right: auto;
}

.batch-count b {
    color: var(--danger);
    font-size: 15px;
}

/* ===== 复选框 ===== */
.reg-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-right: 10px;
    flex-shrink: 0;
}

.reg-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
    position: relative;
}

.reg-checkbox:hover .checkmark {
    border-color: var(--peach);
}

.reg-checkbox input:checked + .checkmark {
    background: linear-gradient(135deg, var(--peach) 0%, var(--rose) 100%);
    border-color: var(--peach);
}

.reg-checkbox input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.search-bar {
    display: flex;
    align-items: center;
}

/* ===== 响应式 ===== */
@media (max-width: 968px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .provider-cards {
        grid-template-columns: 1fr;
    }

    .header-stats {
        gap: 16px;
    }

    .main-content {
        padding: 16px;
    }
}
