/* ============================
   宿舍小卖部 · 样式表
   设计风格：温暖橙 + 薄荷绿
============================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #ff6b35;
    --primary-light: #ff8a5d;
    --primary-dark: #e85a25;
    --secondary: #2ec4b6;
    --secondary-light: #5cd6a7;
    --bg: #faf7f2;
    --card: #ffffff;
    --text: #2d2d2d;
    --text-light: #888;
    --text-lighter: #b8b8b8;
    --border: #f0ebe2;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --shadow-sm: 0 2px 8px rgba(255, 107, 53, 0.06);
    --shadow-md: 0 4px 16px rgba(255, 107, 53, 0.12);
    --shadow-lg: 0 8px 24px rgba(255, 107, 53, 0.18);
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 14px;
    outline: none;
    border: none;
    background: transparent;
    color: var(--text);
}

input::placeholder, textarea::placeholder {
    color: var(--text-lighter);
}

/* ============================
   应用容器
============================ */
#app {
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

/* ============================
   顶部 Header
============================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    padding-top: env(safe-area-inset-top, 0);
    box-shadow: var(--shadow-md);
}

.header-inner {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    background: white;
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-text p {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

/* ============================
   主内容区
============================ */
.app-main {
    flex: 1;
    padding-bottom: 70px;
    overflow-y: auto;
}

.page {
    display: none;
    padding: 14px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   横幅
============================ */
.banner {
    background: linear-gradient(135deg, #ffd6c2 0%, #ffe9d9 100%);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-text h2 {
    font-size: 20px;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.banner-text p {
    font-size: 12px;
    color: #8a4a2c;
    margin-bottom: 10px;
}

.banner-btn {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.35);
}

.banner-emoji {
    font-size: 56px;
    line-height: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ============================
   搜索栏
============================ */
.search-bar {
    background: white;
    border-radius: 22px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    color: var(--text-light);
}

.search-bar input {
    flex: 1;
    font-size: 14px;
}

/* ============================
   分类导航
============================ */
.category-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    background: white;
    border-radius: 18px;
    font-size: 13px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-chip.active {
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4);
    transform: translateY(-1px);
}

/* ============================
   商品区域
============================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.section-meta {
    font-size: 12px;
    color: var(--text-light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-md);
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #fff5ec 0%, #ffe2cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    position: relative;
}

.product-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.product-tag.hot {
    background: var(--danger);
}

.product-info {
    padding: 8px 10px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

.product-price small {
    font-size: 11px;
    font-weight: 400;
}

.product-old {
    text-decoration: line-through;
    color: var(--text-lighter);
    font-size: 11px;
    margin-left: 4px;
}

.add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    font-size: 18px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.35);
    transition: all 0.2s;
}

.add-btn:active {
    transform: scale(0.85);
}

.add-btn.disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.product-sales {
    font-size: 10px;
    color: var(--text-lighter);
    margin-top: 4px;
}

/* ============================
   空状态
============================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ============================
   按钮
============================ */
.primary-btn {
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    padding: 11px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
    transition: all 0.2s;
}

.primary-btn:active {
    transform: scale(0.96);
}

.primary-btn.full {
    width: 100%;
}

.primary-btn:disabled {
    background: #ccc;
    box-shadow: none;
}

.text-btn {
    color: var(--text-light);
    font-size: 13px;
    padding: 4px 8px;
}

.text-btn:active {
    color: var(--primary);
}

/* ============================
   购物车页面
============================ */
.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 14px;
}

.page-title h2 {
    font-size: 20px;
    font-weight: 700;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    background: white;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    align-items: center;
}

.cart-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff5ec 0%, #ffe2cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.cart-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg);
    border-radius: 16px;
    overflow: hidden;
}

.qty-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    transition: all 0.15s;
}

.qty-btn:active {
    background: var(--border);
}

.qty-btn.minus {
    color: var(--danger);
}

.qty-btn.plus {
    color: var(--primary);
}

.qty-num {
    min-width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.cart-delete {
    color: var(--text-lighter);
    font-size: 18px;
    padding: 4px;
    transition: all 0.2s;
}

.cart-delete:active {
    color: var(--danger);
}

.cart-footer {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    z-index: 90;
}

.cart-total {
    display: flex;
    flex-direction: column;
}

.cart-total span {
    font-size: 11px;
    color: var(--text-light);
}

.cart-total strong {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

/* ============================
   订单页面
============================ */
.order-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.order-tab {
    flex: 1;
    padding: 7px 0;
    font-size: 13px;
    border-radius: 8px;
    color: var(--text-light);
    transition: all 0.2s;
}

.order-tab.active {
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    font-weight: 600;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.order-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.order-no {
    font-family: monospace;
}

.order-status {
    font-weight: 600;
}

.order-status.pending { color: var(--warning); }
.order-status.delivering { color: var(--primary); }
.order-status.completed { color: var(--success); }
.order-status.cancelled { color: var(--text-lighter); }

.order-body {
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.order-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.order-item-more {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-light);
}

.order-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.order-total {
    font-weight: 700;
    color: var(--text);
}

.order-actions {
    display: flex;
    gap: 6px;
}

.order-action-btn {
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    color: var(--text-light);
    background: white;
    transition: all 0.2s;
}

.order-action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.order-action-btn:active {
    transform: scale(0.95);
}

/* ============================
   我的页面
============================ */
.profile-header {
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    margin: -14px -14px 14px -14px;
    padding: 26px 18px 28px;
    color: white;
    display: flex;
    gap: 14px;
    align-items: center;
    border-radius: 0 0 24px 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.profile-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 12px;
    opacity: 0.9;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: white;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-item strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-item span {
    font-size: 11px;
    color: var(--text-light);
}

.menu-list {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: var(--bg);
}

.menu-icon {
    font-size: 20px;
    width: 26px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-size: 14px;
}

.menu-arrow {
    color: var(--text-lighter);
    font-size: 20px;
    line-height: 1;
}

/* ============================
   底部 Tab 栏
============================ */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0));
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--text-light);
    position: relative;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--primary);
}

.tab-icon {
    font-size: 22px;
    line-height: 1;
}

.tab-label {
    font-size: 10px;
}

.tab-badge {
    position: absolute;
    top: 0;
    right: calc(50% - 20px);
    background: var(--danger);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ============================
   模态框
============================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    padding: 24px 18px 18px;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-large .modal-content {
    max-height: 92vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-light);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

/* ============================
   商品详情
============================ */
.product-detail {
    text-align: center;
}

.detail-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 240px;
    background: linear-gradient(135deg, #fff5ec 0%, #ffe2cc 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    margin-bottom: 14px;
}

.detail-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.detail-price {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-old-price {
    color: var(--text-lighter);
    text-decoration: line-through;
    font-size: 13px;
    margin-bottom: 12px;
}

.detail-desc {
    background: var(--bg);
    padding: 12px;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.detail-meta {
    display: flex;
    justify-content: space-around;
    margin-bottom: 14px;
    padding: 12px 0;
    background: var(--bg);
    border-radius: 10px;
}

.detail-meta div {
    text-align: center;
}

.detail-meta strong {
    display: block;
    color: var(--primary);
    font-size: 16px;
}

.detail-meta span {
    font-size: 11px;
    color: var(--text-light);
}

.detail-add-btn {
    width: 100%;
    padding: 12px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.4);
}

/* ============================
   结算弹窗
============================ */
.checkout-content h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 18px;
}

.checkout-section {
    margin-bottom: 14px;
}

.checkout-section label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.checkout-section input[type="text"],
.checkout-section textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    font-size: 14px;
}

.pay-methods {
    display: flex;
    gap: 8px;
}

.pay-method {
    flex: 1;
    padding: 10px;
    background: var(--bg);
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.pay-method input {
    display: none;
}

.pay-method.active {
    background: rgba(255, 107, 53, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.checkout-summary {
    background: var(--bg);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.summary-row.total strong {
    color: var(--primary);
    font-size: 18px;
}

/* ============================
   订单详情
============================ */
.order-detail-content {
    padding: 4px;
}

.order-detail-content h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 18px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section-title {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.detail-items {
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.detail-item-img {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.detail-item-info {
    flex: 1;
    text-align: left;
}

.detail-item-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.detail-item-meta {
    font-size: 11px;
    color: var(--text-light);
}

.detail-item-price {
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
}

/* ============================
   管理后台
============================ */
.admin-content h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.admin-stat {
    background: linear-gradient(135deg, #fff5ec 0%, #ffe2cc 100%);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.admin-stat-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.admin-stat span {
    font-size: 11px;
    color: var(--text-light);
}

.admin-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
}

.admin-tab {
    flex: 1;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-light);
    border-radius: 7px;
    transition: all 0.2s;
}

.admin-tab.active {
    background: white;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-list-row {
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-list-row .icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.admin-list-row .info {
    flex: 1;
    min-width: 0;
}

.admin-list-row .info .name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.admin-list-row .info .meta {
    font-size: 11px;
    color: var(--text-light);
}

.admin-list-row .actions {
    display: flex;
    gap: 4px;
}

.mini-btn {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 12px;
    background: white;
    color: var(--text);
    transition: all 0.2s;
}

.mini-btn:active {
    transform: scale(0.95);
}

.mini-btn.primary {
    background: var(--primary);
    color: white;
}

.mini-btn.danger {
    background: var(--danger);
    color: white;
}

.admin-add-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #5cd6a7 0%, #2ec4b6 100%);
    color: white;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46, 196, 182, 0.35);
}

/* ============================
   表单 (编辑商品)
============================ */
.edit-content h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 18px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    font-size: 14px;
}

.checkbox-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

.form-actions {
    margin-top: 16px;
}

/* 商品图片编辑 */
.product-image-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-image-preview {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image-preview.has-image {
    border-style: solid;
    border-color: var(--primary);
    background: white;
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-image-placeholder {
    color: var(--text-light);
    font-size: 12px;
}

.product-image-actions {
    display: flex;
    gap: 8px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* 商品图片渲染支持（卡片 / 详情 / 列表） */
.product-img.has-image,
.detail-img.has-image,
.admin-list-row .icon.has-image,
.cart-img.has-image,
.order-item-img.has-image,
.detail-item-img.has-image {
    background: white;
    overflow: hidden;
    padding: 0;
}

.product-img.has-image img,
.detail-img.has-image img,
.admin-list-row .icon.has-image img,
.cart-img.has-image img,
.order-item-img.has-image img,
.detail-item-img.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================
   个人资料 · 头像编辑
============================ */
.avatar-edit-section {
    text-align: center;
    padding: 4px 0 16px;
}

.avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(160deg, #ffe9c8 0%, #ffd6a0 100%);
    border: 3px solid #ffb46b;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(255, 180, 107, 0.25);
    transition: transform 0.2s;
}

.avatar-preview:active {
    transform: scale(0.96);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.avatar-action-btn {
    padding: 7px 14px;
    font-size: 13px;
    background: white;
    color: var(--primary);
    border: 1px solid #ffe2cc;
    border-radius: 18px;
    transition: all 0.2s;
}

.avatar-action-btn:active {
    background: #fff5ec;
    transform: scale(0.96);
}

.avatar-hint {
    font-size: 11px;
    color: var(--text-light);
    background: #fdf3d8;
    border-radius: 8px;
    padding: 6px 10px;
    line-height: 1.5;
    margin-top: 8px;
}

/* 个人中心头像支持图片渲染 */
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ============================
   Toast
============================ */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.78);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast.success {
    background: rgba(46, 213, 115, 0.92);
}

.toast.error {
    background: rgba(255, 71, 87, 0.92);
}

/* ============================
   响应式
============================ */
@media (min-width: 481px) {
    body {
        background: #f0ebe2;
    }
}

@media (max-width: 360px) {
    .logo-text h1 { font-size: 15px; }
    .logo-text p { font-size: 10px; }
    .products-grid { gap: 8px; }
    .product-img { font-size: 44px; }
}

/* ============================
   登录页面
============================ */
.login-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 50%, #e85a25 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-decoration {
    position: absolute;
    font-size: 48px;
    opacity: 0.18;
    animation: float 6s ease-in-out infinite;
}

.login-decoration.d1 { top: 8%;  left: 8%;  animation-delay: 0s; }
.login-decoration.d2 { top: 14%; right: 10%; animation-delay: 0.8s; font-size: 60px; }
.login-decoration.d3 { bottom: 16%; left: 6%; animation-delay: 1.6s; }
.login-decoration.d4 { top: 38%; left: 12%; animation-delay: 2.4s; font-size: 44px; }
.login-decoration.d5 { bottom: 10%; right: 12%; animation-delay: 3.2s; }
.login-decoration.d6 { top: 56%; right: 6%; animation-delay: 4s; font-size: 50px; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(8deg); }
}

.login-card {
    position: relative;
    background: white;
    width: calc(100% - 40px);
    max-width: 380px;
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: cardEnter 0.5s ease;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 22px;
    margin-bottom: 10px;
    display: inline-block;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    background: white;
    animation: bounce 2s infinite;
}

.login-logo h1 {
    font-size: 22px;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 12px;
    color: var(--text-light);
}

.login-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.login-tab {
    flex: 1;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-light);
    border-radius: 7px;
    transition: all 0.25s;
}

.login-tab.active {
    background: white;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.form-field {
    position: relative;
    background: var(--bg);
    border-radius: 12px;
    padding: 12px 14px 12px 40px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.form-field:focus-within {
    border-color: var(--primary);
    background: white;
}

.field-icon {
    position: absolute;
    left: 12px;
    font-size: 18px;
    line-height: 1;
}

.form-field input {
    flex: 1;
    font-size: 14px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
}

.toggle-pwd {
    background: none;
    border: none;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
}

.login-hint {
    min-height: 18px;
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 8px;
    padding-left: 4px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff8a5d 0%, #ff6b35 100%);
    color: white;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.4);
    transition: all 0.2s;
    margin-bottom: 10px;
}

.login-btn:active {
    transform: scale(0.97);
}

.login-btn-secondary {
    width: 100%;
    padding: 11px;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.login-btn-secondary:active {
    background: var(--bg);
}

.login-tip {
    background: var(--bg);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.7;
}

.login-tip p:first-child {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 2px;
}

.login-tip strong {
    color: var(--primary);
}

/* 管理员标识 */
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffa502, #ff7e3e);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 600;
    vertical-align: middle;
}

.user-badge {
    display: inline-block;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 600;
    vertical-align: middle;
}

/* 用户管理列表 */
.user-list-row {
    background: var(--bg);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-list-row .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8a5d, #ff6b35);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-list-row .user-avatar.admin {
    background: linear-gradient(135deg, #ffa502, #ff7e3e);
}

.user-list-row .info {
    flex: 1;
    min-width: 0;
}

.user-list-row .name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.user-list-row .meta {
    font-size: 11px;
    color: var(--text-light);
}

.user-list-row .actions {
    display: flex;
    gap: 4px;
}

/* 订单中的用户标识 */
.order-owner-tag {
    display: inline-block;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 500;
}

.order-owner-tag.admin {
    background: linear-gradient(135deg, #ffa502, #ff7e3e);
}

/* ============================
   AI 小壕助手
============================ */
.ai-fab {
    position: fixed;
    right: 14px;
    bottom: 92px;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.ai-fab:active {
    transform: scale(0.9);
}

.ai-fab-label {
    background: white;
    color: #ff7e3e;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 126, 62, 0.3);
    border: 1px solid #ffe2cc;
}

.ai-fab-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 3px solid #ffb46b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 14px rgba(255, 126, 62, 0.35);
    animation: aiFloat 3s ease-in-out infinite;
    object-fit: cover;
}

@keyframes aiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.ai-chat {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(180deg, #fdf3e7 0%, #fbeedb 100%);
    display: none;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

.ai-chat.active {
    display: flex;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top, 0)) 14px 12px;
    background: rgba(253, 243, 231, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 180, 107, 0.2);
}

.ai-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff7e3e;
    border-radius: 50%;
}

.ai-back:active {
    background: rgba(255, 126, 62, 0.12);
}

.ai-chat-title {
    font-size: 17px;
    font-weight: 700;
    color: #ff7e3e;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ed573;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.18);
}

.ai-header-space {
    width: 32px;
}

.ai-disclaimer {
    margin: 10px 14px 0;
    background: #fdf3d8;
    color: #b8860b;
    font-size: 12px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #f5e4a8;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
    flex-direction: row-reverse;
}

.ai-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(160deg, #ffe9c8 0%, #ffd6a0 100%);
    border: 2px solid #ffb46b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ai-msg.user .ai-msg-avatar {
    background: linear-gradient(160deg, #d6f5ff 0%, #a8e6ff 100%);
    border-color: #7cd4f5;
}

.ai-msg-avatar.has-image {
    background: white;
    overflow: hidden;
    padding: 0;
}

.ai-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-msg-bubble {
    max-width: 75%;
    background: white;
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.65;
    color: #4a3728;
    box-shadow: 0 2px 8px rgba(255, 126, 62, 0.08);
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg.user .ai-msg-bubble {
    background: linear-gradient(135deg, #ff9a62 0%, #ff7e3e 100%);
    color: white;
    border-radius: 14px 4px 14px 14px;
    box-shadow: 0 3px 10px rgba(255, 126, 62, 0.3);
}

.ai-msg-bubble .ai-product-line {
    display: block;
    padding: 3px 0;
}

.ai-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffb46b;
    animation: typing 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.ai-chips {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.ai-chips::-webkit-scrollbar {
    display: none;
}

.ai-chip {
    flex-shrink: 0;
    background: white;
    color: #ff7e3e;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 18px;
    border: 1px solid #ffe2cc;
    box-shadow: 0 2px 6px rgba(255, 126, 62, 0.1);
    transition: all 0.2s;
}

.ai-chip:active {
    background: #fff5ec;
    transform: scale(0.96);
}

.ai-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0));
    background: rgba(253, 243, 231, 0.98);
    border-top: 1px solid rgba(255, 180, 107, 0.2);
}

.ai-input-bar input {
    flex: 1;
    background: white;
    border-radius: 22px;
    padding: 11px 18px;
    font-size: 14px;
    color: #4a3728;
    box-shadow: 0 2px 8px rgba(255, 126, 62, 0.1);
}

.ai-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a62 0%, #ff7e3e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(255, 126, 62, 0.4);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ai-send:active {
    transform: scale(0.88);
}

/* ============================
   豪气排行榜（黑金风格）
============================ */
.rank-page {
    position: fixed;
    inset: 0;
    z-index: 900;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(180deg, #1c1a14 0%, #0d0c08 100%);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.rank-page.active {
    display: flex;
}

.rank-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 214, 106, 0.12);
    flex-shrink: 0;
}

.rank-header-title {
    color: #ffd66a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
}

.rank-header .ai-back {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 214, 106, 0.25);
    color: #ffd66a;
}

.rank-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 24px;
}

.rank-hero {
    text-align: center;
    margin-bottom: 18px;
}

.rank-crown {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 12px rgba(255, 200, 60, 0.45));
    animation: aiFloat 3s ease-in-out infinite;
    display: inline-block;
}

.rank-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(180deg, #ffe9a8 0%, #ffc93c 55%, #d99a1f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.rank-rules-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #ffd66a;
    background: rgba(255, 214, 106, 0.1);
    border: 1px solid rgba(255, 214, 106, 0.3);
    border-radius: 999px;
    padding: 4px 12px;
}

.rank-rules-btn:active {
    background: rgba(255, 214, 106, 0.2);
}

.rank-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 214, 106, 0.15);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}

.rank-tab {
    flex: 1;
    padding: 9px 0;
    font-size: 13px;
    color: rgba(255, 233, 168, 0.6);
    border-radius: 9px;
    transition: all 0.25s;
}

.rank-tab.active {
    background: linear-gradient(180deg, #ffe9a8 0%, #f0b93a 100%);
    color: #3a2c05;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(240, 185, 58, 0.35);
}

/* 榜单行 */
.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 214, 106, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.rank-row.self {
    background: linear-gradient(135deg, rgba(255, 214, 106, 0.16), rgba(255, 214, 106, 0.06));
    border-color: rgba(255, 214, 106, 0.45);
}

.rank-medal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 233, 168, 0.75);
}

.rank-medal.m1 {
    background: linear-gradient(160deg, #ffe9a8, #f0b93a);
    color: #4a3505;
    box-shadow: 0 2px 10px rgba(240, 185, 58, 0.4);
}

.rank-medal.m2 {
    background: linear-gradient(160deg, #e8e8e8, #aab2bd);
    color: #3c4148;
}

.rank-medal.m3 {
    background: linear-gradient(160deg, #f0c19a, #c88346);
    color: #4c2e0c;
}

.rank-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(160deg, #2c2820, #1a1812);
    border: 2px solid rgba(255, 214, 106, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.rank-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-user {
    font-size: 14px;
    font-weight: 600;
    color: #f5e9c8;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.rank-user .admin-badge {
    margin-left: 6px;
}

.rank-meta {
    font-size: 11px;
    color: rgba(245, 233, 200, 0.5);
}

.rank-count {
    text-align: right;
    flex-shrink: 0;
}

.rank-count strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(180deg, #ffe9a8, #f0b93a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rank-count span {
    font-size: 10px;
    color: rgba(245, 233, 200, 0.45);
}

/* 空状态 */
.rank-empty {
    text-align: center;
    padding: 46px 20px 30px;
}

.rank-empty .trophy {
    font-size: 58px;
    line-height: 1;
    margin-bottom: 14px;
    filter: drop-shadow(0 6px 16px rgba(255, 200, 60, 0.35));
}

.rank-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffd66a;
    margin-bottom: 6px;
}

.rank-empty-sub {
    font-size: 12px;
    color: rgba(245, 233, 200, 0.5);
    margin-bottom: 22px;
}

.rank-go-btn {
    display: inline-block;
    background: linear-gradient(180deg, #ffe9a8 0%, #f0b93a 100%);
    color: #3a2c05;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 34px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(240, 185, 58, 0.35);
}

.rank-go-btn:active {
    transform: scale(0.96);
}

/* ============================
   我的页面（新版 UI）
============================ */
/* 顶部橙色渐变用户卡 */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #ff9a3e 0%, #ff7e3e 55%, #f76b1c 100%);
    border-radius: 18px;
    padding: 18px 16px;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(247, 107, 28, 0.3);
}

.hero-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.profile-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: white;
    border: 3px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-edit-pen {
    position: absolute;
    right: -4px;
    bottom: -2px;
    background: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.hero-info {
    flex: 1;
    min-width: 0;
}

.hero-name {
    font-size: 17px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.hero-name .admin-badge,
.hero-name .user-badge {
    margin-left: 6px;
}

.hero-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-capsules {
    display: flex;
    gap: 8px;
}

.hero-capsule {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    color: white;
    backdrop-filter: blur(4px);
}

.hero-capsule strong {
    font-size: 13px;
    font-weight: 800;
}

.hero-capsule em {
    font-style: normal;
    font-size: 10px;
    opacity: 0.85;
}

.hero-capsule .hero-new {
    background: #fff;
    color: #f76b1c;
    font-weight: 800;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 6px;
}

/* 豪气排行榜横条 */
.rank-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #26221a 0%, #14110b 100%);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.rank-strip:active {
    transform: scale(0.985);
}

.rank-strip-icon {
    font-size: 18px;
}

.rank-strip-title {
    color: #ffd66a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.rank-strip-fire {
    background: linear-gradient(135deg, #ff5e3a, #ff2e63);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
}

.rank-strip-right {
    margin-left: auto;
    font-size: 11px;
    color: rgba(255, 214, 106, 0.7);
}

/* 通用白卡片 */
.profile-card {
    background: white;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
}

.card-pill-btn {
    background: #fff1e6;
    color: #f76b1c;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

.card-pill-btn:active {
    background: #ffe3cf;
}

.card-view-all {
    background: #fff1e6;
    color: #f76b1c;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

.card-view-all:active {
    background: #ffe3cf;
}

/* 地址卡内容 */
.addr-body {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-light);
}

.addr-body.empty {
    color: #c9c4bb;
}

.addr-empty-icon {
    font-size: 26px;
    opacity: 0.55;
}

.addr-empty-text {
    font-size: 12px;
}

.addr-value {
    width: 100%;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    text-align: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
}

/* 最近订单 */
.recent-order-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.recent-order-row:last-child {
    margin-bottom: 0;
}

.recent-order-imgs {
    display: flex;
    flex-shrink: 0;
}

.recent-order-imgs > div {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-left: -6px;
    overflow: hidden;
}

.recent-order-imgs > div:first-child {
    margin-left: 0;
}

.recent-order-imgs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-order-info {
    flex: 1;
    min-width: 0;
}

.recent-order-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-order-meta {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 2px;
}

.recent-order-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.recent-empty {
    text-align: center;
    padding: 16px 0 10px;
    color: #c9c4bb;
    font-size: 12px;
}

/* 底部功能行 */
.profile-lines {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.profile-lines .menu-item {
    border-radius: 0;
    border-bottom: 1px solid var(--bg);
}

.profile-lines .menu-item:last-child {
    border-bottom: none;
}

/* ============================
   优惠券中心
============================ */
.coupon-center {
    padding-bottom: 6px;
}

.coupon-points-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff9a3e 0%, #ff7e3e 100%);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.coupon-points-bar .cp-icon {
    font-size: 22px;
}

.coupon-points-bar .cp-num {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.coupon-points-bar .cp-label {
    flex: 1;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
}

.coupon-center-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0 2px 8px;
}

/* 券卡片（票券造型） */
.coupon-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg, #fff7ec 0%, #ffeeda 100%);
    border: 1px solid #ffd9ae;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.coupon-card::before,
.coupon-card::after {
    content: '';
    position: absolute;
    right: 84px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    border: 1px solid #ffd9ae;
    z-index: 1;
}

.coupon-card::before { top: -6px; }
.coupon-card::after { bottom: -6px; }

.coupon-left {
    flex: 1;
    padding: 12px 14px;
    min-width: 0;
}

.coupon-left .cl-name {
    font-size: 14px;
    font-weight: 700;
    color: #d35400;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coupon-left .cl-desc {
    font-size: 11px;
    color: #b98a5e;
    margin-bottom: 5px;
}

.coupon-left .cl-tag {
    display: inline-block;
    font-size: 10px;
    color: #e67e22;
    background: rgba(230, 126, 34, 0.1);
    border: 1px dashed #f0b27a;
    padding: 1px 8px;
    border-radius: 999px;
}

.coupon-right {
    width: 84px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-left: 1px dashed #ffd9ae;
    background: rgba(255, 214, 160, 0.25);
}

.coupon-right .cr-value {
    font-size: 16px;
    font-weight: 800;
    color: #e67e22;
}

.coupon-right .cr-cost {
    font-size: 10px;
    color: #b98a5e;
}

.coupon-right button {
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ff9a3e, #ff7e3e);
    border-radius: 999px;
    padding: 4px 14px;
}

.coupon-right button:disabled {
    background: #d8d8d8;
}

.coupon-right button:not(:disabled):active {
    transform: scale(0.94);
}

/* 我的券列表 */
.my-coupon-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fff7ec 0%, #ffeeda 100%);
    border: 1px solid #ffd9ae;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.my-coupon-item .mc-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.my-coupon-item .mc-info {
    flex: 1;
    min-width: 0;
}

.my-coupon-item .mc-name {
    font-size: 13px;
    font-weight: 700;
    color: #d35400;
}

.my-coupon-item .mc-desc {
    font-size: 10px;
    color: #b98a5e;
    margin-top: 2px;
}

.coupon-empty-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    padding: 14px 0 18px;
}

/* ============================
   微信支付弹窗
============================ */
.wechat-pay-content {
    text-align: center;
}

.pay-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff7e6;
    border: 1px solid #ffe0a3;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
    margin-bottom: 12px;
}

.pay-notice-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1.4;
}

.pay-notice-text {
    font-size: 12.5px;
    color: #9a6b1f;
    line-height: 1.6;
}

.pay-notice-text strong {
    color: #e2543f;
}

.pay-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text);
}

.pay-amount-row strong {
    color: #e2543f;
    font-size: 20px;
    font-weight: 800;
}

.pay-qrcode {
    width: 250px;
    max-width: 72%;
    margin: 0 auto 8px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.pay-qrcode img {
    width: 100%;
    display: block;
}

.pay-hint {
    font-size: 11.5px;
    color: var(--text-light);
    margin-bottom: 14px;
}

/* 结算页优惠券选择 */
.coupon-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coupon-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--bg);
    transition: all 0.15s;
    cursor: pointer;
}

.coupon-option .co-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.coupon-option .co-info {
    flex: 1;
    min-width: 0;
}

.coupon-option .co-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.coupon-option .co-desc {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 1px;
}

.coupon-option .co-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    background: white;
}

.coupon-option.selected {
    border-color: var(--primary);
    background: #fff3ea;
}

.coupon-option.selected .co-check {
    background: var(--primary);
    border-color: var(--primary);
}

.coupon-option.selected .co-check::after {
    content: '✓';
}

.coupon-option.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.coupon-option-none {
    font-size: 11px;
    color: var(--text-light);
    padding: 4px 2px;
}

/* 管理后台订单搜索 */
.admin-order-search {
    margin-bottom: 10px;
}

.admin-order-search input {
    width: 100%;
    font-size: 13px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    outline: none;
    color: var(--text);
}

.admin-order-search input:focus {
    border-color: var(--primary);
    background: white;
}

.order-id-tag {
    display: inline-block;
    font-size: 10px;
    color: var(--text-light);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 6px;
    font-family: monospace;
    vertical-align: middle;
    font-weight: 400;
}

/* ============================
   许愿池
============================ */
/* 我的页面入口横条（复用 rank-strip 结构，改为橙色主题） */
#wishStrip {
    background: linear-gradient(135deg, #ffb56b 0%, #ff7e3e 100%);
    box-shadow: 0 4px 14px rgba(247, 107, 28, 0.3);
}

#wishStrip .rank-strip-title {
    color: white;
}

#wishStrip .rank-strip-fire {
    background: rgba(255, 255, 255, 0.25);
}

#wishStrip .rank-strip-right {
    color: rgba(255, 255, 255, 0.85);
}

/* 全屏许愿池页面 */
.wish-page {
    position: fixed;
    inset: 0;
    z-index: 900;
    max-width: 480px;
    margin: 0 auto;
    background: #fdf3e3;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.wish-page.active {
    display: flex;
}

.wish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: #fdf3e3;
    flex-shrink: 0;
}

.wish-header-title {
    color: #ff6b35;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2px;
}

.wish-header .ai-back {
    background: white;
    border-color: #ffe2cc;
    color: #ff6b35;
    box-shadow: 0 2px 8px rgba(255, 126, 62, 0.12);
}

.wish-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 90px;
}

/* 胶囊 tab */
.wish-tabs {
    display: flex;
    background: #f6e7d2;
    border-radius: 999px;
    padding: 4px;
    margin: 4px 14px 12px;
}

.wish-tab {
    flex: 1;
    padding: 9px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #a8896b;
    border-radius: 999px;
    transition: all 0.25s;
}

.wish-tab.active {
    background: white;
    color: #ff6b35;
    box-shadow: 0 2px 8px rgba(180, 120, 50, 0.15);
}

/* 心愿卡片 */
.wish-card {
    background: white;
    border-radius: 16px;
    padding: 14px;
    margin: 0 14px 12px;
    box-shadow: 0 2px 10px rgba(190, 130, 60, 0.08);
}

.wish-card.adopted {
    background: linear-gradient(135deg, #fffdf8, #fdf6e8);
    border: 1px solid #ffe2b8;
}

.wish-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wish-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(160deg, #ffe9c8, #ffd6a0);
    border: 1.5px solid #ffd9ae;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.wish-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wish-user {
    font-size: 13px;
    font-weight: 700;
    color: #5b4632;
    display: flex;
    align-items: center;
}

.wish-user .admin-badge {
    margin-left: 4px;
}

.wish-time {
    margin-left: auto;
    font-size: 11px;
    color: #c4ac92;
    flex-shrink: 0;
}

.wish-content {
    margin: 10px 0;
    font-size: 14px;
    color: #4a3826;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.wish-reply {
    background: #fff7ec;
    border-left: 3px solid #ffb46b;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12.5px;
    color: #8a6a44;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.wish-foot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wish-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.wish-tag.adopted {
    background: #e8f7ec;
    color: #2fa35c;
}

.wish-vote {
    margin-left: auto;
    border: 1px solid #ffc9a3;
    background: #fff5ec;
    color: #ff6b35;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    transition: all 0.2s;
}

.wish-vote.voted {
    background: linear-gradient(135deg, #ff8a4d, #ff6b35);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
}

.wish-vote:active {
    transform: scale(0.94);
}

.wish-mini-btn {
    border: 1px solid #eee0cd;
    background: white;
    color: #8a6a44;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
}

.wish-mini-btn:active {
    transform: scale(0.94);
}

.wish-mini-btn.primary {
    border-color: #ffb46b;
    color: #ff6b35;
}

.wish-mini-btn.danger {
    border-color: #ffd0c6;
    color: #e2543f;
}

/* 空状态 */
.wish-empty {
    text-align: center;
    padding: 110px 20px 30px;
}

.wish-empty .star {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
    filter: drop-shadow(0 6px 14px rgba(255, 180, 60, 0.45));
    animation: aiFloat 3s ease-in-out infinite;
    display: inline-block;
}

.wish-empty p {
    font-size: 13px;
    color: #b7a48d;
}

/* 橙色发布按钮 */
.wish-fab {
    position: absolute;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0));
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ffa14d 0%, #ff5f2e 100%);
    color: white;
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(255, 95, 46, 0.45);
    transition: transform 0.2s;
    z-index: 5;
}

.wish-fab:active {
    transform: scale(0.9);
}
