/* ==================== 基础样式 ==================== */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --primary-active: #096dd9;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-muted: #8c8c8c;
    --border-color: #d9d9d9;
    --bg-primary: #f0f2f5;
    --bg-white: #ffffff;
    --bg-hover: #f5f5f5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --header-height: 64px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ==================== 布局 ==================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: #001529;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-header .sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-header span {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

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

.nav-item.active {
    color: var(--primary-color);
    background: rgba(24, 144, 255, 0.1);
    border-right-color: var(--primary-color);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.user-info i {
    font-size: 20px;
    color: var(--primary-color);
}

.user-info span {
    font-size: 14px;
    font-weight: 500;
}

.user-info small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.btn-logout {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 77, 79, 0.2);
    border-color: rgba(255, 77, 79, 0.3);
    color: #ff7875;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 顶部导航栏 */
.top-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-hover);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 240px;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* 手机端搜索框：桌面端隐藏 */
.mobile-search {
    display: none;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page-section {
    display: none;
}

.page-section.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.page-section.active#statisticsPage {
    overflow-y: auto;
}

/* 表格容器可滚动，撑满剩余空间 */
.page-section.active .data-table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-primary);
}

.btn:hover {
    opacity: 0.85;
}

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

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

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.btn-icon.btn-danger:hover {
    color: var(--error-color);
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* 桌面端：检测类型和状态并排显示 */
.filter-bar .filter-row-inline {
    display: flex;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== 数据表格 ==================== */
.data-table-container {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: auto;
    flex: 1;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* 列头筛选 */
.col-filter {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.col-filter .filter-icon {
    font-size: 10px;
    margin-left: 4px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.col-filter:hover .filter-icon,
.col-filter.active .filter-icon {
    opacity: 1;
    color: var(--primary-color);
}

.col-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 140px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
    padding: 4px 0;
    margin-top: 4px;
}

.col-filter-dropdown.show {
    display: block;
}

.col-filter-dropdown .filter-option {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

.col-filter-dropdown .filter-option:hover {
    background: var(--bg-hover);
}

.col-filter-dropdown .filter-option.selected {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-draft {
    background: #fff7e6;
    color: #d46b08;
}

.status-draft::before {
    background: #faad14;
}

.status-submitted {
    background: #e6f7ff;
    color: #096dd9;
}

.status-submitted::before {
    background: #1890ff;
}

.status-approved {
    background: #f6ffed;
    color: #389e0d;
}

.status-approved::before {
    background: #52c41a;
}

/* 结论标签 */
.conclusion-pass {
    color: var(--success-color);
    font-weight: 600;
}

.conclusion-fail {
    color: var(--error-color);
    font-weight: 600;
}

.conclusion-pending {
    color: var(--warning-color);
    font-weight: 600;
}

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 4px;
}

/* ==================== 分页 ==================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 12px;
    min-height: 36px;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.page-size-selector select {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    background: var(--bg-white);
    min-width: 50px;
    height: 26px;
}

.page-size-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.pagination button {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

.modal-xlarge {
    max-width: 1200px;
}

.modal-maximize {
    max-width: 96vw;
    width: 96vw;
    max-height: 94vh;
}

.modal-maximize .modal-body {
    max-height: calc(94vh - 130px);
    overflow-y: auto;
}

.modal-fullscreen .modal-overlay {
    position: fixed;
}

.modal-fullscreen-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    z-index: 1001;
}

.modal-fullscreen-content .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--error-color);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

/* ==================== 表单 ==================== */
.form-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group .required {
    color: var(--error-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 表格编辑器 */
.table-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table-editor table {
    width: 100%;
    border-collapse: collapse;
}

.table-editor th,
.table-editor td {
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    text-align: left;
}

.table-editor th {
    background: #fafafa;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.table-input,
.table-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.table-input:focus,
.table-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-add-row {
    margin: 12px;
}

/* ==================== 模板网格 ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

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

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.stat-icon.blue { background: linear-gradient(135deg, #1890ff, #36cfc9); }
.stat-icon.green { background: linear-gradient(135deg, #52c41a, #95de64); }
.stat-icon.red { background: linear-gradient(135deg, #ff4d4f, #ff7875); }
.stat-icon.orange { background: linear-gradient(135deg, #faad14, #ffc53d); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

#statisticsPage {
    overflow-y: auto;
    padding-right: 8px;
    height: 100%;
}

#statisticsPage .chart-container {
    min-height: 320px;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: var(--radius-sm);
    position: relative;
}

.chart-placeholder canvas {
    max-height: 100% !important;
}

/* ==================== 设置页面 ==================== */
.settings-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
}

.settings-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
    height: fit-content;
}

/* 系统信息卡片占满两列 */
.settings-card:first-child:only-child,
#systemInfoCard {
    grid-column: 1 / -1;
}

/* 响应式：小屏幕单列 */
@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr;
    }
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card .badge-admin {
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
}

.settings-card .help-text {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.settings-card .avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-card .avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.settings-card input[readonly] {
    background: #f5f5f5;
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ==================== Toast 提示 ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

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

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

/* ==================== 响应式 ==================== */

/* 平板端 (768px ~ 1200px) */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-container {
        grid-template-columns: 1fr;
    }
    .website-settings-container {
        grid-template-columns: 1fr;
    }
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 800px;
    }
    .filter-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-xlarge .modal-content {
        max-width: 90vw;
    }
}

/* 手机端 (< 768px) */
@media (max-width: 768px) {
    /* 侧边栏 */
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1000;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }

    /* 顶部栏：超紧凑 */
    .top-header {
        height: 44px;
        min-height: 44px;
        padding: 0 10px;
        gap: 6px;
    }
    .header-left {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }
    .page-title {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .menu-toggle {
        padding: 4px;
        font-size: 18px;
        min-width: 32px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }
    /* 手机端隐藏头部搜索框（移到筛选栏） */
    .header-right .search-box {
        display: none;
    }
    /* 手机端显示筛选栏中的搜索框 */
    .mobile-search {
        display: flex !important;
    }
    .mobile-search input {
        width: 100% !important;
    }
    .header-right .btn {
        font-size: 12px;
        padding: 4px 10px;
        min-height: 32px;
        white-space: nowrap;
    }

    /* 页面头部（非报告页面） */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }
    .page-header h1 {
        font-size: 16px;
    }
    .page-header .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 统计卡片 */
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px 12px;
    }

    /* 筛选栏：紧凑布局 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }
    /* 检测类型和状态一行显示 */
    .filter-bar .filter-row-inline {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .filter-bar .filter-row-inline .filter-group {
        flex: 1;
        min-width: 0;
    }
    .filter-group {
        justify-content: space-between;
        width: 100%;
    }
    .filter-group label {
        font-size: 12px;
        white-space: nowrap;
        min-width: 50px;
    }
    .filter-group input,
    .filter-group select {
        min-height: 32px;
        font-size: 14px;
        padding: 4px 8px;
        flex: 1;
    }
    .filter-group span {
        font-size: 12px;
    }
    .search-box input {
        min-height: 32px;
        font-size: 14px;
    }
    /* 手机端筛选栏第一行：搜索框 */
    .filter-bar::before {
        content: '';
        display: none;
    }
    /* 让筛选栏内的搜索框在手机端显示（作为筛选栏第一个元素） */
    .filter-bar .mobile-search {
        display: block;
    }
    /* 重置和批量导出按钮一行显示 */
    .filter-bar > .btn {
        min-height: 32px;
        font-size: 12px;
        padding: 4px 10px;
    }
    .filter-bar > .btn + .btn {
        margin-left: 0;
    }
    /* 用flex容器包裹重置和导出按钮 */
    .filter-bar .filter-actions {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .filter-bar .filter-actions .btn {
        flex: 1;
        min-height: 34px;
        font-size: 13px;
    }

    /* 表格 */
    .data-table-container {
        margin: 0 16px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 900px;
        font-size: 13px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }
    .data-table th:nth-child(3),
    .data-table td:nth-child(3),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        min-width: 80px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .data-table td:last-child {
        min-width: 180px;
    }

    /* 分页：紧凑布局，固定在底部 */
    .pagination-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 6px 10px;
        min-height: 32px;
        gap: 8px;
        background: var(--bg-white);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    }
    .page-size-selector {
        position: absolute;
        left: 10px;
        font-size: 11px;
        gap: 4px;
    }
    .page-size-selector label:first-child {
        display: none; /* 隐藏"每页显示" */
    }
    .page-size-selector label:last-child {
        display: none; /* 隐藏"条" */
    }
    .page-size-selector select {
        height: 24px;
        padding: 2px 6px;
        font-size: 11px;
        min-width: 44px;
    }
    .pagination {
        flex-wrap: nowrap;
        gap: 3px;
        padding: 0;
        flex: 0 1 auto;
    }
    .pagination button {
        min-width: 26px;
        height: 26px;
        padding: 0 4px;
        font-size: 11px;
    }
    .pagination button:first-child,
    .pagination button:last-child {
        min-width: 28px;
    }
    /* 表格容器底部留白，避免被固定分页器遮挡 */
    .data-table-container {
        padding-bottom: 60px;
    }

    /* 表单 */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .form-group {
        margin-bottom: 16px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
    }
    .form-group textarea {
        min-height: 100px;
    }

    /* 按钮 */
    .btn {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 14px;
    }
    .btn-sm {
        min-height: 36px;
        padding: 6px 12px;
    }

    /* 模态框 */
    .modal-content {
        width: 96vw;
        max-width: 96vw;
        margin: 10px auto;
        max-height: 90vh;
    }
    .modal-large .modal-content,
    .modal-xlarge .modal-content {
        width: 96vw;
        max-width: 96vw;
    }
    .modal-body {
        padding: 16px;
        max-height: calc(90vh - 120px);
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-header h2 {
        font-size: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 全屏模态 */
    .modal-fullscreen-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    .modal-fullscreen-content .modal-body {
        max-height: calc(100vh - 120px);
    }

    /* 设置页面 */
    .settings-container {
        grid-template-columns: 1fr;
        padding: 12px 16px;
    }
    .website-settings-container {
        grid-template-columns: 1fr;
    }

    /* 卡片 */
    .card {
        padding: 16px;
    }

    /* 用户列表 */
    .user-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    .user-list-item .user-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 飞书机器人列表 */
    .feishu-bot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    .feishu-bot-item .feishu-bot-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 列头筛选下拉 */
    .col-filter-dropdown {
        position: fixed;
        top: auto;
        left: 16px;
        right: 16px;
        min-width: auto;
        max-height: 60vh;
        overflow-y: auto;
    }

    /* 页面内容 */
    .page-content {
        padding: 0;
    }

    /* 登录页 */
    .login-container {
        padding: 20px;
    }
    .login-box {
        padding: 24px;
    }

    /* 预览面板 */
    .preview-panel {
        padding: 16px;
    }
    .preview-content {
        padding: 16px;
    }

    /* 批量导出 */
    .batch-export-preview {
        padding: 16px;
    }

    /* 图表 */
    .charts-container {
        grid-template-columns: 1fr;
        padding: 12px 16px;
    }

    /* 标签页 */
    .form-tabs {
        flex-wrap: wrap;
    }
    .form-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* 图片预览 */
    .image-preview-modal .modal-content {
        width: 96vw;
        height: auto;
        max-height: 80vh;
    }

    /* Toast */
    .toast-container {
        left: 16px;
        right: 16px;
        top: 16px;
        align-items: stretch;
    }
    .toast {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* 侧边栏遮罩 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* ==================== 暗黑模式 ==================== */
[data-theme="dark"] {
    --primary-color: #177ddc;
    --primary-hover: #3c9ae8;
    --primary-active: #0958a9;
    --success-color: #49aa19;
    --warning-color: #d89614;
    --error-color: #d32029;

    --text-primary: #e8e8e8;
    --text-secondary: #a6a6a6;
    --text-muted: #6b6b6b;

    --border-color: #434343;

    --bg-primary: #141414;
    --bg-white: #1f1f1f;
    --bg-hover: #2a2a2a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 暗黑模式 - 侧边栏 */
[data-theme="dark"] .sidebar {
    background: #1a1a1a;
    border-right: 1px solid #333;
}

[data-theme="dark"] .sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nav-item {
    color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nav-item.active {
    color: var(--primary-color);
    background: rgba(23, 125, 220, 0.15);
    border-right-color: var(--primary-color);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .user-info {
    color: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .user-info small {
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .btn-logout {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .btn-logout:hover {
    background: rgba(211, 32, 41, 0.15);
    border-color: rgba(211, 32, 41, 0.25);
    color: #ff7875;
}

/* 暗黑模式 - 顶部栏 */
[data-theme="dark"] .top-header {
    background: var(--bg-white);
    border-bottom-color: var(--border-color);
}

/* 暗黑模式 - 表格 */
[data-theme="dark"] .data-table {
    border-color: var(--border-color);
}

[data-theme="dark"] .data-table thead th {
    background: #262626;
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .data-table tbody tr {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* 暗黑模式 - 表单 */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #262626;
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(23, 125, 220, 0.2);
}

/* 暗黑模式 - 按钮 */
[data-theme="dark"] .btn-primary {
    background: var(--primary-color);
    color: #fff;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-hover);
}

[data-theme="dark"] .btn-default {
    background: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-default:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 暗黑模式 - 卡片 */
[data-theme="dark"] .stats-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .chart-card {
    background: var(--bg-white);
    border-color: var(--border-color);
}

/* 暗黑模式 - 模态框 */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

/* 暗黑模式 - 状态标签 */
[data-theme="dark"] .status-draft {
    background: rgba(140, 140, 140, 0.15);
    color: #a6a6a6;
}

[data-theme="dark"] .status-submitted {
    background: rgba(24, 144, 255, 0.15);
    color: #40a9ff;
}

[data-theme="dark"] .status-approved {
    background: rgba(82, 196, 26, 0.15);
    color: #73d13d;
}

[data-theme="dark"] .status-rejected {
    background: rgba(255, 77, 79, 0.15);
    color: #ff7875;
}

/* 暗黑模式 - Toast */
[data-theme="dark"] .toast {
    background: #333;
    color: #e8e8e8;
    border-color: #555;
}

/* 暗黑模式 - 分页 */
[data-theme="dark"] .pagination-btn {
    background: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .pagination-btn:hover,
[data-theme="dark"] .pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 暗黑模式 - 筛选栏 */
[data-theme="dark"] .filter-bar {
    background: var(--bg-white);
    border-color: var(--border-color);
}

/* 暗黑模式 - 报告预览 */
[data-theme="dark"] .report-preview {
    background: var(--bg-white);
    color: var(--text-primary);
}

[data-theme="dark"] .report-preview table {
    background: var(--bg-white);
}

[data-theme="dark"] .report-preview th,
[data-theme="dark"] .report-preview td {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .report-preview th {
    background: #262626;
}

/* 暗黑模式 - 搜索框 */
[data-theme="dark"] .search-box input {
    background: #262626;
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* 暗黑模式 - 设置页面 */
[data-theme="dark"] .settings-card .badge-admin {
    background: rgba(23, 125, 220, 0.15);
    color: #40a9ff;
}

[data-theme="dark"] .settings-card .help-text {
    color: var(--text-muted);
}

/* 暗黑模式 - 主题切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    margin-bottom: 8px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(30deg);
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

/* 拖拽时的样式 */
.dragging {
    opacity: 0.5;
}

.drag-over {
    background: rgba(24, 144, 255, 0.05);
    border-color: var(--primary-color) !important;
}

/* 状态标签 - 已驳回 */
.status-rejected {
    background: #fff1f0;
    color: #cf1322;
}

.status-rejected::before {
    background: #ff4d4f;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 420px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: #1890ff;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 8px;
}

.login-header p {
    color: #8c8c8c;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #595959;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.login-form .btn-login {
    width: 100%;
    padding: 14px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.login-form .btn-login:hover {
    background: #40a9ff;
}

.login-form .btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-tips {
    margin-top: 24px;
    padding: 16px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
}

.login-tips h4 {
    font-size: 14px;
    color: #52c41a;
    margin-bottom: 8px;
}

.login-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-tips li {
    font-size: 13px;
    color: #595959;
    padding: 4px 0;
}

.login-tips li code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    font-family: monospace;
}

.login-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ==================== 检测项目管理 ==================== */
.inspection-category {
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.category-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-header h3 i {
    color: var(--primary);
}

.category-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 10px;
}

.category-items .data-table {
    margin-bottom: 0;
    table-layout: fixed;
}

.category-items .data-table th:nth-child(1),
.category-items .data-table td:nth-child(1) {
    width: 50px;
    text-align: center;
}

.category-items .data-table th:nth-child(2),
.category-items .data-table td:nth-child(2) {
    width: 150px;
}

.category-items .data-table th:nth-child(3),
.category-items .data-table td:nth-child(3) {
    width: auto;
}

.category-items .data-table th:nth-child(4),
.category-items .data-table td:nth-child(4) {
    width: 120px;
    text-align: center;
}

.category-items .data-table td:nth-child(3) {
    word-wrap: break-word;
    word-break: break-all;
}

.standard-cell {
    line-height: 1.6;
    font-size: 13px;
    word-wrap: break-word;
    word-break: break-all;
}

.preset-items-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset-items-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

/* ==================== 类别管理 ==================== */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-manager {
    padding: 10px 0;
}

.category-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.category-input-row input {
    flex: 1;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

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

.category-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-name i {
    color: var(--primary);
    font-size: 13px;
}

.category-actions {
    display: flex;
    gap: 6px;
}

.template-preview-content {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 400px;
}

.preview-form-group {
    margin-bottom: 20px;
}

.preview-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.preview-form-group .preview-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fafafa;
    color: var(--text-secondary);
    font-size: 13px;
}

.preview-form-group .preview-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fafafa;
    color: var(--text-secondary);
    font-size: 13px;
    min-height: 80px;
    resize: vertical;
}

.preview-form-group .preview-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fafafa;
    color: var(--text-secondary);
    font-size: 13px;
}

.preview-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 0;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 16px;
    margin-top: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.preview-table th {
    background: #fafafa;
    font-weight: 600;
}

.preview-table td {
    background: #fff;
    color: var(--text-secondary);
}

.empty-state-sm {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.template-preview-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}

.template-preview-content > h3,
.template-preview-content > .preview-section-title {
    grid-column: span 4;
}

.preview-form-group.col-1 {
    grid-column: span 1;
}

.preview-form-group.col-2 {
    grid-column: span 2;
}

.preview-form-group.col-3 {
    grid-column: span 3;
}

.preview-form-group.col-4 {
    grid-column: span 4;
}

/* ==================== 图片上传 ==================== */
.image-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

.uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.uploaded-image-item {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.uploaded-image-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.uploaded-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.uploaded-image-item:hover .remove-image-btn {
    opacity: 1;
}

.remove-image-btn:hover {
    background: #ff1a1a;
}

/* ==================== 网站设置页面 ==================== */
.website-settings-container {
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.site-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.favicon-upload,
.logo-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.favicon-preview {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
}

.logo-preview {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.settings-card.full-width {
    /* 两栏布局下各自占一列 */
}

.settings-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.feishu-bot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.feishu-bot-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feishu-bot-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.feishu-bot-item.active {
    border-color: var(--success-color);
    background: rgba(82, 196, 26, 0.04);
}

.feishu-bot-info {
    flex: 1;
    min-width: 0;
}

.feishu-bot-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feishu-bot-name .active-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(82, 196, 26, 0.15);
    color: var(--success-color);
}

.feishu-bot-webhook {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 500px;
}

.feishu-bot-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
    flex-shrink: 0;
}

.feishu-bot-actions .btn {
    font-size: 13px;
    padding: 4px 12px;
}

/* 暗黑模式 - 网站设置 */
[data-theme="dark"] .feishu-bot-item {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

[data-theme="dark"] .feishu-bot-item.active {
    border-color: var(--success-color);
    background: rgba(82, 196, 26, 0.08);
}

[data-theme="dark"] .feishu-bot-name .active-badge {
    background: rgba(82, 196, 26, 0.15);
    color: #73d13d;
}

/* ==================== 图片灯箱 ==================== */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.4);
}


