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

:root {
    --primary: #ff4757;
    --primary-light: #ff6b7a;
    --primary-dark: #e84118;
    --secondary: #ff8c00;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --text: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border: #e9ecef;
    --border-light: #f1f3f5;
    --bg: #f8f9fa;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 22px;
    --font-size-3xl: 28px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 28px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--font-size-base);
}

.page-container {
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg-white);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header .back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.page-header .back-btn:hover {
    background: var(--border);
}

.page-header .page-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.page-header .header-right {
    width: 32px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--spacing-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
}

.card-body {
    padding: var(--spacing-xl);
}

.card-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    transform: translateY(-1px);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    border-radius: 4px;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text);
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    color: var(--text);
    background: var(--bg-white);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

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

.form-control:hover {
    border-color: #ced4da;
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .input-group-btn {
    padding: 0 16px;
    border: 1px solid var(--primary);
    border-left: none;
    background: var(--primary);
    color: #fff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: all 0.2s;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.8;
}

.badge-primary {
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #e67700;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.badge-secondary {
    background: var(--border-light);
    color: var(--text-secondary);
}

.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--spacing-lg) 0;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

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

.price {
    color: var(--primary);
    font-weight: 700;
}

.price::before {
    content: '¥';
    font-size: 0.7em;
    margin-right: 1px;
}

.price-original {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.85em;
}

.tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 2px;
}

.tab {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.list-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

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

.list-item:hover {
    background: #fafbfc;
}

.list-item .item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
}

.list-item .item-content {
    flex: 1;
    min-width: 0;
}

.list-item .item-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.list-item .item-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.list-item .item-arrow {
    color: var(--text-muted);
    font-size: 14px;
    margin-left: var(--spacing-sm);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state .empty-text {
    font-size: var(--font-size-base);
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.bottom-bar .bar-left {
    flex: 1;
}

.bottom-bar .bar-right {
    display: flex;
    gap: var(--spacing-sm);
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--border-light);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: var(--font-size-xs);
    line-height: 1.6;
}

.tag-primary {
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
}

.tag-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .page-container {
        max-width: 100%;
    }

    .card {
        margin: var(--spacing-md);
    }

    .card-body {
        padding: var(--spacing-lg);
    }

    .card-header {
        padding: var(--spacing-lg);
    }

    .bottom-bar {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* 移动端表单间距收紧 */
    .form-group {
        margin-bottom: var(--spacing-md);
    }

    .form-control {
        padding: 11px 14px;
        font-size: 16px; /* >=16px 防止 iOS Safari 自动缩放 */
    }

    /* 移动端触摸目标增大 */
    .btn-sm {
        padding: 8px 16px;
        min-height: 36px;
    }

    .btn {
        min-height: 42px;
    }

    /* 页面头部的安全间距 */
    .page-header {
        padding-top: calc(var(--spacing-lg) + env(safe-area-inset-top, 0px));
    }

    /* 底部固定栏适配安全区域 */
    .bottom-bar {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .page-container {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* 小屏幕手机进一步优化 */
@media (max-width: 380px) {
    :root {
        --font-size-2xl: 20px;
        --font-size-3xl: 24px;
        --spacing-lg: 14px;
        --spacing-xl: 18px;
    }

    .card {
        margin: var(--spacing-sm);
    }

    .card-body,
    .card-header {
        padding: var(--spacing-md);
    }

    .form-control {
        padding: 10px 12px;
    }
}

/* 横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .page-container {
        min-height: 100dvh;
    }

    .page-header {
        position: sticky;
        top: 0;
    }
}

/* 支持 dvh 单位（解决 iOS Safari 100vh 底部工具栏遮挡问题） */
@supports (height: 100dvh) {
    .page-container {
        min-height: 100dvh;
    }
}

/* 客服浮动按钮（全局公共组件） */
.cs-float {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s;
}

.cs-float:active {
    transform: scale(0.95);
}
