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

/* 确保日期和月份输入框可以正常点击 */
input[type="date"],
input[type="month"],
input[type="datetime-local"] {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav button {
    padding: 10px 20px;
    border: none;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.nav button:hover {
    background: #667eea;
    color: white;
}

.nav button.active {
    background: #667eea;
    color: white;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: none;
}

.section.active {
    display: block;
}

h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.projects-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.projects-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.projects-title {
    margin: 0;
    color: #667eea; /* 与其他功能标题保持一致 */
    white-space: nowrap;
}

.projects-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.projects-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.projects-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.projects-filters input,
.projects-filters select {
    padding: 8px;
    min-width: 180px;
    width: auto;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

button:hover {
    background: #5568d3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-form {
    max-width: 400px;
    margin: 100px auto;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 24px;
}

.user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    font-size: 13px;
}

.user-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logout-btn,
.profile-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
}

.profile-btn:hover,
.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.logout-btn:hover {
    background: white;
    color: #667eea;
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-body {
    padding: 20px;
}

/* 项目详情样式 */
.project-detail {
    margin-top: 20px;
}

.detail-section {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.detail-section h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
}

.detail-label {
    font-weight: 600;
    width: 120px;
    color: #666;
}

.detail-value {
    flex: 1;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.member-info {
    flex: 1;
}

.member-actions {
    display: flex;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 成员行样式 */
.member-row {
    transition: background 0.2s;
}

.member-row:hover {
    background: #e9ecef !important;
}

/* 业务看板组件 */
.card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card.warning {
    border-color: #ffe0b3;
    background: #fffaf3;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* 统计卡片样式 */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--stat-color), var(--stat-color-light));
}

.stat-card.stat-primary {
    --stat-color: #667eea;
    --stat-color-light: #9aa7f0;
    border-left: 4px solid #667eea;
}

.stat-card.stat-success {
    --stat-color: #2ecc71;
    --stat-color-light: #58d68d;
    border-left: 4px solid #2ecc71;
}

.stat-card.stat-info {
    --stat-color: #3498db;
    --stat-color-light: #5dade2;
    border-left: 4px solid #3498db;
}

.stat-card.stat-warning {
    --stat-color: #f39c12;
    --stat-color-light: #f7c471;
    border-left: 4px solid #f39c12;
}

.stat-card.stat-danger {
    --stat-color: #e74c3c;
    --stat-color-light: #ec7063;
    border-left: 4px solid #e74c3c;
}

.stat-icon {
    font-size: 36px;
    line-height: 1;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 10px;
}

.subtext {
    color: #999;
    font-size: 12px;
}

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

table th, table td {
    border: 1px solid #eee;
    padding: 8px;
    text-align: left;
}

table th {
    background: #f8f8f8;
    font-weight: 600;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.row-overdue {
    background: #fff5f5;
}

.toast {
    position: fixed;
    right: 20px;
    top: 20px;
    background: #333;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: #2ecc71; }
.toast.error { background: #e74c3c; }
.toast.info { background: #667eea; }

.card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.2;
}

.card-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.subtext {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.list li:last-child {
    border-bottom: none;
}

.bar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.bar-label {
    color: #555;
}

.bar-track {
    background: #f2f3f7;
    border-radius: 999px;
    height: 10px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
}

/* 财务管理导航卡片样式 */
.finance-nav-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e7ff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.finance-nav-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.finance-nav-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.finance-nav-card.active .finance-nav-icon,
.finance-nav-card.active .finance-nav-title,
.finance-nav-card.active .finance-nav-desc {
    color: white;
}

.finance-nav-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.finance-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.finance-nav-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.finance-section-content {
    animation: fadeIn 0.3s ease;
}

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

.bar-value {
    text-align: right;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.member-row label {
    font-size: 12px;
    margin-bottom: 3px;
    color: #666;
}

.member-row select,
.member-row input {
    font-size: 13px;
    padding: 6px;
}

.notification-area {
    position: relative;
}

#roleSwitcherContainer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.92);
}

#roleSwitcherContainer select {
    width: 170px;
    min-width: 150px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 8px;
    background: rgba(255,255,255,0.96);
    color: #333;
}

#roleSwitcherContainer span {
    font-weight: 500;
    color: rgba(255,255,255,0.92);
}

.user-actions button,
.user-actions .notification-btn {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f7ff;
    border: 1px solid #dfe3f0;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: #eef2ff;
    border-color: #cdd5f5;
}

.notification-badge {
    display: inline-block;
    min-width: 18px;
    padding: 2px 6px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

.notification-panel {
    position: absolute;
    right: 0;
    top: 42px;
    width: 320px;
    max-height: 380px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 20;
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.notification-list {
    max-height: 330px;
    overflow-y: auto;
}

.notification-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #f7f9ff;
    font-weight: 600;
}

.notification-message {
    color: #333;
    line-height: 1.5;
}

.notification-time {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.notification-empty {
    padding: 12px;
    text-align: center;
    color: #888;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .member-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .member-row > div {
        width: 100%;
    }
}

