/* common.css - 通用样式，所有页面共享 */

/* 顶部添加颜色变量 */
:root {
    --primary-color: #007bff;
    --primary-hover: #0069d9;
    --secondary-color: #6c757d;
    --success-color: #4CAF50;
    --success-light: #e8f5e9;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #ddd;
    --text-primary: #333;
    --text-secondary: #666;
    --background-color: #f5f5f5;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
    
    /* 添加原始风格的额外颜色 */
    --gold-color: #ffd700;
    --silver-color: #c0c0c0;
    --bronze-color: #cd7f32;
    --header-color: #333;
    --footer-color: #333;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

header, footer {
    width: 100%;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
}

main {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* 表格通用样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

/* 标签页通用样式 */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 16px;
}

.tab-btn.active {
    border-bottom: 2px solid #333;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 加载和错误提示 */
.loading {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin: 20px 0;
}

.error {
    text-align: center;
    color: #dc3545;
    font-size: 1.1rem;
    margin: 20px 0;
}

/* 通用文字颜色 */
.text-red {
    color: #ff4444;
    font-weight: 500;
}

.text-blue {
    color: #2196F3;
    font-weight: 500;
}

.text-green {
    color: #4CAF50;
    font-weight: 500;
}

/* 按钮样式 */
button.primary {
    padding: 8px 16px;
    background: linear-gradient(to bottom, var(--primary-color), #0062cc);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button.primary:hover {
    background: linear-gradient(to bottom, #0069d9, #005cbf);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button.primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

button.secondary {
    background-color: #fff;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

button.secondary:hover {
    background-color: #e6f7ff;
}

/* 响应式通用样式 */
@media (max-width: 768px) {
    main {
        width: 95%;
        padding: 15px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* 强化响应式导航 */
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex-grow: 1;
        text-align: center;
        min-width: 80px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .tab-btn {
        font-size: 12px;
        padding: 8px 5px;
    }
}

/* 添加到common.css */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* 添加到common.css */
input, select, textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 添加到common.css - 用于交互反馈 */
.animated {
    transition: all 0.3s ease;
}

.btn, button {
    transition: all 0.2s ease;
}

.btn:hover, button:hover {
    transform: translateY(-1px);
}

.btn:active, button:active {
    transform: translateY(1px);
}

/* 添加到common.css */
.loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border: 3px solid var(--light-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    color: var(--text-secondary);
}

/* 添加到common.css */
input[type="month"], input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    background-color: white;
}

input[type="month"]:hover, input[type="date"]:hover {
    border-color: var(--primary-color);
}

/* 美化标题和页眉 */
header {
    background-color: var(--header-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
    padding: 15px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* 美化页脚 */
footer {
    background-color: var(--footer-color);
    padding: 15px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* 美化标签页 */
.tab-btn {
    transition: all 0.3s ease;
    position: relative;
    color: var(--text-secondary);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--text-primary);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* 美化表格 */
table {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 8px;
}

table tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

table tr:hover {
    background-color: rgba(0,0,0,0.04);
} 