/* ==========================================================================
   评标专家抽取系统 - 公共样式文件
   ========================================================================== */

/* ========== CSS 变量 ========== */
:root {
    /* 主色系 */
    --primary: #2c5f8a;
    --primary-dark: #1e4264;
    --primary-light: #3a7ab5;
    --primary-lighter: #e8f1f9;
    --primary-50: #f0f6fb;

    /* 辅色 */
    --accent: #e8913a;
    --accent-dark: #c97a2a;
    --accent-light: #f5b572;
    --accent-lighter: #fef3e6;

    /* 中性色 */
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f5f7fa;
    --bg-stripe: #fafbfc;
    --border: #e0e4e9;
    --border-light: #ebeef2;
    --text-primary: #1a2332;
    --text-secondary: #5a6577;
    --text-tertiary: #8b95a6;
    --text-white: #ffffff;

    /* 状态色 */
    --success: #2d9d55;
    --success-light: #e7f6ec;
    --warning: #d4a017;
    --warning-light: #fdf5e3;
    --danger: #d4453a;
    --danger-light: #fceae8;
    --info: #3b8bee;
    --info-light: #e7f2fd;
    --purple: #7c5cbc;
    --purple-light: #f0ecf8;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);

    /* 圆角 */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* 过渡 */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;

    /* 布局 */
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --header-height: 56px;
    --content-max: 1400px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-light); }

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8b3c4; }

/* ==========================================================================
   管理后台布局
   ========================================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, #1a3550 100%);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition);
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    gap: 10px;
}

.sidebar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    font-weight: 700;
    color: #fff;
}

.sidebar-brand .brand-text {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.3;
}
.sidebar-brand .brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar-nav .nav-section-label {
    padding: 14px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: rgba(255,255,255,0.7);
    font-size: 13.5px;
    gap: 10px;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 500;
}

.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav .nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    font-style: normal;
}

.sidebar-nav .nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}

/* ========== 主区域 ========== */
.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 顶部栏 */
.topbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.topbar .page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar .topbar-spacer { flex: 1; }

.topbar .topbar-action {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar .topbar-link {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.topbar .topbar-link:hover { color: var(--primary); }

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.topbar .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.topbar .user-name { font-size: 13px; font-weight: 500; }

/* 内容区 */
.content-area {
    flex: 1;
    padding: 20px 24px;
    max-width: var(--content-max);
    width: 100%;
    margin: 0 auto;
}

.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .card-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
}

.card-header .card-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.card-body { padding: 20px; }

/* ==========================================================================
   统计卡片
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.purple::before { background: var(--purple); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--primary-lighter);
    color: var(--primary);
    flex-shrink: 0;
}
.stat-card.accent .stat-icon { background: var(--accent-lighter); color: var(--accent); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.purple .stat-icon { background: var(--purple-light); color: var(--purple); }

.stat-card .stat-info { flex: 1; min-width: 0; }
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-50);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover { background: #258847; border-color: #258847; color: #fff; }

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

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

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    padding: 2px 4px;
    font-size: 13px;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.btn-link:hover { color: var(--primary-light); text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-link.success { color: var(--success); }
.btn-link.warning { color: var(--accent); }

/* ==========================================================================
   表单
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group { flex: 1; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    line-height: 1.5;
}
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44,95,138,0.1);
}
.form-control::placeholder { color: var(--text-tertiary); }

textarea.form-control { resize: vertical; min-height: 72px; }
select.form-control { cursor: pointer; }

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* 搜索栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar .search-box {
    position: relative;
    flex: 1;
    max-width: 320px;
    min-width: 200px;
}

.toolbar .search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
    pointer-events: none;
}

.toolbar .search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    transition: all var(--transition-fast);
}
.toolbar .search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44,95,138,0.1);
}

.toolbar .toolbar-spacer { flex: 1; }

.toolbar .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-card);
    cursor: pointer;
    min-width: 130px;
}

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
}

table.data-table thead th {
    background: var(--bg-stripe);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: relative;
    user-select: none;
}

table.data-table thead th.sortable {
    cursor: pointer;
    transition: background var(--transition-fast);
}
table.data-table thead th.sortable:hover { background: var(--primary-50); }

table.data-table thead th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--text-tertiary);
    opacity: 0.4;
}
table.data-table thead th.sort-asc .sort-arrow { opacity: 1; color: var(--primary); }
table.data-table thead th.sort-desc .sort-arrow { opacity: 1; color: var(--primary); }

table.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

table.data-table tbody tr {
    transition: background var(--transition-fast);
}
table.data-table tbody tr:hover {
    background: var(--primary-50);
}
table.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.table-empty .empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* 操作列 */
.action-group {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* ==========================================================================
   标签/徽章
   ========================================================================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-info { background: var(--info-light); color: var(--info); }
.tag-primary { background: var(--primary-lighter); color: var(--primary); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-default { background: #eef0f3; color: var(--text-secondary); }

.tag-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
}
.tag-dot.success { background: var(--success); }
.tag-dot.warning { background: var(--warning); }
.tag-dot.danger { background: var(--danger); }
.tag-dot.info { background: var(--info); }
.tag-dot.default { background: var(--text-tertiary); }

/* ==========================================================================
   弹窗 Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    backdrop-filter: blur(2px);
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1000px; }
.modal.modal-sm { max-width: 420px; }

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.modal-header .modal-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.modal-header .modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-header .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ==========================================================================
   Toast 通知
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 70px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 400px;
    font-size: 13px;
    border-left: 4px solid var(--primary);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast .toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast .toast-msg { flex: 1; }

.toast.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px); }
}

/* ==========================================================================
   快捷操作
   ========================================================================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.quick-action-card .qa-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.quick-action-card .qa-icon.blue { background: var(--primary-lighter); color: var(--primary); }
.quick-action-card .qa-icon.orange { background: var(--accent-lighter); color: var(--accent); }
.quick-action-card .qa-icon.green { background: var(--success-light); color: var(--success); }

.quick-action-card .qa-info { flex: 1; }
.quick-action-card .qa-title { font-size: 14px; font-weight: 600; }
.quick-action-card .qa-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.quick-action-card .qa-arrow { color: var(--text-tertiary); font-size: 18px; }

/* ==========================================================================
   Dashboard 布局
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* ==========================================================================
   日志列表
   ========================================================================== */
.log-list {
    display: flex;
    flex-direction: column;
}
.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.log-item:last-child { border-bottom: none; }
.log-item .log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}
.log-item .log-content { flex: 1; min-width: 0; }
.log-item .log-text {
    font-size: 13px;
    color: var(--text-primary);
}
.log-item .log-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   抽取流程步骤
   ========================================================================== */
.steps-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.step-item .step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card);
    transition: all var(--transition);
    flex-shrink: 0;
}

.step-item.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--primary-lighter);
}
.step-item.active { color: var(--primary); }

.step-item.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}
.step-item.completed { color: var(--success); }

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
    border-radius: 1px;
    transition: background var(--transition);
}
.step-connector.completed { background: var(--success); }

/* ==========================================================================
   抽取动画 - 摇号效果
   ========================================================================== */
.selection-animation-area {
    text-align: center;
    padding: 40px 20px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.selection-machine {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    perspective: 600px;
}

.slot-reel {
    width: 120px;
    height: 140px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.3), var(--shadow-md);
    border: 3px solid var(--accent);
}

.slot-reel::before, .slot-reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 2;
    pointer-events: none;
}
.slot-reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4), transparent);
}
.slot-reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.4), transparent);
}

.slot-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.1s linear;
}

.slot-item {
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 8px;
    gap: 4px;
}

.slot-item .slot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.2);
}

.slot-item .slot-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.slot-item .slot-spec {
    font-size: 10px;
    opacity: 0.7;
    text-align: center;
}

.slot-reel.locked {
    border-color: var(--success);
    animation: slotLock 0.5s ease;
}

.slot-reel.locked .slot-item .slot-avatar {
    background: var(--accent);
    border-color: var(--accent-light);
}

@keyframes slotLock {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 0 20px rgba(232,145,58,0.5); }
    100% { transform: scale(1); }
}

.selection-result {
    display: none;
}
.selection-result.show { display: block; animation: fadeIn 0.5s ease; }

/* 专家结果卡片 */
.expert-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.expert-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.expert-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--success);
}

.expert-result-card.replaced::before { background: var(--text-tertiary); }
.expert-result-card.rejected::before { background: var(--danger); }
.expert-result-card.pending::before { background: var(--warning); }

.expert-result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.expert-result-card .erc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.expert-result-card .erc-info { flex: 1; min-width: 0; }
.expert-result-card .erc-name { font-size: 14px; font-weight: 600; }
.expert-result-card .erc-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.expert-result-card .erc-actions { display: flex; flex-direction: column; gap: 4px; }

/* 抽取执行按钮 */
.btn-execute {
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    color: #fff;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232,145,58,0.35);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-execute:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(232,145,58,0.45);
}
.btn-execute:active { transform: translateY(0); }

.btn-execute:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-execute .pulse {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(232,145,58,0.4); }
    70% { box-shadow: 0 0 0 16px rgba(232,145,58,0); }
    100% { box-shadow: 0 0 0 0 rgba(232,145,58,0); }
}

/* 项目选择卡片 */
.project-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.project-select-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.project-select-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.project-select-card.selected {
    border-color: var(--primary);
    background: var(--primary-50);
}

.project-select-card .psc-code {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.project-select-card .psc-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.project-select-card .psc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-select-card .psc-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 配置参数展示 */
.config-info-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.config-info-item {
    background: var(--bg-stripe);
    border-radius: var(--radius);
    padding: 12px 16px;
    border: 1px solid var(--border-light);
}

.config-info-item .cil-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.config-info-item .cil-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   抽取记录展开
   ========================================================================== */
.record-detail {
    padding: 16px;
    background: var(--bg-stripe);
    border-radius: var(--radius);
    margin: 8px 0;
    border: 1px solid var(--border-light);
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 8px 0 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
}

.timeline-item .tl-time {
    font-size: 12px;
    color: var(--text-tertiary);
}
.timeline-item .tl-title {
    font-size: 13px;
    font-weight: 500;
    margin-top: 2px;
}
.timeline-item .tl-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==========================================================================
   配置项
   ========================================================================== */
.config-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.config-item:hover { box-shadow: var(--shadow-sm); }

.config-item .config-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.config-item .config-info { flex: 1; }
.config-item .config-name { font-size: 14px; font-weight: 500; }
.config-item .config-key { font-size: 11px; color: var(--text-tertiary); font-family: monospace; }
.config-item .config-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.config-item .config-control {
    flex-shrink: 0;
    min-width: 160px;
}

/* 短信测试结果 */
.sms-test-result {
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.8;
}
.sms-test-result.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}
.sms-test-result.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { display: none; }
.switch .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 12px;
    transition: var(--transition-fast);
    cursor: pointer;
}
.switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition-fast);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ==========================================================================
   详情视图
   ========================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}
.detail-item .dil-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
}
.detail-item .dil-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================================
   分页
   ========================================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 12px 0;
}

.pagination .page-info {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-right: 12px;
}

.pagination .page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0 8px;
}
.pagination .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .sidebar {
        transform: translateX(-100%);
        width: 220px;
    }
    .sidebar.show { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .config-info-panel { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .content-area { padding: 14px; }
    .topbar { padding: 0 14px; }
}

/* ========== 加载状态 ========== */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
}
.loading-overlay .spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-bold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* 打印样式 */
@media print {
    .sidebar, .topbar, .btn, .action-group, .toolbar { display: none !important; }
    .main-area { margin-left: 0; }
    .content-area { padding: 0; max-width: 100%; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
}

/* ========== 代理公司版新增样式 ========== */

.stat-card.mini {
    padding: 12px 16px;
    border-top: 3px solid var(--primary);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-align: center;
}
.stat-card.mini .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}
.stat-card.mini .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stats-tab-btn {
    padding: 6px 16px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.stats-tab-btn:hover { border-color: var(--primary); }
.stats-tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.tag-default { background: #f0f0f0; color: #999; }

.topbar-link {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}
.topbar-link:hover { background: var(--bg-hover); color: var(--primary); }

/* ==========================================================================
   操作留痕时间线（抽取记录详情）
   ========================================================================== */
.audit-trail-timeline {
    position: relative;
    padding-left: 8px;
}
.trail-item {
    position: relative;
    padding-left: 24px;
    padding-bottom: 20px;
}
.trail-item:last-child { padding-bottom: 0; }
.trail-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 1;
}
.trail-dot.last {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}
.trail-line {
    position: absolute;
    left: 5px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}
.trail-item:last-child .trail-line { display: none; }
.trail-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}
.trail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.trail-time {
    font-size: 12px;
    color: var(--text-tertiary);
}
.trail-body {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 筛选栏 */
.filter-bar .form-group .form-label {
    margin-bottom: 2px;
}
.filter-bar .form-control {
    height: 32px;
    padding: 4px 8px;
}

