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

:root {
    --primary: #4a7c4e;
    --primary-light: #6b9e6f;
    --primary-dark: #3a633e;
    --accent: #f5e6c8;
    --accent-dark: #d4c4a0;
    --background: #faf8f2;
    --foreground: #2c3e2d;
    --text-secondary: #6b7c6c;
    --card-bg: #ffffff;
    --border: #e8e4d8;
    --shadow: 0 2px 12px rgba(74, 124, 78, 0.08);
    --shadow-hover: 0 4px 20px rgba(74, 124, 78, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.page {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.page-active {
    display: block;
}

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

/* ========== 语言选择页 ========== */
.language-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 60px 30px 40px;
    background: linear-gradient(180deg, #e8f0e8 0%, var(--background) 40%);
}

.brand-section {
    text-align: center;
    margin-bottom: 50px;
}

.brand-logo {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.brand-slogan {
    font-size: 14px;
    color: var(--text-secondary);
}

.batch-info {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.batch-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.batch-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.language-select {
    flex: 1;
}

.select-tip {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.lang-btn {
    width: 100%;
    padding: 16px 24px;
    margin-bottom: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
}

.lang-btn:active {
    transform: scale(0.98);
}

.lang-btn-primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 4px 15px rgba(74, 124, 78, 0.3);
}

.lang-btn-primary .lang-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.lang-btn-primary .lang-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.lang-btn:not(.lang-btn-primary) .lang-name {
    color: var(--foreground);
    font-size: 16px;
    font-weight: 500;
}

.lang-btn:not(.lang-btn-primary) .lang-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.lang-name {
    font-weight: 500;
}

.lang-desc {
    font-size: 12px;
    margin-top: 2px;
}

.footer-tip {
    text-align: center;
    margin-top: 30px;
}

.footer-tip p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== 通用页头 ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-dark);
    transition: all 0.2s;
}

.back-btn:active {
    transform: scale(0.95);
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--foreground);
}

.lang-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--accent);
    color: var(--primary-dark);
    border-radius: 12px;
    font-weight: 500;
}

.placeholder {
    width: 36px;
}

/* ========== 目录页 ========== */
.catalog-page {
    min-height: 100vh;
    padding-bottom: 30px;
}

.batch-bar {
    background: var(--accent);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 20px;
    border-radius: 10px;
}

.batch-bar .batch-label {
    font-size: 13px;
    color: var(--primary-dark);
}

.batch-bar .batch-number {
    font-size: 15px;
    color: var(--primary-dark);
}

.module-list {
    padding: 0 20px;
}

.module-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.module-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.module-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent) 0%, #fff 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-right: 16px;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
}

.module-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 4px;
}

.module-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-arrow {
    color: var(--text-secondary);
    font-size: 18px;
    margin-left: 10px;
    flex-shrink: 0;
}

/* ========== 详情页 ========== */
.detail-page {
    min-height: 100vh;
    padding-bottom: 30px;
}

.detail-content {
    padding: 20px;
}

.detail-image {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-text {
    margin-bottom: 24px;
}

.detail-text p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--foreground);
    margin-bottom: 14px;
    text-align: justify;
}

.batch-info-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 24px 24px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-qr {
    margin-bottom: 16px;
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--accent) 0%, #fff 100%);
    border: 2px dashed var(--primary-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.qr-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.qr-text {
    font-size: 14px;
    font-weight: 500;
}

.modal-tip {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== 响应式 ========== */
@media (max-width: 360px) {
    .language-page {
        padding: 40px 20px 30px;
    }
    
    .brand-title {
        font-size: 20px;
    }
    
    .module-card {
        padding: 14px;
    }
    
    .module-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
}
#detail-icon {
    background: transparent !important;
}