/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

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

/* 头部样式 */
header {
    background: #0056b3;
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 24px;
    font-weight: bold;
}

/* 表单样式 */
.form-container {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0056b3, #007bff);
}

.form-container h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 22px;
    text-align: center;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background-color: white;
}

.form-group .radio-group,
.form-group .checkbox-group {
    display: flex;
    gap: 20px;
}

.form-group .radio-option,
.form-group .checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.form-group .checkbox-option label,
.form-group .radio-option label {
    margin: 0;
    vertical-align: middle;
    line-height: 1;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.3);
}

.btn-primary {
    width: 100%;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.edit-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
}

/* 成功/错误消息 */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}

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

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

/* 管理员后台样式 */
.admin-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.admin-header h2 {
    color: #0056b3;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    border-bottom-color: #0056b3;
    color: #0056b3;
    font-weight: bold;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

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

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

table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

table tr:hover {
    background: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-container {
        padding: 20px;
    }
    
    .admin-container {
        padding: 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 导航链接 */
.nav-link {
    color: #0056b3;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
}

.nav-link:hover {
    text-decoration: underline;
}

/* 警告消息样式 */
.warning-message {
    margin-top: 15px;
    padding: 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #0056b3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #0056b3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    color: #666;
}
