/* ===== 基础样式 ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== 布局结构 ===== */
.container {
    width: 100%;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* ===== 头部样式 ===== */
.header {
    background: #2c3e50;
    color: white;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

.header h2 {
    flex: 1;
    font-size: 1.5rem;
    margin: 0;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.8rem;
    margin-right: 15px;
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    color: #ecf0f1;
}

.user-info a {
    margin-left: 15px;
    color: #ecf0f1;
    transition: opacity 0.3s;
}

.user-info a:hover {
    opacity: 0.8;
}

/* ===== 导航菜单 ===== */
.nav {
    background: #34495e;
    display: flex;
    padding: 0 15px;
}

.nav a {
    color: white;
    padding: 15px;
    transition: background 0.3s;
    text-align: center;
}

.nav a:hover {
    background: #2c3e50;
}

/* ===== 表单元素 ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* ===== 按钮样式 ===== */
button,
.button {
    display: inline-block;
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s;
}

button:hover,
.button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

button:active,
.button:active {
    transform: translateY(0);
}

.button.delete {
    background: #e74c3c;
}

.button.delete:hover {
    background: #c0392b;
}

.button.secondary {
    background: #95a5a6;
}

.button.secondary:hover {
    background: #7f8c8d;
}

/* ===== 表格样式 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 消息提示 ===== */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== 响应式设计 - 平板 ===== */
@media (max-width: 992px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .header h2 {
        font-size: 1.3rem;
    }
    
    .nav a {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
}

/* ===== 响应式设计 - 手机 ===== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        display: none;
        flex-direction: column;
        padding: 0;
    }
    
    .nav.show {
        display: flex;
    }
    
    .nav a {
        padding: 12px 15px;
        border-bottom: 1px solid #2c3e50;
    }
    
    .user-info {
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: space-between;
    }
    
    .user-info a {
        margin-left: 0;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    button,
    .button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* ===== 响应式设计 - 小手机 ===== */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 8px;
    }
    
    .card {
        padding: 12px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="email"],
    select,
    textarea {
        padding: 10px;
        font-size: 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
	
	.login-container {
        margin: 20px auto;
        padding: 10px;
    }
    
    .login-header h2 {
        font-size: 1.3rem;
    }
    
    .login-logo {
        font-size: 2rem;
    }
}

/* ===== 工具类 ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ===== 动画效果 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.full-width {
    width: 100%;
    display: block;
}