/* ============================================
   RW Education - Global Frontend Styles
   现代化界面优化版 - 蓝绿青主色调
   ============================================ */

/* ========== CSS Variables ========== */
:root {
    /* 主色调 - 蓝绿青 */
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #E0F2FE;
    --primary-gradient: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    
    /* 辅助色 - 暖橙 */
    --secondary: #F59E0B;
    --secondary-dark: #D97706;
    --secondary-light: #FEF3C7;
    
    /* 功能色 */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    
    /* 文字色 */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    /* 背景色 */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    
    /* 边框 */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    display: block;
}

button {
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    cursor: pointer;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ========== App Header (Gradient) ========== */
.app-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.25);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.header-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.header-logo .logo-sub {
    font-size: 10px;
    opacity: 0.85;
    display: block;
    font-weight: 400;
}

.lang-switch {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    padding: 3px;
    backdrop-filter: blur(10px);
}

.lang-switch button {
    padding: 5px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.85);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.lang-switch button.active {
    background: #fff;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.95);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

/* ========== Language Bar (兼容旧版) ========== */
.lang-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
}

.lang-bar button {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.lang-bar button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.lang-bar button:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========== Container ========== */
.container {
    max-width: 430px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 80px;
    min-height: 60vh;
}

/* ========== Flash Messages ========== */
.flash-msg {
    padding: 14px 16px;
    background: var(--info-light);
    color: #1E40AF;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 4px solid var(--info);
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.flash-msg.error {
    background: var(--danger-light);
    color: #991B1B;
    border-left-color: var(--danger);
}

.flash-msg.success {
    background: var(--success-light);
    color: #065F46;
    border-left-color: var(--success);
}

.flash-msg.warning {
    background: var(--warning-light);
    color: #92400E;
    border-left-color: var(--warning);
}

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

/* ========== Page Title ========== */
.page-title {
    margin-bottom: 16px;
}

.page-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

/* ========== Notice Box ========== */
.notice-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FED7AA 100%);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400E;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.notice-box strong {
    font-weight: 600;
}

.notice-box .notice-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* ========== Section Title ========== */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title .more-link {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== Course Cards ========== */
.course-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.course-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.course-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.course-cover {
    position: relative;
    width: 100%;
    padding-top: 50%; /* 2:1 比例 */
    background: var(--primary-gradient);
    overflow: hidden;
}

.course-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-cover .course-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    z-index: 2;
}

.course-cover .commission-badge {
    position: absolute;
    top: 45px;
    right: 10px;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* 折扣标签 */
.course-cover .discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #EF4444 0%, #F97316 100%);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    z-index: 2;
}

/* 原价（划掉） */
.price-original {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

.price-original-detail {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 10px;
}

/* 倒计时样式 */
.countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #92400E;
}

.countdown-timer .countdown-icon {
    font-size: 12px;
}

.countdown-timer .countdown-text {
    flex: 1;
}

.countdown-timer .countdown-time {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #B45309;
}

/* 详情页倒计时 */
.detail-countdown {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #92400E;
}

.detail-countdown .countdown-icon {
    font-size: 16px;
}

.detail-countdown .countdown-text {
    flex: 1;
}

.detail-countdown .countdown-time {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #B45309;
}

.discount-tag {
    display: inline-block;
    background: linear-gradient(135deg, #EF4444 0%, #F97316 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.course-info {
    padding: 14px;
}

.course-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.price-rwf {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.price-usd {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.commission-tag {
    display: inline-block;
    background: var(--success-light);
    color: var(--success);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* ========== Course Detail Page ========== */
.course-detail-hero {
    position: relative;
    height: 220px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.course-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.course-detail-hero .hero-content {
    position: absolute;
    text-align: center;
    padding: 0 24px;
}

.course-detail-hero h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all var(--transition-fast);
    z-index: 10;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.detail-price-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: -30px 16px 16px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-price .price-main {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.detail-price .price-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.commission-info {
    text-align: right;
}

.commission-info .commission-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.commission-info .commission-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.detail-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 0 16px 16px;
    box-shadow: var(--shadow-card);
}

.detail-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.course-outline-list {
    list-style: none;
}

.course-outline-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.course-outline-list li:last-child {
    border-bottom: none;
}

.lesson-icon {
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 600;
}

.testimonial-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.testimonial-card:last-child {
    margin-bottom: 0;
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.testimonial-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.testimonial-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.testimonial-result {
    font-size: 11px;
    color: var(--success);
    font-weight: 500;
}

.testimonial-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Fixed Bottom Bar */
.fixed-bottom-bar {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.fixed-bottom-bar .btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}

/* ========== Login / Register Page ========== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, #06B6D4 35%, var(--bg-primary) 35%);
    padding-bottom: 0;
}

.auth-header {
    padding: 50px 24px 30px;
    text-align: center;
    color: white;
}

.auth-logo {
    font-size: 56px;
    margin-bottom: 12px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.auth-card {
    margin: 0 16px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-lg);
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ========== Form Styles ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
    background: white;
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.form-input-icon input {
    padding-left: 42px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-agreement input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-agreement a {
    color: var(--primary);
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* ========== User Center ========== */
.user-header {
    background: var(--primary-gradient);
    padding: 24px 16px 50px;
    color: white;
}

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

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-details h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-details p {
    font-size: 12px;
    opacity: 0.9;
}

.user-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.user-content {
    margin-top: -34px;
    padding: 0 16px 16px;
}

/* Commission Overview Card */
.commission-overview-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.commission-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.commission-header .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.commission-header .amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.commission-header .amount small {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.commission-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.commission-stat .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.commission-stat .stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.commission-stat.frozen .stat-value {
    color: var(--warning);
}

.commission-stat.available .stat-value {
    color: var(--success);
}

.commission-stat.withdrawn .stat-value {
    color: var(--text-secondary);
}

/* Promo Card */
.promo-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.promo-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.promo-link-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    outline: none;
}

.copy-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.promo-qrcode {
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.qrcode-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--border-color);
}

.promo-qrcode p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Menu List */
.menu-list {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

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

.menu-item:hover {
    background: var(--bg-tertiary);
}

.menu-item .menu-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.menu-item .menu-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.menu-item .menu-arrow {
    color: var(--border-color);
    font-size: 16px;
}

.menu-item .menu-badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

/* ========== Order Confirm Page ========== */
.order-course-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.order-course-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    overflow: hidden;
}

.order-course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.order-course-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.order-course-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.payment-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.payment-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 10px;
}

.payment-method:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
}

.payment-method.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-method .method-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.payment-method.visa .method-icon {
    background: #1A1F71;
    color: white;
}

.payment-method.paypal .method-icon {
    background: #003087;
    color: white;
}

.payment-method.mtn .method-icon {
    background: #FFCB05;
    color: #222;
}

.payment-method.airtel .method-icon {
    background: #EE3029;
    color: white;
}

.payment-method.offline .method-icon {
    background: #25D366;
    color: white;
}

.payment-method .method-info {
    flex: 1;
}

.payment-method .method-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-method .method-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.payment-method .method-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.payment-method.selected .method-radio {
    border-color: var(--primary);
}

.payment-method.selected .method-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.offline-payment-info {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: none;
}

.offline-payment-info.show {
    display: block;
}

.offline-account {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.8;
}

.offline-account strong {
    color: var(--text-primary);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area .upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.order-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.summary-row .label {
    color: var(--text-secondary);
}

.summary-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.summary-row.total {
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
    padding-top: 12px;
}

.summary-row.total .label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-row.total .value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

/* ========== Order List ========== */
.order-tabs {
    display: flex;
    background: white;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.order-tab {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.order-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.order-list {
    padding: 12px 0;
}

.order-item-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.order-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.order-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.order-status.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.order-status.paid {
    background: var(--success-light);
    color: var(--success);
}

.order-status.refunded {
    background: var(--danger-light);
    color: var(--danger);
}

.order-item-body {
    display: flex;
    gap: 12px;
}

.order-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    overflow: hidden;
}

.order-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-item-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.order-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.order-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

.order-item-actions {
    display: flex;
    gap: 8px;
}

/* ========== Withdraw Page ========== */
.withdraw-header-card {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    margin-bottom: 16px;
}

.withdraw-header-card .label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.withdraw-header-card .amount {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
}

.withdraw-header-card .amount small {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

.withdraw-header-card .tax-hint {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 8px;
}

.withdraw-form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.withdraw-form-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

.withdraw-amount-input {
    position: relative;
    margin-bottom: 12px;
}

.withdraw-amount-input .currency {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}

.withdraw-amount-input input {
    width: 100%;
    padding: 16px 14px 16px 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.withdraw-amount-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.withdraw-quick-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-amount-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.quick-amount-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.withdraw-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.withdraw-method {
    flex: 1;
    padding: 12px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.withdraw-method:hover {
    border-color: var(--primary-light);
}

.withdraw-method.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.withdraw-method .method-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.withdraw-method .method-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.withdraw-history {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
}

.withdraw-history h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}

.withdraw-record {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.withdraw-record:last-child {
    border-bottom: none;
}

.withdraw-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.withdraw-record-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.withdraw-record-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.withdraw-record-status.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.withdraw-record-status.approved {
    background: var(--success-light);
    color: var(--success);
}

.withdraw-record-status.rejected {
    background: var(--danger-light);
    color: var(--danger);
}

.withdraw-record-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* ========== Rule Page ========== */
.rule-page {
    padding: 0;
}

.rule-anchor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
    justify-content: center;
}

.rule-anchor-nav::-webkit-scrollbar {
    display: none;
}

.rule-anchor-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
    flex: 0 0 auto;
}

.rule-anchor-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.rule-section-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 16px;
    box-shadow: var(--shadow-card);
}

.rule-section-card h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-section-card h2 .section-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.rule-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.rule-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
    list-style: disc;
}

.rule-content li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 4px;
}

.rule-highlight {
    background: var(--secondary-light);
    border-left: 3px solid var(--secondary);
    padding: 12px 14px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 12px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rule-bilingual {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 10px 0;
}

.rule-bilingual .en {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.rule-bilingual .rw {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== Footer Navigation ========== */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: white;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-weight: 500;
}

.footer-nav a .nav-icon {
    font-size: 22px;
}

.footer-nav a.active {
    color: var(--primary);
}

.footer-nav a.active .nav-icon {
    transform: scale(1.1);
}

/* ========== Site Footer ========== */
.site-footer {
    padding: 20px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-top: 16px;
}

.site-footer p {
    margin-bottom: 4px;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== Toast Notification ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideDown 0.3s ease;
    display: none;
    color: white;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    display: block;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

.toast.warning {
    background: var(--warning);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== Modal / Dialog ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== Status Badges ========== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-badge.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.paid {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.refunded {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.frozen {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.available {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.withdrawn {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.deducted {
    background: var(--danger-light);
    color: var(--danger);
}

/* ========== Page Transitions ========== */
.page-fade {
    animation: fadeIn 0.25s ease;
}

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

/* ========== Responsive ========== */
@media (min-width: 431px) {
    .footer-nav,
    .fixed-bottom-bar {
        border-left: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
    }
}

@media (max-width: 360px) {
    .commission-stats {
        gap: 8px;
    }
    
    .commission-stat .stat-value {
        font-size: 16px;
    }
    
    .withdraw-methods {
        gap: 6px;
    }
    
    .withdraw-method {
        padding: 10px 4px;
    }
}

/* ========== Utility Classes ========== */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.hidden { display: none; }
.block { display: block; }

.text-center { text-align: center; }
.text-right { text-align: right; }
