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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* 取消强制视口高度与弹性布局，使内容自然排布 */
    min-height: auto;
    display: block;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    padding-top: 20px;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fe0;
}

.btn-secondary {
    background: #f0f2ff;
    color: #4a4a4a;
}

.btn-secondary:hover {
    background: #e4e8ff;
}

.auth-tabs {
    display: flex;
    gap: 12px;
    margin: 10px 0 20px;
}

.auth-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f3ff;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-tab.active {
    background: #667eea;
    color: #fff;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 600;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.sidebar-user {
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
}

.sidebar-user-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.sidebar-user-actions {
    display: flex;
    gap: 10px;
}

.sidebar-user-actions .logout-form {
    flex: 1;
}

.sidebar-user-btn {
    width: 100%;
    text-align: center;
    border-radius: 8px;
    padding: 9px 10px;
    font-weight: 600;
}

.sidebar-user-btn-primary {
    background: #667eea;
    color: #fff;
}

.sidebar-user-btn-primary:hover {
    background: #5a6fe0;
}

.sidebar-user-btn-secondary {
    background: rgba(255, 255, 255, 0.85);
    color: #4a4a4a;
}

.sidebar-user-btn-secondary:hover {
    background: #ffffff;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.header {
    text-align: center;
    color: white;
        flex-wrap: wrap;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 36px;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.header-image {
    width: 150px;
    height: 188px;
    margin: 0 auto 10px;
    display: block;
}

.first-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.first-row-module {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.first-row-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.first-row-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.first-row-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.first-row-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.first-row-link {
    display: inline-block;
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.first-row-link:hover {
    background: #764ba2;
}

.first-row-info {
    grid-column: span 2;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 280px;
}

.first-row-info h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 18px;
}

.first-row-info ul {
    list-style-type: none;
    margin-bottom: 10px;
}

.first-row-info li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    font-size: 12px;
    line-height: 1.3;
}

.first-row-info li:last-child {
    border-bottom: none;
}

.first-row-info li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 20px;
    margin-right: 10px;
}

.second-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.module-card-second {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.module-card-second:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.module-icon-second {
    font-size: 36px;
    margin-bottom: 8px;
}

.module-title-second {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.module-description-second {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.module-link-second {
    display: inline-block;
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.module-link-second:hover {
    background: #764ba2;
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 15px;
    font-size: 12px;
}

.footer-icon {
    display: block;
    margin: 10px auto;
    width: 48px;
    height: 60px;
}

/* ==================== home-bak.php 样式 ==================== */

.wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    /* 取消高度约束，随内容自然撑开 */
    min-height: auto;
    height: auto;
    align-items: flex-start;
    padding-top: 0;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0;
    padding-top: 0;
}

.logo-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 0;
    margin-bottom: 20px;
    animation: slideInLeft 0.6s ease-out;
}

.logo-section img {
    width: 120px;
    height: 150px;
    margin-bottom: 15px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-section h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.logo-section p {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

/* 快速导航 */
.quick-nav {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.15);
    animation: slideInLeft 0.7s ease-out;
}

.nav-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #2c3e50;
    text-decoration: none;
    border-left: 4px solid transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    background: white;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(255, 255, 255, 1) 100%);
    border-left-color: transparent;
    padding-left: 24px;
    color: #667eea;
    transform: translateX(2px);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:active {
    transform: translateX(0px);
}

.nav-item-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-item-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sidebar-illustration {
    margin-top: 20px;
    width: 100%;
}

.sidebar-illustration img,
.responsive-illustration img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.responsive-illustration {
    display: none;
}

/* 右侧主内容 */
.main-content {
    flex: 1;
    min-width: 0;
    align-self: flex-start;
    margin-top: 0;
    padding-top: 0;
}

.hero-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-top: 0;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.6s ease-out;
}

.hero-section h1 {
    font-size: 42px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.highlight-text {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
}

/* 模块网格 */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.module-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 4px solid;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out both;
}

.module-card:nth-child(1) {
    animation-delay: 0.1s;
}

.module-card:nth-child(2) {
    animation-delay: 0.2s;
}

.module-card:nth-child(3) {
    animation-delay: 0.3s;
}

.module-card:nth-child(4) {
    animation-delay: 0.4s;
}

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

.module-card:hover::before {
    left: 100%;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.module-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
}

.module-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.module-description {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 39px;
}

.module-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.module-link:hover {
    transform: translateX(4px);
}

/* 特色说明 */
.features-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.7s ease-out;
}

.features-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid #667eea;
    padding: 16px;
    border-radius: 8px;
}

.feature-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 6px;
}

.feature-item p {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* 动画 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) and (min-width: 769px) {
    .wrapper {
        gap: 20px;
        align-items: flex-start;
        flex-wrap: nowrap;
    }

    .sidebar {
        width: 260px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex: 0 0 260px;
    }

    .logo-section {
        margin-bottom: 0;
    }

    .quick-nav {
        flex: 1;
    }

    .sidebar-illustration {
        display: block;
    }

    .responsive-illustration {
        display: none;
    }

    .main-content {
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
    }

    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
        gap: 16px;
        padding-top: 10px;
        align-items: stretch;
    }

    .sidebar {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .quick-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .nav-header {
        grid-column: 1 / -1;
        text-align: center;
    }

    .nav-item {
        justify-content: center;
        flex-direction: column;
        gap: 8px;
        text-align: center;
        border-left: none;
        border-top: 1px solid #f0f0f0;
    }

    .nav-item:first-of-type {
        border-top: none;
    }

    .nav-item:hover {
        padding-left: 20px;
        border-left-color: transparent;
    }

    .sidebar-illustration {
        display: none;
    }

    .responsive-illustration {
        display: block;
        width: 100%;
        order: 2;
    }

    .main-content {
        width: 100%;
    }

    .hero-section {
        padding: 25px;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-section {
        padding: 20px;
    }

    .first-row {
        flex-direction: column;
    }

    .second-row {
        grid-template-columns: 1fr;
    }

    .module-card {
        padding: 18px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon title"
            "desc desc";
        column-gap: 10px;
        row-gap: 8px;
        align-items: center;
    }

    .module-icon {
        grid-area: icon;
        margin-bottom: 0;
        font-size: 40px;
    }

    .module-title {
        grid-area: title;
        margin-bottom: 0;
        font-size: 18px;
    }

    .module-description {
        grid-area: desc;
        margin-bottom: 0;
    }

    .module-link {
        display: none;
    }
}
