/* css/style.css */

/* --- 1. Design Tokens (Apple Style System) --- */
:root {
    /* Brand Colors */
    --c-primary: #FF3B30;
    /* iOS System Red */
    --c-primary-bg: #FFF2F2;
    --c-primary-active: #D63329;
    --c-gold: #D4AF37;
    --c-green: #34C759;
    --c-green-bg: #E8F8ED;
    --c-blue: #007AFF;
    --c-purple: #AF52DE;

    /* Backgrounds */
    --c-bg-body: #F2F2F7;
    /* iOS Grouped Background */
    --c-bg-card: #FFFFFF;
    --c-bg-glass: rgba(255, 255, 255, 0.85);

    /* Text */
    --c-text-primary: #000000;
    --c-text-secondary: #515151;
    --c-text-tertiary: #7a7a7a;
    --c-separator: rgba(60, 60, 67, 0.12);
    /* Separator */

    /* Dimensions */
    --radius-l: 20px;
    --radius-m: 12px;
    --safe-bottom: env(safe-area-inset-bottom, 20px);

    /* Effects */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.12);
    --blur-val: blur(20px);

    /* VIP 专属：珍珠白+幻彩 */
    --bg-vip: linear-gradient(135deg, #FDFBFB 0%, #EBEDEE 100%);
    --bg-vip-card: linear-gradient(120deg, #ffd754 0%, #d4af37 100%);

    /* 算力专属：科技紫蓝 */
    --bg-credit-header: linear-gradient(135deg, #007aff 0%, #007aff 100%);

    /* 通用高级白底 */
    --bg-page-gray: #F2F2F7;
}

/* --- Theme & Dark Mode --- */
body[data-theme="blue"] {
    --c-primary: #007AFF;
    --c-primary-bg: #F0F8FF;
}

body[data-theme="purple"] {
    --c-primary: #AF52DE;
    --c-primary-bg: #FBF5FF;
}

body[data-theme="green"] {
    --c-primary: #34C759;
    --c-primary-bg: #F2FDF4;
}

body[data-theme="orange"] {
    --c-primary: #FF9500;
    --c-primary-bg: #FFF8ED;
}

body[data-theme="ink"] {
    --c-primary: #1C1C1E;
    --c-primary-bg: #EFEFEF;
}

body.dark-mode {
    --bg-vip: #000;
    --bg-vip-card: linear-gradient(120deg, #ffd754 0%, #d4af37 100%);
    --bg-credit-header: linear-gradient(135deg, #007aff 0%, #007aff 100%);

    /* 基础背景升级：不是纯黑，而是带有微弱灰度的黑，减少视觉疲劳 */
    --c-bg-body: #070707;
    --c-bg-card: #161618;
    /* iOS 标准暗黑卡片色 */
    --c-bg-glass: rgba(30, 30, 30, 0.85);

    /* 文本增强：提高对比度 */
    --c-text-primary: #C7C7D1;
    --c-text-secondary: #98989D;
    /* 提亮二级文字 */
    --c-text-tertiary: #5E5E62;

    /* 分割线与边框：增加可见度 */
    --c-separator: rgba(255, 255, 255, 0.15);

    /* 阴影调整：暗黑模式下阴影不明显，改用发光感 */
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* --- Dark Mode Theme Colors (高亮优化) --- */
/* 在暗黑模式下，我们需要更明亮、甚至带一点荧光感的颜色 */

body.dark-mode[data-theme="red"] {
    --c-primary: #FF453A;
    /* iOS Dark Red (更亮) */
    --c-primary-bg: rgba(255, 69, 58, 0.15);
}

body.dark-mode[data-theme="blue"] {
    --c-primary: #0A84FF;
    /* iOS Dark Blue (更亮) */
    --c-primary-bg: rgba(10, 132, 255, 0.15);
}

body.dark-mode[data-theme="purple"] {
    --c-primary: #BF5AF2;
    /* iOS Dark Purple */
    --c-primary-bg: rgba(191, 90, 242, 0.15);
}

body.dark-mode[data-theme="green"] {
    --c-primary: #30D158;
    /* iOS Dark Green */
    --c-primary-bg: rgba(48, 209, 88, 0.15);
    --c-green: #30D158;
    /* 覆盖通用绿色变量 */
}

body.dark-mode[data-theme="orange"] {
    --c-primary: #FF9F0A;
    /* iOS Dark Orange */
    --c-primary-bg: rgba(255, 159, 10, 0.15);
}

body.dark-mode[data-theme="ink"] {
    --c-primary: #FFFFFF;
    /* 水墨灰在暗黑下直接变白 */
    --c-primary-bg: rgba(255, 255, 255, 0.2);
}

/* 1. 列表项在暗黑模式下的点击态 */
body.dark-mode .list-item:active {
    background-color: #2C2C2E;
}

/* 2. 凸起按钮增加荧光辉光，防止融入背景 */
body.dark-mode .nav-bump-btn,
body.dark-mode .nav-bump-btn-lg {
    box-shadow: 0 0 15px rgba(var(--c-primary), 0.5), 0 0 0 6px var(--c-bg-glass);
    border: 1px solid var(--c-primary);
}

/* 3. 亲友详情页 Hero 背景优化 */
body.dark-mode .hero-blob {
    opacity: 0.4;
    /* 降低不透明度，防止光斑过曝 */
    background: radial-gradient(circle, var(--c-primary) 0%, transparent 60%);
}

/* 4. 金额文字在暗黑下更亮 */
body.dark-mode .money {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 5. 搜索框在暗黑下的质感 */
body.dark-mode .search-box {
    background: rgba(255, 255, 255, 0.1);
    /* 更亮的半透明灰 */
    color: white;
}

body.dark-mode .search-box input {
    color: white;
}

body.dark-mode .search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 6. A-Z 索引条可见性 */
body.dark-mode .alphabet-sidebar {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 7. 表单输入框可见性 */
body.dark-mode .form-input,
body.dark-mode .form-select {
    background: #2C2C2E;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 2. Base Reset --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    background-color: var(--c-bg-body);
    color: var(--c-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 65px;
    /* Space for Bottom Nav */
}

a,
button,
input,
select {
    all: unset;
    box-sizing: border-box;
}

a,
button {
    cursor: pointer;
}

/* Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.caption {
    font-size: 13px;
    color: var(--c-text-secondary);
}

.text-primary {
    color: var(--c-primary) !important;
}

/* --- 3. Components --- */

/* Headers */
.header-lg {
    padding: 10px 20px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-bg-body);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-lg h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-sm {
    padding: 10px 20px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-bg-glass);
    backdrop-filter: var(--blur-val);
    -webkit-backdrop-filter: var(--blur-val);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 0.5px solid var(--c-separator);
}

/* Cards */
.card {
    background: var(--c-bg-card);
    border-radius: var(--radius-l);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.card:active {
    transform: scale(0.98);
}

.bg-primary-grad {
    background: linear-gradient(135deg, var(--c-primary-bg) 0%, var(--c-bg-card) 100%);
}

/* Quick Actions Grid (4 Icons) */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 5px;
}

.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qa-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--c-bg-card);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-primary);
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.qa-item:active .qa-icon {
    transform: scale(0.95);
}

.qa-label {
    font-size: 14px;
    color: var(--c-text-primary);
}

/* iOS List Group */
.list-group {
    background: var(--c-bg-card);
    border-radius: var(--radius-l);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--c-bg-card);
    position: relative;
    transition: background 0.2s;
}

.list-item:active {
    background: var(--c-bg-body);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}

/* --- 4. Special Components --- */

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--c-bg-glass);
    backdrop-filter: var(--blur-val);
    -webkit-backdrop-filter: var(--blur-val);
    border-top: 0.5px solid var(--c-separator);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: var(--safe-bottom);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--c-text-secondary);
    font-size: 10px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--c-primary);
}

/* Bump Button & Pulse */
.nav-bump {
    position: relative;
    display: flex;
    justify-content: center;
}

.nav-bump-btn {
    position: absolute;
    top: -28px;
    width: 60px;
    height: 60px;
    background: var(--c-primary);
    border-radius: 50%;
    color: var(--c-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 6px var(--c-bg-glass);
}

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 var(--c-primary), 0 0 0 6px var(--c-bg-glass);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(255, 59, 48, 0), 0 0 0 6px var(--c-bg-glass);
    }
}

.pulse {
    animation: ripple 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* A-Z Sidebar */
.alpha-sidebar {
    position: fixed;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    padding: 6px 4px;
    background: rgba(200, 200, 200, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

.alpha-char {
    font-size: 10px;
    color: var(--c-primary);
    font-weight: 600;
    padding: 2px 4px;
    cursor: pointer;
}

/* Sticky Group Header */
.group-header {
    position: sticky;
    top: 50px;
    z-index: 10;
    background: var(--c-bg-body);
    backdrop-filter: blur(10px);
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-secondary);
}

/* Sort Toolbar */
.sort-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(118, 118, 128, 0.12);
    border-radius: 10px;
}

.sort-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-primary);
    transition: all 0.2s;
    gap: 4px;
}

.sort-btn.active {
    background: var(--c-bg-card);
    color: var(--c-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sort-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.sort-btn.desc .sort-icon {
    transform: rotate(180deg);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    margin-top: 10px;
}

.del-btn {
    color: #FF3B30;
    opacity: 0.8;
    display: flex;
    margin-left: 4px;
    align-items: center;
}

.btn-primary {
    background: var(--c-primary);
    color: var(--c-bg-card);
}

/* Book Style Card (Home) */
.book-card {
    background: var(--c-bg-card);
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-card);
}

.book-spine {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-bg-card);
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(180deg, #FF5E57, #FF3B30);
}

.book-content {
    flex: 1;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 确保 Switch 开关样式正确 */
.switch {
    position: relative;
    width: 50px;
    height: 30px;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background-color: #E5E5EA;
    border-radius: 34px;
    transition: .4s;
}

.switch input:checked+.slider {
    background-color: var(--c-primary);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: var(--c-bg-card);
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked+.slider:before {
    transform: translateX(20px);
}

/* 暗黑模式适配 Switch 背景 */
body.dark-mode .slider {
    background-color: #39393D;
}

/* --- iOS Form Style --- */
.form-container {
    padding: 12px 16px;
}

.form-group-title {
    font-size: 13px;
    color: var(--c-text-secondary);
    text-transform: uppercase;
}

.form-list {
    background: var(--c-bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.form-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    min-height: 50px;
    background: var(--c-bg-card);
    position: relative;
}

.form-cell:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 16px;
    height: 1px;
    background: var(--c-separator);
}

.form-label {
    font-size: 16px;
    color: var(--c-text-primary);
    width: 90px;
    flex-shrink: 0;
}

.form-input {
    flex: 1;
    text-align: right;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--c-text-secondary);
    font-family: inherit;
}

.form-input:focus {
    color: var(--c-text-primary);
}

.form-input::placeholder {
    color: var(--c-text-tertiary);
}

/* iOS 日期选择器优化 */
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"] {
    min-height: 44px;
    line-height: 1.4;
    padding: 10px 24px;
    cursor: pointer;
}

/* iOS 日期选择器图标位置修复 */
.form-input[type="date"]::-webkit-date-and-time-value {
    text-align: right;
}

/* iOS 下拉选择优化 */
.form-input[type="date"]::-webkit-calendar-picker-indicator {
    position: relative;
    right: -4px;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    cursor: pointer;
}

/* select 下拉框优化 */
select.form-input {
    min-height: 44px;
    line-height: 1.4;
    padding: 10px 24px 10px 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px;
    padding-right: 20px;
}

/* iOS 下拉选择器箭头 */
select.form-input::-ms-expand {
    display: none;
}

/* 日期和选择框聚焦状态 */
.form-input[type="date"]:focus,
.form-input[type="time"]:focus,
select.form-input:focus {
    outline: none;
    color: var(--c-text-primary);
}

/* iOS 暗黑模式适配 */
body.dark-mode .form-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
}

body.dark-mode select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398989D' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* iOS 输入框触摸反馈 */
@supports (-webkit-touch-callout: none) {

    .form-input[type="date"],
    .form-input[type="time"],
    select.form-input {
        -webkit-tap-highlight-color: transparent;
        font-size: 16px;
        /* 防止 iOS 自动缩放 */
    }

    .form-cell {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 表单清除按钮 */
.form-cell-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.form-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c-text-tertiary);
    color: var(--c-bg-card);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    transition: opacity 0.2s;
}

.form-clear-btn:hover {
    opacity: 0.8;
}

.form-clear-btn svg {
    width: 12px;
    height: 12px;
}

/* 日期选择器 iOS 优化 */
.form-input[type="date"] {
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    position: relative;
}

.form-input[type="date"]::-webkit-date-and-time-value {
    text-align: right;
}

.form-input[type="date"]::-webkit-calendar-picker-indicator {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* 下拉选择 iOS 优化 */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 24px;
    text-align: right;
    text-align-last: right;
    direction: rtl;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px;
}

/* 下拉选项左对齐显示 */
select.form-input option {
    direction: ltr;
    text-align: left;
}

/* 文本输入框有值时显示清除按钮 (不适用于日期和下拉选择) */
.form-cell:has(.form-input:not([type="date"]):not([type="select"]):not(:placeholder-shown)) .form-clear-btn {
    display: flex;
}

/* 兼容不支持 :has 的浏览器 */
.form-input:not([type="date"]):not([type="select"]):not(:placeholder-shown)+.form-clear-btn {
    display: flex;
}

/* Switch Toggle (iOS style) */
.form-switch {
    width: 50px;
    height: 30px;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background: #E9E9EA;
    border-radius: 15px;
    transition: background 0.3s;
    cursor: pointer;
}

.form-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.form-switch:checked {
    background: var(--c-green);
}

.form-switch:checked::after {
    transform: translateX(20px);
}

/* --- Quick Amount Grid --- */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 16px 16px 16px;
}

.amt-chip {
    background: var(--c-bg-body);
    color: var(--c-text-primary);
    padding: 8px 0;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.amt-chip:active {
    transform: scale(0.95);
}

.amt-chip.selected {
    background: var(--c-primary-bg);
    color: var(--c-primary);
    border-color: var(--c-primary);
}

/* --- Friend Selector Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-sheet {
    margin-top: auto;
    width: 100%;
    height: 80vh;
    background: var(--c-bg-body);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.open .modal-sheet {
    transform: translateY(0);
}

/* 亲友选择器弹窗 */
.friend-selector-header {
    background: var(--c-bg-card);
    border-radius: 16px 16px 0 0;
    padding: 20px;
}

.friend-selector-title {
    font-size: 18px;
    font-weight: 800;
}

.friend-selector-search {
    display: flex;
    align-items: center;
    background: rgba(120, 120, 128, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 16px;
}

.friend-selector-search input {
    flex: 1;
    margin-left: 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--c-text-primary);
}

.friend-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.friend-selector-list .vscroll-wrapper {
    position: relative;
    padding: 16px 0;
}

.friend-selector-item {
    background: var(--c-bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    height: 64px;
    box-sizing: border-box;
}

.friend-selector-item.selected {
    border-color: var(--c-primary);
}

.friend-selector-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--c-primary-bg);
    color: var(--c-primary);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.friend-selector-info {
    flex: 1;
    min-width: 0;
}

.friend-selector-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-selector-meta {
    font-size: 12px;
    color: var(--c-text-secondary);
}

.friend-selector-phone {
    font-size: 15px;
    font-weight: 700;
    margin-left: 10px;
}

.friend-selector-check {
    color: var(--c-primary);
    margin-left: 12px;
    display: flex;
    align-items: center;
}

.friend-selector-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    background: var(--c-bg-body);
}

.friend-selector-footer button {
    width: 100%;
    height: 48px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-float);
    border: none;
    cursor: pointer;
}

/* --- Tags / Radio Group --- */
.radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.radio-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--c-bg-body);
    color: var(--c-text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
}

.radio-tag.active {
    background: var(--c-primary);
    color: white;
}

/* --- 2. 算力页组件 --- */
.credit-header {
    background: var(--bg-credit-header);
    padding: 60px 20px 30px 20px;
    color: white;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.credit-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.credit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.credit-card {
    background: var(--c-bg-card);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, border 0.2s;
    border: 2px solid transparent;
}

.credit-card.active {
    border-color: var(--c-primary);
    background: var(--c-primary-bg);
}

.credit-card:active {
    transform: scale(0.96);
}

/* --- 3. VIP 页组件 (幻彩风格) --- */
.vip-page-bg {
    min-height: 100vh;
    background: var(--bg-vip);
    padding-bottom: 100px;
}

.vip-hero {
    padding: 40px 20px;
    text-align: center;
}

.vip-plan-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 20px;
    scrollbar-width: none;
}

.vip-plan-card {
    min-width: 140px;
    background: var(--c-bg-card);
    border-radius: 18px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.vip-plan-card.premium {
    background: var(--bg-vip-card);
    color: white;
    box-shadow: 0 10px 25px rgba(161, 196, 253, 0.6);
    border: none;
    transform: scale(1.05);
}

.vip-plan-card.premium .price {
    color: white;
}

.vip-plan-card.premium .lbl {
    color: rgba(255, 255, 255, 0.8);
}

/* --- 4. 个人信息 & 设置 --- */
.profile-cell-lg {
    display: flex;
    align-items: center;
    background: var(--c-bg-card);
    padding: 16px 20px;
    margin: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

.setting-group {
    background: var(--c-bg-card);
    margin: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 0.5px solid var(--c-separator);
    transition: background 0.2s;
    cursor: pointer;
}

.setting-item:active {
    background: var(--c-bg-body);
}

.setting-item:last-child {
    border-bottom: none;
}

/* 消费记录列表 */
.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--c-separator);
    background: var(--c-bg-card);
}

.bill-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--c-bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--c-text-primary);
}