/* 加载动画页面 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
}

.loading-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.loading-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: logoPulse 2s ease-in-out infinite;
}

.loading-logo svg {
    width: 50px;
    height: 50px;
    color: white;
}

.loading-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.loading-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-inner {
    width: 40%;
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loadingProgress 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px 10px rgba(255, 255, 255, 0.2);
    }
}

@keyframes loadingProgress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(150%);
    }
    100% {
        transform: translateX(250%);
    }
}

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

:root {
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --primary: oklch(0.48 0.14 265);
    --primary-hover: oklch(0.42 0.16 265);
    --primary-light: oklch(0.95 0.025 265);
    --accent: oklch(0.72 0.14 70);
    --accent-light: oklch(0.94 0.04 70);
    --success: oklch(0.52 0.14 155);
    --success-light: oklch(0.94 0.04 155);
    --warn: oklch(0.68 0.16 60);
    --warn-light: oklch(0.94 0.04 60);
    --danger: oklch(0.55 0.2 25);
    --danger-light: oklch(0.95 0.03 25);
    --bg: oklch(0.975 0.004 265);
    --card: oklch(0.995 0.002 265);
    --text: oklch(0.22 0.02 265);
    --text-secondary: oklch(0.52 0.02 265);
    --text-muted: oklch(0.68 0.015 265);
    --border: oklch(0.92 0.008 265);
    --border-light: oklch(0.95 0.005 265);
    --header-bg: oklch(0.24 0.04 265);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --shadow-sm: 0 1px 2px oklch(0.2 0.02 265 / 0.06);
    --shadow: 0 1px 3px oklch(0.2 0.02 265 / 0.08), 0 1px 2px oklch(0.2 0.02 265 / 0.04);
    --shadow-md: 0 4px 12px oklch(0.2 0.02 265 / 0.08);
    --transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-bg);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, oklch(0.35 0.08 265 / 0.4), transparent),
        radial-gradient(ellipse 60% 50% at 80% 20%, oklch(0.3 0.06 200 / 0.3), transparent);
}

.login-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-2xl);
    width: 400px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}

.login-card h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: var(--space-2xl);
    font-weight: 500;
    letter-spacing: 0.08em;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-card input {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg);
}

.login-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.1);
}

.login-hint {
    margin-top: var(--space-xl);
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.btn-primary {
    background: var(--primary);
    color: oklch(0.98 0.005 265);
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: oklch(0.85 0.04 265);
}

.btn-report {
    background: oklch(0.42 0.12 265);
    color: oklch(0.98 0.005 265);
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-report:hover {
    background: oklch(0.38 0.13 265);
}

.btn-report:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 0.3rem 0.5rem;
    transition: opacity var(--transition);
}

.btn-text:hover {
    opacity: 0.7;
}

.main-app {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

header {
    grid-column: 1 / -1;
    background: var(--header-bg);
    color: oklch(0.95 0.01 265);
    padding: 0 var(--space-xl);
    height: 52px;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left h1 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.header-btn {
    background: oklch(1 0 0 / 0.08);
    border: none;
    color: oklch(0.95 0.01 265);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background var(--transition);
}

.header-btn:hover {
    background: oklch(1 0 0 / 0.15);
}

.header-btn .badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger);
    color: oklch(0.98 0.005 25);
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.nav-btn {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.82rem;
    font-weight: 500;
}

.btn-logout {
    background: oklch(1 0 0 / 0.08);
    border: none;
    color: oklch(0.95 0.01 265);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-logout:hover {
    background: oklch(1 0 0 / 0.15);
}

.sidebar {
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: var(--space-lg) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.6rem 0.9rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.content {
    padding: var(--space-xl);
    overflow: hidden;
    height: calc(100vh - 52px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#tab-data-ledger.tab-panel.active {
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.data-ledger-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    flex: 1;
    min-height: 0;
    grid-template-rows: 1fr;
}

.dashboard-overview {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    overflow-y: auto;
    gap: var(--space-md);
    padding-right: var(--space-xs);
}

.dashboard-overview::-webkit-scrollbar {
    width: 3px;
}

.dashboard-overview::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-overview::-webkit-scrollbar-thumb {
    background: oklch(0.88 0.01 265);
    border-radius: 2px;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: var(--space-md);
    flex: 1;
    min-height: 0;
}

.dashboard-overview .chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.dashboard-overview .chart-header {
    padding: var(--space-lg) var(--space-lg) 0;
}

.dashboard-overview .chart-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dashboard-overview .chart-body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    flex: 1;
    position: relative;
    min-height: 0;
}

.dashboard-overview .chart-body canvas {
    width: 100% !important;
    height: 100% !important;
}

.ranking-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    position: sticky;
    top: 0;
    border: 1px solid var(--border);
}

.ranking-panel::-webkit-scrollbar {
    width: 3px;
}

.ranking-panel::-webkit-scrollbar-track {
    background: transparent;
}

.ranking-panel::-webkit-scrollbar-thumb {
    background: oklch(0.88 0.01 265);
    border-radius: 2px;
}

.ranking-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
    border-bottom: 1px solid var(--border-light);
}

.ranking-header h3 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}

.ranking-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.ledger-main {
    min-width: 0;
    overflow-y: auto;
    height: 100%;
}

.ledger-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.ledger-toolbar-left h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.toolbar-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.stat-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    border-color: oklch(0.82 0.04 265);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px oklch(0.48 0.14 265 / 0.15);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
}

.stat-icon.ok {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warn {
    background: var(--warn-light);
    color: var(--warn);
}

.stat-icon.expired {
    background: oklch(0.92 0.06 25);
    color: oklch(0.45 0.18 25);
}

.stat-card[data-status="已过期"] .stat-number {
    color: oklch(0.45 0.18 25);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.donut-chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.donut-chart-card .chart-header {
    padding: var(--space-md) var(--space-lg) 0;
}

.donut-chart-card .chart-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.donut-chart-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg) var(--space-lg) var(--space-xl);
    gap: var(--space-md);
}

.donut-ring-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    flex-shrink: 0;
}

.donut-ring-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-ring-wrap svg circle {
    fill: none;
    stroke-linecap: round;
}

.donut-ring-wrap svg .seg-group {
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.donut-ring-wrap svg .seg-group circle {
    transition: stroke-width 0.3s ease;
}

.donut-ring-wrap svg .seg-group.dimmed-group {
    opacity: 0.35;
}

.donut-ring-wrap svg .seg-group.exploded {
    opacity: 1;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-center-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
}

.donut-center-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: 0 var(--space-sm);
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.category-pill:hover {
    border-color: oklch(0.75 0.06 265);
    background: oklch(0.97 0.01 265);
}

.category-pill.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.category-pill.dimmed {
    opacity: 0.35;
}

.category-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-pill-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
}

.category-pill-count {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.ranking-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md) 0;
}

.ranking-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 var(--space-lg) var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-xs);
}

.ranking-section-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ranking-section-header .ranking-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.ranking-section .ranking-list {
    padding: 0;
}

.ranking-section .ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px var(--space-lg);
    transition: background 0.15s ease;
}

.ranking-section .ranking-item:hover {
    background: var(--bg);
}

.ranking-section .ranking-item + .ranking-item {
    border-top: 1px solid var(--border-light);
}

.ranking-section .ranking-num {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
}

.ranking-section .ranking-num.rank-1 {
    background: oklch(0.88 0.08 75);
    color: oklch(0.4 0.1 75);
}

.ranking-section .ranking-num.rank-2 {
    background: oklch(0.9 0.02 265);
    color: oklch(0.45 0.04 265);
}

.ranking-section .ranking-num.rank-3 {
    background: oklch(0.88 0.04 55);
    color: oklch(0.42 0.06 55);
}

.ranking-section .ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-section .ranking-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-section .ranking-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.ranking-section .empty-tip {
    padding: var(--space-lg);
    font-size: 0.78rem;
}

.donut-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.filter-indicator {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.filter-indicator.active {
    display: flex;
}

.filter-indicator .filter-clear {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.filter-indicator .filter-clear:hover {
    background: oklch(0.48 0.14 265 / 0.1);
}

.chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--border);
}

.chart-header {
    padding: var(--space-lg) var(--space-lg) 0;
}

.chart-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.chart-body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.search-input {
    flex: 1;
    max-width: 280px;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--card);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.08);
}

.cert-list, .task-list, .audit-list, .user-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cert-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.8rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    position: relative;
}

.cert-card:hover {
    border-color: oklch(0.82 0.04 265);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.cert-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cert-status-dot.dot-ok {
    background: var(--success);
}

.cert-status-dot.dot-warn {
    background: var(--warn);
}

.cert-status-dot.dot-expired {
    background: oklch(0.6 0.04 265);
}

.cert-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.cert-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg);
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

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

.cert-name {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    letter-spacing: -0.01em;
}

.cert-date {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
    white-space: nowrap;
}

.cert-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-ok { background: var(--success-light); color: var(--success); }
.badge-warn { background: var(--warn-light); color: var(--warn); }
.badge-expired { background: oklch(0.94 0.02 265); color: oklch(0.5 0.04 265); }

.visibility-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.62rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

.visibility-badge.sensitive {
    background: var(--warn-light);
    color: var(--warn);
}

.visibility-badge.private {
    background: oklch(0.94 0.03 290);
    color: oklch(0.42 0.1 290);
}

.approval-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.62rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

.approval-badge.approved {
    background: var(--success-light);
    color: var(--success);
    animation: pulse-approval 2s infinite;
}

@keyframes pulse-approval {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.cert-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    line-height: 1;
    transition: color var(--transition), background var(--transition);
}

.cert-delete:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.task-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.task-card.completed {
    opacity: 0.5;
}

.task-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.task-icon.pending { background: var(--warn-light); color: var(--warn); }
.task-icon.completed { background: var(--success-light); color: var(--success); }

.task-info { flex: 1; }
.task-title { font-weight: 700; font-size: 0.85rem; letter-spacing: -0.01em; }
.task-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.task-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.btn-complete {
    background: var(--success);
    color: oklch(0.98 0.005 155);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-complete:hover {
    background: oklch(0.48 0.12 155);
}

.btn-view-cert {
    background: var(--primary);
    color: oklch(0.98 0.005 265);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    margin-right: var(--space-xs);
    transition: background var(--transition);
}

.btn-view-cert:hover {
    background: var(--primary-hover);
}

.audit-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.audit-action {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
}

.audit-detail { flex: 1; }
.audit-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; font-weight: 500; }

.user-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.user-info { flex: 1; }
.user-name { font-weight: 700; font-size: 0.85rem; }
.user-meta { font-size: 0.75rem; color: var(--text-muted); }

.role-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
}

.role-manager { background: var(--primary-light); color: var(--primary); }
.role-mengjun { background: var(--accent-light); color: oklch(0.45 0.12 70); }
.role-employee { background: var(--bg); color: var(--text-secondary); }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    background: var(--card);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.upload-zone.has-file {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
    border-style: solid;
}

.upload-zone svg {
    margin-bottom: var(--space-sm);
}

.upload-zone p {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.upload-hint {
    font-size: 0.72rem;
    font-weight: 500;
}

.visibility-options {
    margin-top: var(--space-lg);
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    border: 1px solid var(--border);
}

.visibility-options h3 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.visibility-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.visibility-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.visibility-item input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.visibility-label {
    font-weight: 700;
    font-size: 0.82rem;
    min-width: 90px;
}

.visibility-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.upload-progress {
    margin-top: var(--space-lg);
    background: var(--card);
    padding: var(--space-lg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: indeterminate 1.5s infinite;
}

@keyframes indeterminate {
    0% { width: 0%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

.progress-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    text-align: center;
    font-weight: 500;
}

.upload-result {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.6;
    background: var(--card);
    border: 1px solid var(--border);
}

.upload-result.success {
    background: var(--success-light);
    border-color: oklch(0.88 0.06 155);
    color: oklch(0.35 0.1 155);
}

.upload-result.error {
    background: var(--danger-light);
    border-color: oklch(0.88 0.06 25);
    color: oklch(0.4 0.15 25);
}

.filter-group {
    display: flex;
    gap: var(--space-xs);
}

.filter-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.filter-btn:hover {
    border-color: oklch(0.82 0.04 265);
    color: var(--text);
}

.filter-btn.active {
    background: var(--primary);
    color: oklch(0.98 0.005 265);
    border-color: var(--primary);
}

.settings-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-xl);
    border: 1px solid var(--border);
}

.settings-section h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

.settings-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

.warning-settings {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.warning-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
}

.warning-item label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.warning-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.empty-tip {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-3xl) 0;
    font-size: 0.82rem;
    font-weight: 500;
}

.ranking-panel .empty-tip {
    padding: var(--space-2xl) var(--space-lg);
    font-size: 0.78rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0.15 0.02 265 / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-2xl);
    position: relative;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

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

.modal-body h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.detail-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-image {
    margin-top: var(--space-lg);
    text-align: center;
}

.detail-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-summary {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-actions {
    margin-top: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.edit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.edit-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.edit-form-grid .form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.edit-form-grid .form-group input,
.edit-form-grid .form-group select {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.edit-form-grid .form-group input:focus,
.edit-form-grid .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.08);
    background: var(--card);
}

.notif-modal {
    max-width: 460px;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.notif-header h3 {
    margin: 0;
    font-weight: 800;
}

.notif-header > div {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.notif-item {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--transition);
}

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

.notif-item.unread {
    background: var(--primary-light);
    border-color: oklch(0.88 0.04 265);
}

.notif-type {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: var(--space-xs);
}

.notif-type.warning { background: var(--warn-light); color: var(--warn); }
.notif-type.change { background: var(--primary-light); color: var(--primary); }
.notif-type.task { background: var(--accent-light); color: oklch(0.45 0.12 70); }
.notif-type.approval { background: var(--primary-light); color: var(--primary); }

.notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    font-weight: 500;
}

.add-user-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.add-user-form input,
.add-user-form select {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.add-user-form input:focus,
.add-user-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.08);
}

.category-selector {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
}

.category-selector h3 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.category-options {
    display: flex;
    gap: var(--space-md);
}

.category-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.65rem 1.4rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 600;
}

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

.category-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.category-item input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.category-label {
    font-size: 0.85rem;
}

.upload-form {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

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

.form-group input,
.form-group select {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.08);
    background: var(--card);
}

.form-hint {
    margin-top: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.submit-area {
    margin-top: var(--space-lg);
    text-align: right;
}

.btn-submit-upload {
    padding: 0.7rem 2rem;
    font-size: 0.9rem;
}

.category-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.62rem;
    font-weight: 700;
    margin-left: 0.3rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

.category-badge.cert {
    background: oklch(0.94 0.03 265);
    color: oklch(0.42 0.12 265);
}

.category-badge.award {
    background: var(--accent-light);
    color: oklch(0.45 0.12 70);
}

.approval-type-tag {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.58rem;
    font-weight: 700;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.approval-type-tag.upload-tag {
    background: oklch(0.94 0.03 220);
    color: oklch(0.42 0.12 220);
}

.approval-type-tag.download-tag {
    background: oklch(0.94 0.03 160);
    color: oklch(0.42 0.12 160);
}

.cert-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.download-ranking-card {
    max-height: 350px;
    overflow-y: auto;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    padding: var(--space-sm) 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.55rem var(--space-xl);
    transition: background var(--transition);
}

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

.ranking-item + .ranking-item {
    border-top: 1px solid var(--border-light);
}

.ranking-num {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    flex-shrink: 0;
}

.ranking-num.rank-1 {
    background: var(--accent-light);
    color: oklch(0.42 0.12 70);
}

.ranking-num.rank-2 {
    background: oklch(0.92 0.02 265);
    color: oklch(0.45 0.04 265);
}

.ranking-num.rank-3 {
    background: oklch(0.9 0.04 55);
    color: oklch(0.42 0.08 55);
}

.ranking-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg);
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

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

.ranking-name {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    line-height: 1.3;
}

.ranking-count {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
    background: var(--primary-light);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
}

.advanced-search-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.search-field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.search-field input,
.search-field select {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field input:focus,
.search-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.48 0.14 265 / 0.08);
    background: var(--card);
}

.search-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    justify-content: flex-end;
}

.approval-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.approval-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.approval-card.pending {
    border-color: oklch(0.82 0.08 60);
    background: oklch(0.985 0.01 60);
}

.approval-card.approved {
    opacity: 0.7;
}

.approval-card.rejected {
    opacity: 0.7;
}

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

.approval-title {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.approval-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.approval-review {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.approval-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.approval-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.approval-filter {
    margin-bottom: var(--space-lg);
}

.btn-approve {
    background: var(--success);
    color: oklch(0.98 0.005 155);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-approve:hover {
    background: oklch(0.48 0.12 155);
}

.btn-reject {
    background: oklch(0.55 0.03 265);
    color: oklch(0.98 0.005 265);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-reject:hover {
    background: oklch(0.48 0.03 265);
}

.dashboard-actions {
    display: flex;
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .main-app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: var(--space-sm);
        gap: 2px;
    }

    .nav-btn {
        white-space: nowrap;
        padding: 0.5rem 0.7rem;
        font-size: 0.78rem;
    }

    .nav-btn svg {
        display: none;
    }

    .content {
        max-height: none;
        padding: var(--space-lg);
    }

    .data-ledger-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ledger-main {
        max-height: none;
    }

    .ranking-panel {
        position: static;
        max-height: 300px;
    }

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

    .stat-cards-row {
        grid-template-columns: 1fr;
    }

    .ledger-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .category-options {
        flex-direction: column;
    }

    .cert-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input {
        max-width: 100%;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }
}

.cert-expiry-inline {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--border-light);
    color: var(--text-secondary);
    white-space: nowrap;
}

.cert-expiry-inline.expiry-expired {
    background: var(--danger-light);
    color: var(--danger);
}

.cert-expiry-inline.expiry-warn {
    background: var(--warn-light);
    color: var(--warn);
}

.expired-cert-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.expired-cert-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    transition: box-shadow var(--transition);
}

.expired-cert-card:hover {
    box-shadow: var(--shadow-md);
}

.expired-cert-card .expired-cert-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.expired-cert-card .expired-cert-info {
    flex: 1;
    min-width: 0;
}

.expired-cert-card .expired-cert-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
}

.expired-cert-card .expired-cert-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
}

.expired-cert-card .expired-cert-meta span {
    white-space: nowrap;
}

.expired-cert-card .expired-reason {
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.expired-cert-card .expired-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
    background: var(--danger-light);
    color: var(--danger);
    white-space: nowrap;
}

.expired-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
}

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

.expired-status-orange {
    background: var(--warn-light);
    color: var(--warn);
}

.expired-status-green {
    background: var(--success-light);
    color: var(--success);
}

.expired-status-gray {
    background: var(--border-light);
    color: var(--text-secondary);
}

.expired-status-dark {
    background: var(--text-muted);
    color: white;
}

.expired-status-blue {
    background: var(--primary-light);
    color: var(--primary);
}

.classified-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--danger);
    color: white;
    margin-left: 6px;
    vertical-align: middle;
}

.classified-hint {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 500;
    margin-left: 4px;
}

.classified-placeholder {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cert-card.classified {
    border-left: 3px solid var(--border);
}

.cert-apply-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background: var(--card);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

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

.classified-selector {
    margin-bottom: var(--space-xl);
}

.classified-selector h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text);
}

.classified-options {
    display: flex;
    gap: var(--space-md);
}

.classified-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.classified-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.classified-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.classified-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.classified-label {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.classified-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.classified-item.active .classified-label {
    color: var(--primary);
}

.expired-cert-card .expired-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.expired-cert-card .expired-actions button {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}

.expired-cert-card .expired-actions button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.expired-edit-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.expired-edit-form .form-group-full {
    grid-column: 1 / -1;
}

.expired-edit-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.expired-edit-form input,
.expired-edit-form select,
.expired-edit-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.expired-edit-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* 角色选择框样式 */
.role-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.role-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 100px;
}

.role-select:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.role-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.role-select-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.role-select-wrapper:hover .role-select-arrow {
    color: var(--primary);
}

/* 角色徽章样式 */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.role-superadmin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.role-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

.role-employee {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-color: oklch(0.85 0.04 265);
}

/* 通讯录组织架构 */
.org-chart { display: flex; flex-direction: column; gap: var(--space-md); }
.dept-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.dept-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.dept-header:hover { background: var(--bg); }
.dept-header .dept-toggle { transition: transform 0.2s; flex-shrink: 0; transform-origin: center; }
.dept-header .dept-toggle.collapsed { transform: rotate(-90deg); }
.dept-header .dept-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}
.dept-members { padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-xs); }
.dept-members.collapsed { display: none; }
.dept-member {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.dept-member:hover { background: var(--bg); }
.dept-member-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.7rem; flex-shrink: 0;
}
.sub-dept { margin: var(--space-xs) 0; }
.sub-dept .dept-header {
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    font-size: 0.85rem; font-weight: 500; border-bottom: none;
}
.sub-dept .dept-members { padding: 0 var(--space-sm) var(--space-sm) 1.5rem; }

/* 登录方式标签 */
.login-method {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
