/* assets/style.css */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
}

* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 20px;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }

h1, h2, h3 { margin-bottom: 15px; color: #333; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover { background-color: #357abd; }

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}
.btn-danger:hover { background-color: #c0392b; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* 表单 */
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th { background-color: #f8f9fa; }

/* 进度条 */
.progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 10px;
    margin-top: 10px;
    display: none;
}
.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 0.3s;
}

/* 首页 */
.welcome-hero {
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: white;
    position: relative;
    overflow: hidden;
}

.welcome-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.05) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero-icon {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.welcome-hero h1 { 
    font-size: 2.8rem; 
    color: var(--primary-color); 
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.hero-subtitle { 
    font-size: 1.2rem; 
    color: #666; 
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
    position: relative;
    z-index: 1;
}

.feature-item {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-item h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.info-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.info-box p {
    margin: 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

/* 登录页 */
.login-box {
    max-width: 400px;
    margin: 60px auto;
}

/* 提示框 */
.alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}
.alert-success { background-color: #d4edda; color: #155724; }
.alert-error { background-color: #f8d7da; color: #721c24; }

/* ==================== 移动端适配 ==================== */

/* 平板设备 (768px 及以下) */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 20px;
        border-radius: 12px;
    }

    /* 首页适配 */
    .welcome-hero {
        padding: 40px 20px;
    }

    .welcome-hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .hero-icon svg {
        width: 80px;
        height: 80px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px 0;
    }

    .feature-item {
        padding: 20px;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .info-box {
        padding: 15px;
        margin-top: 30px;
    }

    .info-box p {
        font-size: 0.9rem;
    }

    /* 登录页适配 */
    .login-box {
        margin: 30px auto;
    }

    /* 按钮适配 */
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* 表格适配 */
    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }
}

/* 手机设备 (480px 及以下) */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 15px;
        border-radius: 10px;
    }

    /* 首页适配 */
    .welcome-hero {
        padding: 30px 15px;
    }

    .welcome-hero h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    .hero-icon {
        margin-bottom: 20px;
    }

    .hero-icon svg {
        width: 60px;
        height: 60px;
    }

    .feature-grid {
        gap: 15px;
        margin: 20px 0;
    }

    .feature-item {
        padding: 15px;
    }

    .feature-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .feature-item h3 {
        font-size: 1rem;
    }

    .feature-item p {
        font-size: 0.85rem;
    }

    .info-box {
        padding: 12px;
        margin-top: 20px;
    }

    .info-box p {
        font-size: 0.85rem;
    }

    /* 标题适配 */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    /* 按钮适配 */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
        width: auto;
    }

    /* 表单适配 */
    .form-control {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }

    /* 表格适配 - 改为卡片式布局 */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
    }

    td {
        text-align: right;
        padding: 8px;
        position: relative;
        padding-left: 50%;
        border: none;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }

    /* 登录页适配 */
    .login-box {
        margin: 20px auto;
        max-width: 100%;
    }
}
