/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #666;
    font-size: 14px;
}

.header .user-info {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.header .user-info a {
    color: #667eea;
    text-decoration: none;
    margin: 0 5px;
}

.header .user-info a:hover {
    text-decoration: underline;
}

/* 公告栏 */
.announcement-bar {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.announcement-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    animation: scroll 30s linear infinite;
}

.announcement-scroll:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.announcement-item {
    flex: 0 0 auto;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid #667eea;
}

.announcement-item[data-priority="high"] {
    border-left-color: #e74c3c;
    background: #fef5f5;
}

.announcement-item[data-priority="low"] {
    border-left-color: #95a5a6;
    background: #f8f9fa;
}

.announcement-title {
    font-weight: 600;
    color: #333;
}

.announcement-content {
    color: #666;
    font-size: 13px;
}

.announcement-empty {
    text-align: center;
    color: #999;
    padding: 10px;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.controls select,
.controls button {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.controls select {
    background: white;
    color: #333;
}

.controls select:hover {
    border-color: #667eea;
}

.controls button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 500;
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.controls button.danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab {
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tbody tr:hover {
    background: #f8f9fa;
}

.editable {
    cursor: pointer;
    transition: background 0.2s;
}

.editable:hover {
    background: #e8f4ff;
}

.income-cell {
    font-weight: 600;
    color: #667eea;
}

.note-cell {
    color: #666;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.total-row {
    background: #f0f4ff !important;
    font-weight: 700;
    color: #667eea;
}

/* 统计样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card .label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
}

/* 图表样式 */
.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示框 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
