:root {
    --primary: #C8A97E;
    --primary-light: #D9BC8F;
    --primary-dark: #B2946B;
    --gold: #C8A97E;
    --gold-light: #D9BC8F;
    --gold-dark: #B2946B;
    --bg: #F8F7F2;
    --bg-secondary: #F0EDE6;
    --card: #FFFFFF;
    --card-hover: #FDFCFA;
    --text: #4A4A4A;
    --text-secondary: #797D80;
    --text-light: var(--text-secondary);
    --text-tertiary: #B8BCBF;
    --border: #E0DDD6;
    --border-light: #E8E5DE;
    --success: #6B8C7C;
    --warning: #B98C66;
    --danger: #A65C4F;
    --info: #8A7254;
    --shadow: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 999px;
    --btn-text: #FFFFFF;
    --nav-bg: rgba(248,247,242,0.92);
    --nav-text: #2C2C2C;
    --level-banner-from: #2C2C2C;
    --level-banner-to: #3D4043;
    --banner-text: #D9BC8F;
    --banner-text-sub: rgba(200,169,126,0.6);
    --banner-dot-color: rgba(200,169,126,0.12);
    --banner-dot-color2: rgba(200,169,126,0.06);
    --banner-border: rgba(200,169,126,0.15);
    --banner-stat-bg: rgba(255,255,255,0.06);
    --icon-bg-gold: rgba(200,169,126,0.1);
    --icon-bg-green: rgba(107,140,124,0.08);
    --icon-bg-ink: rgba(121,125,128,0.1);
    --icon-bg-info: rgba(138,114,84,0.08);
    --icon-bg-danger: rgba(166,92,79,0.08);
    --title-color: #2C2C2C;
    --product-img-from: #F0EDE6;
    --product-img-to: #E8E5DE;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, textarea { font-family: inherit; font-size: inherit; }

.container { max-width: 750px; margin: 0 auto; padding: 0 16px; }

.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top-nav .title {
    font-size: 17px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--nav-text);
    letter-spacing: 2px;
}
.top-nav .back { font-size: 24px; color: var(--text); cursor: pointer; }
.top-nav .action { font-size: 14px; color: var(--gold); cursor: pointer; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0 4px;
    font-size: 10px;
    color: var(--text-tertiary);
    transition: color 0.2s;
}
.bottom-nav a.active { color: var(--gold); }
.bottom-nav a svg { width: 24px; height: 24px; margin-bottom: 2px; fill: currentColor; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.card-body { padding: 16px; }
.card-header {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--title-color);
}
.card-header .more { font-size: 12px; color: var(--text-secondary); font-weight: 400; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 0 28px;
    height: 44px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    letter-spacing: 1px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary-dark); color: var(--btn-text); }
.btn-primary:hover { background: var(--primary); }
.btn-outline { background: transparent; border: 1px solid var(--text-secondary); color: var(--text); }
.btn-outline:hover { background: var(--icon-bg-ink); }
.btn-gold { background: var(--gold); color: var(--btn-text); }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 32px; padding: 0 16px; font-size: 13px; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    outline: none;
    transition: border-color 0.3s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: var(--text-tertiary); }

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-success { background: var(--icon-bg-green); color: var(--success); border: 1px solid var(--success); }
.toast-danger { background: var(--icon-bg-danger); color: var(--danger); border: 1px solid var(--danger); }
.toast-warning { background: var(--icon-bg-info); color: var(--warning); border: 1px solid var(--warning); }

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}
.tag-primary { background: var(--icon-bg-gold); color: var(--gold-dark); }
.tag-gold { background: var(--icon-bg-gold); color: var(--gold-dark); }
.tag-success { background: var(--icon-bg-green); color: var(--success); }
.tag-warning { background: var(--icon-bg-info); color: var(--warning); }
.tag-danger { background: var(--icon-bg-danger); color: var(--danger); }

.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.list-item .info { flex: 1; min-width: 0; }
.list-item .info h4 { font-size: 15px; font-weight: 500; color: var(--text); }
.list-item .info p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.list-item .arrow { color: var(--text-tertiary); font-size: 14px; }

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }

.level-banner {
    background: linear-gradient(135deg, var(--level-banner-from) 0%, var(--level-banner-to) 50%, var(--text) 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: var(--banner-text);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--banner-border);
}
.level-banner::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--banner-dot-color) 0%, transparent 70%);
    border-radius: 50%;
}
.level-banner .level-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.level-banner .level-desc { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.stat-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.stat-box .val { font-size: 22px; font-weight: 700; color: var(--title-color); }
.stat-box .val.primary { color: var(--gold); }
.stat-box .val.gold { color: var(--gold); }
.stat-box .val.success { color: var(--success); }
.stat-box .label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    border: 1px solid var(--border);
}
.product-card:active { transform: scale(0.98); }
.product-card .img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--product-img-from) 0%, var(--product-img-to) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 40px;
}
.product-card .info { padding: 10px 12px; }
.product-card .info h4 { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .info .price { color: var(--gold); font-size: 16px; font-weight: 700; margin-top: 6px; }
.product-card .info .price small { font-size: 12px; font-weight: 400; }
.product-card .info .points { color: var(--gold-dark); font-size: 12px; margin-top: 2px; }

.product-featured {
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
    border: 1px solid var(--border);
}
.product-featured:active { transform: scale(0.98); }
.product-featured .feat-img {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, var(--product-img-from) 0%, var(--product-img-to) 50%, var(--product-img-from) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
}
.product-featured .feat-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--card));
}
.product-featured .feat-body {
    padding: 24px;
}
.product-featured .feat-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--title-color);
    line-height: 1.4;
    letter-spacing: 1px;
}
.product-featured .feat-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-featured .feat-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}
.product-featured .feat-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--gold);
}
.product-featured .feat-price small {
    font-size: 14px;
    font-weight: 500;
}
.product-featured .feat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 24px;
    border-radius: 6px;
    background: var(--primary-dark);
    color: var(--btn-text);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 1px;
    transition: background 0.3s;
}
.product-featured .feat-btn:hover { background: var(--primary); }
.product-featured .feat-tags {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.product-featured .feat-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}
.product-featured .feat-tag.hot {
    background: var(--icon-bg-danger);
    color: var(--danger);
}
.product-featured .feat-tag.points {
    background: var(--icon-bg-gold);
    color: var(--gold-dark);
}
.product-featured .feat-tag.stock {
    background: var(--icon-bg-gold);
    color: var(--gold-dark);
}

.empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-tertiary);
}
.empty svg { width: 64px; height: 64px; fill: var(--text-tertiary); margin-bottom: 12px; }
.empty p { font-size: 14px; }

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-tertiary);
}
.empty-state div { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.text-primary { color: var(--gold) !important; }
.text-gold { color: var(--gold) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-decoration: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: 50%; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.3s ease-out; }

.gold-text {
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0,0,0,0.08);
    letter-spacing: 2px;
}

.ink-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 16px 0;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 40px;
    gap: 8px;
    border: 1px solid var(--border);
}
.search-bar input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; color: var(--text); }
.search-bar input::placeholder { color: var(--text-tertiary); }
.search-bar svg { width: 18px; height: 18px; fill: var(--text-tertiary); flex-shrink: 0; }

.week-row { display: flex; gap: 6px; }
.week-row .day {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 12px;
}
.week-row .day.checked { background: var(--icon-bg-green); color: var(--success); }
.week-row .day.today { background: var(--icon-bg-gold); color: var(--gold); font-weight: 600; }
.week-row .day .num { font-size: 16px; font-weight: 600; display: block; }

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}
.tabs a {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.2s;
}
.tabs a.active { color: var(--gold); font-weight: 600; }
.tabs a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

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

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--banner-dot-color2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-page::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--icon-bg-green) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-header {
    padding: 60px 32px 0;
    position: relative;
    z-index: 1;
}
.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px var(--banner-dot-color);
}
.auth-logo svg { width: 36px; height: 36px; fill: var(--btn-text); }
.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--title-color);
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-family: "Source Han Serif CN", "SimSun", serif;
}
.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 1px;
}
.auth-body {
    flex: 1;
    padding: 36px 32px 40px;
    position: relative;
    z-index: 1;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.auth-field {
    position: relative;
    margin-bottom: 16px;
}
.auth-field .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-tertiary);
    transition: fill 0.2s;
    pointer-events: none;
    z-index: 2;
}
.auth-field input {
    width: 100%;
    height: 54px;
    padding: 0 16px 0 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}
.auth-field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--icon-bg-gold);
}
.auth-field input:focus + .field-icon,
.auth-field input:focus ~ .field-icon {
    fill: var(--gold);
}
.auth-field input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}
.auth-field .toggle-pwd {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-tertiary);
    cursor: pointer;
    z-index: 2;
    padding: 4px;
    transition: fill 0.2s;
}
.auth-field .toggle-pwd:hover { fill: var(--text-secondary); }
.auth-btn {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    background: var(--gold);
    color: var(--btn-text);
    letter-spacing: 2px;
    box-shadow: 0 4px 12px var(--banner-dot-color);
    transition: all 0.3s ease;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}
.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}
.auth-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px var(--banner-dot-color);
}
.auth-btn:active::before { left: 100%; }
.auth-btn:hover { background: var(--gold-light); }
.auth-footer {
    text-align: center;
    padding: 0 32px 40px;
    position: relative;
    z-index: 1;
}
.auth-footer .link {
    color: var(--gold);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}
.auth-footer .link:hover { opacity: 0.8; }
.auth-footer .link span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-tertiary);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-toast {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}
.auth-toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.auth-toast-danger { background: var(--icon-bg-danger); color: var(--danger); border: 1px solid var(--danger); }
.auth-toast-danger svg { fill: var(--danger); }
.auth-toast-success { background: var(--icon-bg-green); color: var(--success); border: 1px solid var(--success); }
.auth-toast-success svg { fill: var(--success); }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}
.auth-features .feat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.auth-features .feat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.auth-features .feat-icon.orange { background: var(--icon-bg-info); }
.auth-features .feat-icon.gold { background: var(--icon-bg-gold); }
.auth-features .feat-icon.green { background: var(--icon-bg-green); }
.auth-features .feat span {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    outline: none;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    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='%23797D80'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
select:focus { border-color: var(--gold); }

textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--card);
    outline: none;
    resize: vertical;
    transition: border-color 0.3s;
}
textarea:focus { border-color: var(--gold); }
textarea::placeholder { color: var(--text-tertiary); }
