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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: var(--gray-800);
    background: var(--gray-100);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== 页面容器 ===== */
.page {
    min-height: 100vh;
    padding-bottom: 70px;
    animation: fadeIn 0.3s ease;
}

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

/* ===== 顶部导航栏 ===== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.header-back {
    position: absolute;
    left: 16px;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 100;
    border-top: 1px solid var(--gray-200);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 11px;
    transition: color 0.2s;
}

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

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* ===== 卡片 ===== */
.card {
    background: white;
    border-radius: 12px;
    margin: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-800);
}

/* ===== 余额卡片 ===== */
.balance-card {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    border-radius: 16px;
    margin: 12px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.balance-unit {
    font-size: 16px;
    font-weight: 400;
}

/* ===== 快捷入口 ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-700);
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
    background: var(--gray-100);
}

.quick-icon.blue { background: #dbeafe; }
.quick-icon.green { background: #d1fae5; }
.quick-icon.orange { background: #fef3c7; }
.quick-icon.red { background: #fee2e2; }
.quick-icon.purple { background: #ede9fe; }

.quick-text {
    font-size: 13px;
    color: var(--gray-600);
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    background: white;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ===== 按钮 ===== */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    display: inline-block;
    width: auto;
}

/* ===== 列表 ===== */
.list {
    background: white;
    border-radius: 12px;
    margin: 12px;
    overflow: hidden;
}

.list-item {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.list-left {
    flex: 1;
}

.list-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.list-subtitle {
    font-size: 13px;
    color: var(--gray-400);
}

.list-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 状态标签 ===== */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: #d1fae5;
    color: #065f46;
}

.tag-warning {
    background: #fef3c7;
    color: #92400e;
}

.tag-danger {
    background: #fee2e2;
    color: #991b1b;
}

.tag-info {
    background: #dbeafe;
    color: #1e40af;
}

.tag-gray {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* ===== 步骤条 ===== */
.steps {
    display: flex;
    justify-content: space-between;
    padding: 20px 16px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 32px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--gray-200);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-300);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.step.active .step-dot {
    background: var(--primary);
}

.step.completed .step-dot {
    background: var(--success);
}

.step-label {
    font-size: 12px;
    color: var(--gray-400);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 500;
}

/* ===== 二维码容器 ===== */
.qrcode-container {
    text-align: center;
    padding: 24px;
}

.qrcode-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.qrcode-image img {
    max-width: 100%;
    max-height: 100%;
}

.qrcode-tip {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-text {
    font-size: 15px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

/* ===== 提示信息 ===== */
.tip-box {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

/* ===== 加载中 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

/* ===== 图片上传 ===== */
.upload-box {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-box:active {
    border-color: var(--primary);
}

.upload-icon {
    font-size: 32px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.upload-text {
    font-size: 13px;
    color: var(--gray-400);
}

/* ===== 金额输入 ===== */
.amount-input {
    font-size: 32px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-bottom: 2px solid var(--gray-300);
    padding: 8px;
    width: 100%;
    outline: none;
}

.amount-input:focus {
    border-color: var(--primary);
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 40%, white 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

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

.login-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.login-logo-sub {
    font-size: 14px;
    color: var(--gray-400);
    margin-top: 4px;
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.login-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    color: var(--gray-400);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    #app {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        min-height: 100vh;
        background: var(--gray-100);
    }

    .bottom-nav {
        max-width: 430px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .loading-overlay {
        max-width: 430px;
        margin: 0 auto;
        left: 0;
        right: 0;
    }
}
