:root {
    /* 主色 - 工程深蓝 */
    --primary: #1e3a5f;
    --primary-dark: #152e4d;
    --primary-light: #e8f0fe;
    --primary-accent: #2d6aa0;
    --primary-glow: rgba(30, 58, 95, 0.12);

    /* 语义色 */
    --success: #0d9488;
    --success-light: #ccfbf1;
    --danger: #e74c3c;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #6366f1;
    --info-light: #e0e7ff;

    /* 背景 */
    --bg: #f0f2f5;
    --bg-alt: #e8eaed;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #243044;
    --sidebar-active: #2d6aa0;
    --header-bg: #ffffff;

    /* 文字 */
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #b0bec5;
    --text-sidebar-active: #ffffff;

    /* 边框 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.12);

    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* 尺寸 */
    --sidebar-width: 260px;
    --header-height: 60px;
}

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

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

/* ====== Header ====== */
.header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(8px);
}

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

.header-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-accent));
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.header-right {
    display: flex;
    gap: 8px;
}

/* ====== Layout ====== */
.layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

/* ====== Sidebar ====== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.sidebar-brand {
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sidebar-active);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sidebar-brand svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.add-unit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 10px 16px;
    background: var(--primary-accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.add-unit-btn:hover {
    background: #3b7eb8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 106, 160, 0.35);
}

.add-unit-btn:active {
    transform: translateY(0);
}

.global-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-sidebar-active);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.global-search-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--primary-accent);
    transform: translateY(-1px);
}

.global-search-btn:active {
    transform: translateY(0);
}

.sidebar-search {
    padding: 0 16px 12px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #546e7a;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-sidebar-active);
    font-family: inherit;
    transition: all 0.2s;
}

.sidebar-search input::placeholder {
    color: #546e7a;
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--primary-accent);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.sidebar-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 3px;
    border: 1px solid transparent;
    position: relative;
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
}

.sidebar-item.active {
    background: var(--sidebar-active);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: white;
    border-radius: 0 3px 3px 0;
}

.sidebar-item-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-sidebar);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-item.active .sidebar-item-name {
    color: var(--text-sidebar-active);
}

.sidebar-item-unit {
    font-size: 11px;
    color: #546e7a;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-item.active .sidebar-item-unit {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-item-info {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.sidebar-item-info .count-on {
    color: #4ade80;
}

.sidebar-item-info .count-off {
    color: #f87171;
}

.sidebar-item.active .sidebar-item-info {
    opacity: 0.9;
}

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

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-sidebar);
    font-size: 13px;
    transition: all 0.15s;
}

.sidebar-footer-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text-sidebar-active);
}

/* ====== Main Content ====== */
.main-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    max-width: calc(100vw - var(--sidebar-width));
}

/* ====== Stats Cards ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s;
    cursor: default;
    border: 1px solid transparent;
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.indigo { background: var(--info-light); color: var(--info); }

.stat-content {
    min-width: 0;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.02em;
}

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

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-sub .high { color: var(--success); font-weight: 600; }
.stat-sub .low { color: var(--danger); font-weight: 600; }

/* ====== Progress Bars ====== */
.progress-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.progress-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.progress-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-card h4 .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.progress-card h4 .dot.green { background: var(--success); }
.progress-card h4 .dot.indigo { background: var(--info); }

.progress-item {
    margin-bottom: 14px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-value {
    font-weight: 700;
    color: var(--text);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-fill.success { background: linear-gradient(90deg, var(--success), #14b8a6); }
.progress-fill.info { background: linear-gradient(90deg, var(--info), #818cf8); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }

/* ====== Charts Area ====== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.charts-grid-full {
    grid-template-columns: 1fr;
}

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

.chart-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-card h4 .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.chart-card h4 .dot.blue { background: var(--primary-accent); }
.chart-card h4 .dot.amber { background: var(--warning); }
.chart-card h4 .dot.teal { background: var(--success); }

.chart-wrapper {
    position: relative;
    width: 100%;
}

.chart-wrapper.height-300 { height: 300px; }
.chart-wrapper.height-280 { height: 280px; }

/* ====== Card ====== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

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

.card-body {
    padding: 24px;
}

/* ====== Table ====== */
.table-wrapper {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 14px 16px;
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

tr:hover td {
    background: #f8fafc;
}

/* ====== Badges ====== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
    color: var(--text);
}

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

.btn-ghost:hover {
    background: var(--border-light);
    color: var(--text);
}

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

.btn-danger:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0a7a6e;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-icon {
    padding: 7px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--border-light);
    color: var(--text);
}

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

/* ====== Forms ====== */
.form-group {
    margin-bottom: 16px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: all 0.15s;
}

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

.form-group textarea { resize: vertical; }

.required { color: var(--danger); }

/* Tip box */
.tip-box {
    padding: 10px 14px;
    background: var(--info-light);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tip-box strong {
    color: var(--info);
}

/* 重复人员警告 */
.duplicate-warning {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    animation: dupWarnIn 0.25s ease-out;
}
.duplicate-warning.warning-exact {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #991b1b;
}
.duplicate-warning.warning-similar {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    color: #92400e;
}
.duplicate-warning strong {
    font-weight: 600;
}
.duplicate-warning .dup-link {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}
@keyframes dupWarnIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
input.duplicate-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-accent);
    flex-shrink: 0;
}

.checkbox-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.checkbox-indicator .check-yes { color: var(--success); font-weight: 600; }
.checkbox-indicator .check-no { color: var(--text-muted); }

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 24px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    color: var(--text);
}

/* 自定义工种输入框 */
#worker-trade-custom {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--primary-accent);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #f8faff;
    transition: all 0.15s;
}

#worker-trade-custom:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 106, 160, 0.1);
}

/* 批量导入预览表格 */
.batch-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 12px;
}

.batch-preview-table th {
    padding: 8px 10px;
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.batch-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light);
}

.batch-preview-table tr.error-row td {
    background: var(--danger-light);
    color: var(--danger);
}

.batch-preview-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* File upload */
.file-upload-group {
    margin-bottom: 16px;
}

.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg);
}

.file-upload-area:hover {
    border-color: var(--primary-accent);
    background: rgba(45, 106, 160, 0.04);
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.file-upload-placeholder span { font-size: 13px; }

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

.contract-status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

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

.file-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    text-align: left;
}

.file-item-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ====== Modal ====== */
.modal-overlay {
    display: flex;
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

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

.modal-lg { max-width: 700px; }
.modal-sm { max-width: 400px; }

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text);
}

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.confirm-message {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.6;
}

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

.toast {
    padding: 14px 22px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary-accent); }
.toast-warning { background: #f59e0b; color: #fff; }

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

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

/* ====== Tabs ====== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius);
    width: fit-content;
}

.tab {
    padding: 8px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-family: inherit;
}

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

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.tab-count {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 11px;
    background: transparent;
    margin-left: 4px;
    font-weight: 600;
}

.tab.active .tab-count {
    background: var(--primary-light);
    color: var(--primary);
}

/* ====== Worker list header ====== */
.worker-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.worker-list-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.subcontractor-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 18px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.subcontractor-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ====== File link ====== */
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-accent);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}

.file-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.file-missing {
    color: var(--text-muted);
    font-size: 13px;
}

/* ====== Empty state ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Sidebar scrollbar */
.sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

/* ====== File preview ====== */
.file-preview-container { text-align: center; }
.file-preview-container img { max-width: 100%; border-radius: var(--radius); }
.file-preview-container iframe { width: 100%; height: 600px; border: none; }
.file-preview-download { margin-top: 16px; }

/* ====== Worker stats mini cards ====== */
.worker-mini-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.worker-mini-stat {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
}

.worker-mini-stat .mini-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.worker-mini-stat .mini-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ====== Search Input ====== */
.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: all 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(45, 106, 160, 0.1);
}

/* ====== 批量操作复选框 ====== */
.batch-checkbox {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary-accent);
    vertical-align: middle;
}

/* ====== 选中行高亮 ====== */
tr.row-selected td {
    background: rgba(45, 106, 160, 0.06) !important;
}

tr.row-selected:hover td {
    background: rgba(45, 106, 160, 0.1) !important;
}

/* ====== 批量操作工具栏 ====== */
.batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--primary-light);
    border: 1px solid rgba(45, 106, 160, 0.2);
    border-radius: var(--radius);
    animation: batchToolbarIn 0.2s ease;
    flex-wrap: wrap;
    gap: 10px;
}

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

.batch-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-toolbar-left svg {
    color: var(--primary);
    flex-shrink: 0;
}

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

.batch-toolbar-text strong {
    color: var(--primary);
    font-weight: 700;
}

.batch-toolbar-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ====== 快速筛选 ====== */
.quick-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.quick-filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 2px;
}
.quick-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.quick-filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}
.quick-filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 500;
}
.quick-filter-chip.active .quick-filter-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.quick-filter-chip.clear {
    border-color: transparent;
    color: var(--text-muted);
    background: transparent;
    padding: 5px 8px;
}
.quick-filter-chip.clear:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.06);
}
.quick-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}
.quick-filter-clear {
    margin-left: 2px;
    opacity: 0.7;
    flex-shrink: 0;
}
.quick-filter-chip svg {
    fill: none !important;
}

/* ====== 批量导入结果 ====== */
.batch-result-summary {
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    animation: batchResultIn 0.4s ease-out;
}
.batch-result-summary.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
}
.batch-result-summary.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}
.batch-result-summary.danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
}
.batch-result-summary svg { display: block; margin: 0 auto 12px; }
.batch-result-summary h4 { font-size: 18px; margin-bottom: 4px; }
.batch-result-summary p { font-size: 13px; opacity: 0.75; margin: 0; }
.batch-result-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 4px;
    animation: batchDetailsIn 0.5s ease-out;
}
.batch-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-secondary);
    animation: batchItemIn 0.4s ease-out backwards;
}
.batch-result-item:nth-child(1) { animation-delay: 0.1s; }
.batch-result-item:nth-child(2) { animation-delay: 0.2s; }
.batch-result-item:nth-child(3) { animation-delay: 0.3s; }
.batch-result-item.success { border-left: 3px solid var(--success); }
.batch-result-item.warning { border-left: 3px solid var(--warning); }
.batch-result-item.danger { border-left: 3px solid var(--danger); }
.batch-result-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.batch-result-item.success .batch-result-dot { background: var(--success); }
.batch-result-item.warning .batch-result-dot { background: var(--warning); }
.batch-result-item.danger .batch-result-dot { background: var(--danger); }
.batch-result-item strong {
    font-size: 18px; font-weight: 700; min-width: 28px; text-align: center;
}
.batch-result-fail-list {
    margin-top: 4px; padding: 8px 12px;
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    font-size: 12px; max-height: 120px; overflow-y: auto;
}
.batch-fail-item {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 4px 0; border-bottom: 1px solid var(--border);
}
.batch-fail-item:last-child { border-bottom: none; }
.batch-fail-reason { color: var(--danger); font-size: 11px; }

@keyframes batchResultIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes batchDetailsIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes batchItemIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* ====== Spinner ====== */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 系统动画 ====== */
.main-content > * {
    animation: pageIn 0.3s ease-out;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar {
    transition: width 0.25s ease;
}
.sidebar-item {
    transition: all 0.18s ease;
}
.sidebar-item:hover {
    transform: translateX(3px);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.progress-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.progress-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.progress-fill {
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chart-container canvas {
    animation: chartFadeIn 0.5s ease-out;
}
@keyframes chartFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.card {
    transition: box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: var(--shadow-sm);
}

.table-wrapper tbody tr {
    transition: background 0.15s ease, transform 0.15s ease;
}
.table-wrapper tbody tr:hover {
    background: rgba(30, 58, 95, 0.03);
    transform: translateX(2px);
}
.table-wrapper tbody tr.selected-row {
    background: rgba(30, 58, 95, 0.06);
}

.btn {
    transition: all 0.18s ease;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn:active {
    transform: translateY(0);
}

.worker-mini-stat {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.worker-mini-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-filter-chip {
    transition: all 0.2s ease;
}
.quick-filter-chip:hover {
    transform: scale(1.04);
}

.tab {
    transition: all 0.2s ease;
}
.tab:hover {
    background: var(--bg-tertiary);
}

/* ====== Responsive ====== */
@media (max-width: 1200px) {
    .charts-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .progress-section { grid-template-columns: 1fr; }
    .worker-mini-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .header-title { font-size: 14px; }
    .header-subtitle { font-size: 11px; }
    .main-content { padding: 16px; }
}

/* ====== Share Panel ====== */
.share-status-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.share-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.share-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.share-status-dot.active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(13, 148, 136, 0.4);
}

.share-status-dot.expired {
    background: var(--danger);
}

.share-status-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 18px;
}

.share-create-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.share-create-section h4,
.share-history-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}

.share-history-section {
    max-height: 260px;
    overflow-y: auto;
}

.share-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.15s;
}

.share-history-item:hover {
    border-color: var(--border);
    background: var(--bg);
}

.share-history-info {
    flex: 1;
    min-width: 0;
}

.share-history-created {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.share-history-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
}

.share-history-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

.share-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.share-badge.view-only {
    background: var(--info-light);
    color: var(--info);
}

.share-badge.view-comment {
    background: var(--warning-light);
    color: var(--warning);
}

.share-badge.active-status {
    background: var(--success-light);
    color: var(--success);
}

.share-badge.expired-status {
    background: var(--danger-light);
    color: var(--danger);
}

.share-badge.revoked-status {
    background: #f1f5f9;
    color: var(--text-muted);
}

/* Header share badge */
#header-share-btn {
    position: relative;
}

#header-share-btn .header-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid white;
}

/* Dashboard share card */
.dashboard-share-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
}

.dashboard-share-card:hover {
    border-color: var(--primary-accent);
    box-shadow: var(--shadow);
}

.dashboard-share-card.shared {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.03), white);
}

.dashboard-share-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard-share-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-share-icon.inactive {
    background: var(--bg);
    color: var(--text-muted);
}

.dashboard-share-icon.active {
    background: var(--success-light);
    color: var(--success);
}

.dashboard-share-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.dashboard-share-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.canvas-watermark {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.04;
    font-size: 120px;
    font-weight: 900;
    color: var(--text);
    transform: rotate(-25deg);
    white-space: nowrap;
    letter-spacing: 0.1em;
}

/* ====== 在线部署分享样式 ====== */

.share-type-options {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.share-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.share-type-label input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.share-online-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f5ff;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.share-online-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}

.share-deploy-status {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
}

.share-deploy-status.deploying {
    background: #fff8e6;
    border: 1px solid #f0c040;
    color: #8b6914;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-deploy-status.success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.share-deploy-status.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.deploy-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: deploy-spin 0.8s linear infinite;
}

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

.share-online-url-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.share-online-url-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.share-online-url-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-online-url-box input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--primary);
    background: var(--bg-secondary);
}

.share-online-url-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.share-history-actions .btn-copy-link {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
}

.share-history-actions .btn-copy-link:hover {
    background: var(--primary);
    color: white;
}

.share-badge.deployed-status {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* ====== 少数民族统计预警 ====== */
.ethnicity-total-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: #eef2ff;
    padding: 3px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.ethnicity-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
}

.ethnicity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ethnicity-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.ethnicity-alert {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.ethnicity-alert.info {
    background: #dbeafe;
    color: #1e40af;
}

.ethnicity-alert.warning {
    background: #fef9c3;
    color: #a16207;
}

.ethnicity-footer {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
}

.ethnicity-footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .share-online-url-box {
        flex-direction: column;
    }
    .share-type-options {
        flex-direction: column;
        gap: 12px;
    }
}

/* ====== UI 升级：卡片、动画、过渡 ====== */
.card-hover {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.progress-fill {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn {
    transition: all 0.2s ease;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.sidebar-item {
    transition: background 0.2s ease, transform 0.15s ease;
}
.sidebar-item:hover {
    transform: translateX(2px);
}

table tbody tr {
    transition: background 0.15s ease;
}

.chart-card, .progress-card {
    transition: box-shadow 0.3s ease;
}
.chart-card:hover, .progress-card:hover {
    box-shadow: var(--shadow);
}

/* 渐入动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.stats-grid > .stat-card {
    animation: fadeInUp 0.4s ease backwards;
}
.stats-grid > .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid > .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid > .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid > .stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ====== 少数民族工人详情弹窗 ====== */
.minority-worker-chip {
    font-size: 12px;
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}
.minority-worker-chip:hover {
    background: #e0f2fe;
    border-color: var(--primary-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.minority-worker-chip.expanded {
    background: #dbeafe;
    border-color: var(--primary);
}
.minority-worker-chip.departed {
    background: #f8fafc;
    color: var(--text-muted);
}
.minority-worker-chip.departed:hover {
    background: #f1f5f9;
}

.worker-detail-popup {
    position: fixed;
    z-index: 2000;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 12px 16px;
    min-width: 280px;
    max-width: 340px;
    animation: popIn 0.2s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.wdp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}
.wdp-label {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 12px;
}
.wdp-value {
    color: var(--text);
    text-align: right;
    font-weight: 500;
}
.wdp-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 0;
}

/* ====== 云协作在线用户 Tooltip ====== */
.online-badge-wrapper {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}
.online-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--badge-color) 12%, transparent);
    color: var(--badge-color);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.online-badge-pill:hover {
    background: color-mix(in srgb, var(--badge-color) 20%, transparent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--badge-color) 25%, transparent);
}
.online-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--badge-color);
    display: inline-block;
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--badge-color) 40%, transparent); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px transparent; }
}

.online-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    overflow: hidden;
}
.online-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.online-tooltip-arrow {
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: rotate(45deg);
}
.online-tooltip-header {
    padding: 12px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.online-tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.online-tooltip-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 2px 8px;
    border-radius: 10px;
}
.online-tooltip-list {
    padding: 8px;
    max-height: 240px;
    overflow-y: auto;
}
.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.online-user-item:hover {
    background: var(--bg-alt);
}
.online-user-item.is-me {
    background: var(--primary-light);
}
.online-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.online-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.online-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.online-user-me {
    color: var(--primary-accent);
    font-weight: 400;
    margin-left: 2px;
}
.online-user-status {
    font-size: 11px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}
.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}
.online-user-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.online-tooltip-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--primary-accent);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.online-tooltip-footer:hover {
    background: var(--primary-light);
}
.online-tooltip-stats {
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-alt, #f8fafc);
}
.online-tooltip-stats span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* 离线用户样式 */
.online-user-item.offline {
    opacity: 0.7;
}
.offline-avatar {
    filter: grayscale(0.6);
}
.offline-name {
    color: var(--text-muted) !important;
}
.online-user-item.offline .online-user-status {
    color: var(--text-muted);
}
.offline-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
}

/* ====== 留言板 ====== */
.message-board-container {
    margin-top: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border);
}
.message-board-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    max-height: 420px;
}
.message-board-divider {
    width: 1px;
    background: var(--border);
}
.mb-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.mb-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.mb-header-left h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}
.mb-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.mb-tag-blue {
    background: var(--info-light);
    color: var(--info);
}
.mb-tag-green {
    background: var(--success-light);
    color: var(--success);
}
.mb-count {
    font-size: 12px;
    color: var(--text-muted);
}
.mb-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mb-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.mb-clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(231, 76, 60, 0.06);
}
.mb-clear-btn:active {
    transform: scale(0.96);
}
.mb-input-area {
    padding: 10px 18px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
}
.mb-input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}
.mb-input-area input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.mb-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mb-list::-webkit-scrollbar {
    width: 5px;
}
.mb-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.mb-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.mb-item {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
    animation: fadeInUp 0.3s ease;
}
.mb-item-mine {
    background: var(--primary-light);
    border-left: 3px solid var(--primary-accent);
}
.chat-item {
    background: var(--success-light);
}
.mb-item-mine.chat-item {
    background: linear-gradient(135deg, var(--primary-light), var(--success-light));
}
.mb-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.mb-item-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}
.mb-item-time {
    font-size: 11px;
    color: var(--text-muted);
}
.mb-item-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}
.mb-item-del {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.mb-item-del:hover {
    opacity: 1;
}
.mb-hint {
    padding: 6px 18px 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .message-board-container {
        flex-direction: column;
    }
    .message-board-divider {
        width: 100%;
        height: 1px;
    }
    .worker-detail-popup {
        min-width: 240px;
    }
}

/* ====== 批量修改 - 快捷工种选择 ====== */
.quick-trade-chip {
    font-size: 12px;
    padding: 3px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    user-select: none;
}
.quick-trade-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-accent);
    color: var(--primary);
    transform: translateY(-1px);
}

/* ====== 工资台账管理 ====== */
.wage-view { padding: 20px; max-width: 1400px; margin: 0 auto; }
.wage-view > * { animation: wageFadeIn 0.35s ease-out; }
@keyframes wageFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.wage-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

/* 导出下拉菜单 */
.wage-export-dropdown { position: relative; display: inline-block; }
.wage-export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.14);
    min-width: 230px;
    z-index: 1200;
    display: none;
    overflow: hidden;
    padding: 6px;
}
.wage-export-menu.show { display: block; animation: wageMenuIn 0.16s ease-out; }
@keyframes wageMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.wage-export-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 7px;
    transition: background 0.15s;
    color: var(--text-primary, #1e293b);
    font-weight: 500;
}
.wage-export-menu-item:hover { background: var(--bg-secondary, #f1f5f9); }
.wage-export-menu-item .menu-desc { font-size: 11px; color: var(--text-muted, #999); font-weight: 400; margin-top: 1px; }

.wage-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.wage-stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    overflow: hidden;
}
.wage-stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}
.wage-stat-card-blue::before { background: #096dd9; }
.wage-stat-card-red::before { background: #cf1322; }
.wage-stat-card-green::before { background: #389e0d; }
.wage-stat-card-purple::before { background: #531dab; }
.wage-stat-card-teal::before { background: #08979c; }
.wage-stat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.wage-stat-icon {
    position: absolute;
    top: 16px; right: 16px;
    opacity: 0.15;
}
.wage-stat-label { font-size: 13px; color: var(--text-muted, #888); margin-bottom: 8px; }
.wage-stat-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wage-stat-sub { font-size: 11px; color: var(--text-muted, #aaa); margin-top: 6px; }

/* 分部明细卡片 */
.wage-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.wage-dept-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.wage-dept-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.wage-dept-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.wage-dept-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.badge-dept1 { background: #e6f7ff; color: #096dd9; }
.badge-dept2 { background: #fff7e6; color: #d46b08; }
.wage-dept-card-body {
    display: flex;
    justify-content: space-around;
    gap: 8px;
}
.wage-dept-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.wage-dept-stat-label {
    font-size: 12px;
    color: var(--text-muted, #999);
}
.wage-dept-stat-value {
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wage-section {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    animation: wageFadeIn 0.3s ease-out;
}
.wage-section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--text, #333); display: flex; align-items: center; gap: 8px; }
.wage-section-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 16px;
    background: var(--primary, #1e3a5f);
    border-radius: 2px;
}

.wage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wage-table th {
    background: var(--bg-soft, #f7fafc);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    border-bottom: 2px solid var(--border, #e2e8f0);
    white-space: nowrap;
}
.wage-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    color: var(--text, #333);
    transition: background 0.15s ease;
}
.wage-table tbody tr:hover { background: var(--bg-hover, #f7fafc); }
.wage-table tbody tr { animation: wageRowSlide 0.25s ease-out; }
@keyframes wageRowSlide { from { opacity: 0; } to { opacity: 1; } }

.wage-ledger-table td { font-size: 12.5px; }

.wage-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 0.15s ease;
}
.wage-tag:hover { transform: scale(1.05); }
.wage-tag-in { background: #e6f7ff; color: #096dd9; }
.wage-tag-out { background: #fff1f0; color: #cf1322; }
.wage-tag-proxy { background: #f9f0ff; color: #531dab; }
.wage-tag-note { background: #f5f5f5; color: #888; }

.sidebar-footer-btn { margin-bottom: 4px; }

/* ====== Tutorial Modal (Enhanced) ====== */
#tutorial-modal .modal {
    max-width: 760px;
    max-height: 88vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#tutorial-modal .modal-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    padding: 0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}
#tutorial-modal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}
#tutorial-modal .modal-header h3 {
    color: #fff;
    font-size: 16px;
    padding: 16px 24px;
    position: relative;
    z-index: 1;
}
#tutorial-modal .modal-header .modal-close {
    position: absolute;
    right: 12px; top: 12px;
    z-index: 2;
    color: rgba(255,255,255,0.7);
}
#tutorial-modal .modal-header .modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
#tutorial-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}
#tutorial-modal .modal-footer {
    padding: 12px 20px;
    margin-top: 0;
    background: #f8fafc;
    border-top: 1px solid var(--border-light, #f1f5f9);
}

/* Tutorial tabs */
.tut-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light, #f1f5f9);
    padding: 0 8px;
    background: #fff;
    overflow-x: auto;
    scrollbar-width: thin;
}
.tut-tab {
    padding: 12px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tut-tab:hover { color: var(--primary, #1e3a5f); }
.tut-tab.active {
    color: var(--primary, #1e3a5f);
    border-bottom-color: var(--primary, #1e3a5f);
    font-weight: 600;
}
.tut-tab-content {
    display: none;
    padding: 20px 24px;
    animation: tutContentFade 0.3s ease;
}
.tut-tab-content.active { display: block; }
@keyframes tutContentFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tutorial content elements */
.tut-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 50%, #3b82f6 100%);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.tut-banner::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 120px;
    background: radial-gradient(circle at right, rgba(255,255,255,0.08), transparent);
}
.tut-banner-title { font-size: 17px; font-weight: 700; }
.tut-banner-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.tut-version-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.tut-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1e293b);
    margin: 16px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tut-section-title:first-child { margin-top: 0; }

.tut-update-list {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.tut-update-list ul { margin: 0; padding-left: 18px; line-height: 1.9; font-size: 13px; color: #0c4a6e; }
.tut-update-list li { margin-bottom: 2px; }

.tut-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.tut-card {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    transition: all 0.25s ease;
    cursor: default;
}
.tut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: var(--primary-accent, #2d6aa0);
}
.tut-card-title { font-weight: 600; font-size: 13px; color: var(--primary, #1e3a5f); margin-bottom: 3px; }
.tut-card-desc { font-size: 12px; color: var(--text-muted, #64748b); line-height: 1.5; }

.tut-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.tut-feature {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.tut-feature::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary, #1e3a5f), var(--primary-accent, #2d6aa0));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.tut-feature:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,0.06); }
.tut-feature:hover::before { transform: scaleX(1); }
.tut-feature-icon { font-size: 18px; margin-bottom: 4px; }
.tut-feature-name { font-weight: 600; font-size: 12px; color: var(--primary, #1e3a5f); margin-bottom: 2px; }
.tut-feature-desc { font-size: 11px; color: var(--text-muted, #64748b); line-height: 1.4; }

.tut-note {
    border-radius: 8px;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 12.5px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.tut-note-info { background: #e6f7ff; border-left: 3px solid #096dd9; color: #0c4a6e; }
.tut-note-warn { background: #fffbe6; border-left: 3px solid #d4a017; color: #92400e; }
.tut-note-danger { background: #fff1f0; border-left: 3px solid #cf1322; color: #991b1b; }
.tut-note-success { background: #f6ffed; border-left: 3px solid #389e0d; color: #166534; }

.tut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 8px 0;
}
.tut-table th {
    background: #f7fafc;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border-bottom: 2px solid var(--border, #e2e8f0);
    white-space: nowrap;
}
.tut-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.tut-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); margin: 8px 0; }

.tut-faq {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    margin: 6px 0;
    overflow: hidden;
    transition: border-color 0.2s;
}
.tut-faq:hover { border-color: var(--primary-accent, #2d6aa0); }
.tut-faq summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--primary, #1e3a5f);
    user-select: none;
    transition: background 0.2s;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tut-faq summary::before {
    content: '▶';
    font-size: 9px;
    transition: transform 0.25s ease;
    color: var(--primary-accent, #2d6aa0);
}
.tut-faq[open] summary::before { transform: rotate(90deg); }
.tut-faq summary:hover { background: #f7fafc; }
.tut-faq-body { padding: 0 14px 10px; font-size: 12px; line-height: 1.6; color: var(--text, #1e293b); }
.tut-faq-body p { margin: 4px 0; }

.tut-changelog-item {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    margin: 6px 0;
    overflow: hidden;
}
.tut-changelog-item summary {
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--primary, #1e3a5f);
    user-select: none;
    transition: background 0.2s;
    list-style: none;
}
.tut-changelog-item summary::before {
    content: '▶';
    font-size: 9px;
    transition: transform 0.25s ease;
    margin-right: 6px;
    color: var(--primary-accent, #2d6aa0);
}
.tut-changelog-item[open] summary::before { transform: rotate(90deg); }
.tut-changelog-item summary:hover { background: #f7fafc; }
.tut-changelog-body { padding: 0 14px 10px; }
.tut-changelog-body ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.8; }

.tut-dismiss-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    background: #fff;
    color: var(--text-muted, #64748b);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tut-dismiss-btn:hover {
    border-color: var(--success, #389e0d);
    color: var(--success, #389e0d);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(56,158,13,0.12);
}

/* ====== Enhanced Button Micro-interactions ====== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    pointer-events: none;
}
.btn:active::after {
    width: 200px;
    height: 200px;
    transition: width 0s, height 0s;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary:hover, .btn-danger:hover {
    box-shadow: 0 6px 16px var(--primary-glow, rgba(30,58,95,0.2));
}
.btn-outline:hover, .btn-ghost:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Modal close button enhancement */
.modal-close {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-close:hover {
    transform: rotate(90deg);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Header button enhancement */
.header-right .btn {
    transition: all 0.2s ease;
}
.header-right .btn:hover {
    transform: translateY(-1px);
}

/* Sidebar item slide-in */
.sidebar-item {
    transition: background 0.2s ease, transform 0.15s ease, border-left-color 0.2s ease;
}

/* Smooth scroll for modal body */
.modal-body {
    scroll-behavior: smooth;
}

/* Tutorial modal scroll styling */
#tutorial-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}
#tutorial-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}
#tutorial-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}
#tutorial-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* ====== 全局工人搜索 ====== */
.global-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.global-search-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.global-search-result-row:hover {
    background: #f0f5ff;
}

.global-search-result-row:last-child {
    border-bottom: none;
}

.global-search-result-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    min-width: 70px;
}

.global-search-result-info {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.global-search-result-info span {
    white-space: nowrap;
}

.global-search-result-unit {
    color: var(--primary);
    font-weight: 500;
}

.global-search-result-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

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

.global-search-empty svg {
    margin: 0 auto 12px;
    display: block;
    opacity: 0.4;
}

/* ====== 代办事项提醒弹窗 ====== */
#todo-reminder-modal .modal {
    border-top: 4px solid #e53e3e;
    animation: todo-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes todo-pop-in {
    0% { transform: scale(0.85) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.todo-reminder-header {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-bottom: 2px solid #e53e3e;
}

.todo-reminder-header h3 {
    color: #c53030;
    font-weight: 700;
}

#todo-reminder-modal .modal-close {
    color: #c53030;
}

#todo-reminder-modal .modal-close:hover {
    background: rgba(229, 62, 62, 0.15);
}

.todo-reminder-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffbf0 0%, #fff5f5 100%);
    border: 1px solid #fed7d7;
    border-left: 4px solid #e53e3e;
    margin-bottom: 10px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.todo-reminder-item:hover {
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.12);
    transform: translateX(2px);
}

.todo-reminder-main {
    flex: 1;
    min-width: 0;
}

.todo-reminder-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
    line-height: 1.4;
}

.todo-reminder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.todo-reminder-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #edf2f7;
    color: #4a5568;
    white-space: nowrap;
}

.todo-reminder-amount {
    font-size: 15px;
    font-weight: 700;
    color: #e53e3e;
    font-variant-numeric: tabular-nums;
}

.todo-reminder-date {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.todo-reminder-actions {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}

/* 工资表单中的代办复选框 */
#wage-add-todo {
    accent-color: #e53e3e;
}
