/* 样式文件 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

header h1:hover {
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    font-size: 16px;
}

.logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

nav {
    background-color: #333;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    padding: 15px 20px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li:hover {
    background-color: #4CAF50;
    transform: translateY(-1px);
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav ul li:hover a {
    color: #fff;
}

main {
    padding: 30px;
}

.content h2 {
    margin-bottom: 25px;
    color: #4CAF50;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 3px;
}

.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.1);
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
}

.form-section {
    background-color: #f9f9f9;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.form-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

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

.form-group label {
    display: inline-block;
    width: 120px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 300px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-group button {
    padding: 10px 24px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-group button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.table-section {
    margin-bottom: 25px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
}

table tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn {
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 5px;
}

.btn.edit {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.btn.delete {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.search-import-export {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-form input,
.search-form select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-form button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.import-export {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #4CAF50;
}

.stat-card h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
    font-weight: 500;
}

.stat-card p {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.login-container {
    max-width: 450px;
    margin: 100px auto;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.login-container:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4CAF50;
    font-size: 24px;
    font-weight: 600;
}

footer {
    background: linear-gradient(135deg, #333, #222);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 3px solid #4CAF50;
}

footer p {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 响应式设计 */

/* 大屏幕 */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

/* 平板 */
@media (max-width: 992px) {
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    nav ul li {
        padding: 12px 15px;
    }
    
    main {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 小平板 */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .user-info {
        margin-top: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info span {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        padding: 10px;
        border-bottom: 1px solid #555;
    }
    
    main {
        padding: 10px;
    }
    
    .form-group label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="number"],
    .form-group input[type="date"],
    .form-group select,
    .form-group textarea {
        width: 100%;
    }
    
    .search-import-export {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-form {
        margin-bottom: 10px;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .search-form input,
    .search-form select,
    .search-form button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* 表格响应式 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .table-section {
        overflow-x: auto;
    }
}

/* 手机 */
@media (max-width: 480px) {
    header h1 {
        font-size: 16px;
    }
    
    nav ul li {
        padding: 8px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card p {
        font-size: 20px;
    }
    
    .login-container {
        margin: 50px auto;
        padding: 20px;
        max-width: 90%;
    }
    
    footer {
        padding: 10px;
        font-size: 14px;
    }
}