/* 消费者端（8080 端口）样式：移动优先的"小程序"风格页面
   主题色：翠绿 #0e9f6e，容器最大宽度 480px，底部标签栏导航 */

:root {
    --primary: #0e9f6e;
    --primary-dark: #0b855c;
    --primary-light: #e6f7f0;
    --danger: #e53e3e;
    --warn: #d97706;
    --text: #1f2937;
    --text-sub: #6b7280;
    --text-faint: #9ca3af;
    --border: #eef0f3;
    --bg: #f5f6f8;
    --card: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #eceef1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/* 应用容器：居中，模拟手机宽度 */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, .06);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
}

.app-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.app-header .header-left,
.app-header .header-right {
    width: 44px;
    display: flex;
    align-items: center;
}

.app-header .header-right { justify-content: flex-end; }

.app-header a {
    color: #fff;
    font-size: 13px;
}

.app-body {
    flex: 1;
    padding: 14px 14px 84px;
}

/* 底部标签栏 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 30;
}

.tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 10px;
    color: var(--text-faint);
    font-size: 11px;
}

.tabbar a .tab-icon { font-size: 20px; line-height: 1; }

.tabbar a.active { color: var(--primary); }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 4px 2px 10px;
}

/* 首页横幅 */
.banner {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #0e9f6e, #38d39f);
    color: #fff;
    padding: 18px 16px;
}

.banner .banner-title { font-size: 16px; font-weight: 700; }
.banner .banner-sub { font-size: 12px; opacity: .9; margin-top: 4px; }

.banner img {
    width: 100%;
    display: block;
    border-radius: 12px;
    margin-bottom: 12px;
}

/* 账户概要 */
.account-hero {
    background: linear-gradient(135deg, #0e9f6e, #17b98a);
    border-radius: 14px;
    padding: 18px;
    color: #fff;
    margin-bottom: 12px;
}

.account-hero .hello { font-size: 13px; opacity: .92; }
.account-hero .name { font-size: 20px; font-weight: 700; margin: 2px 0 12px; }
.account-hero .metrics { display: flex; gap: 10px; }
.account-hero .metric {
    flex: 1;
    background: rgba(255, 255, 255, .16);
    border-radius: 10px;
    padding: 10px 12px;
}
.account-hero .metric .num { font-size: 18px; font-weight: 700; }
.account-hero .metric .label { font-size: 11px; opacity: .88; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border-radius: 12px;
    padding: 14px 6px;
    color: var(--text);
    font-size: 12px;
}
.quick-grid a .quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--primary-light);
}

/* 列表 */
.list { background: var(--card); border-radius: 12px; overflow: hidden; }
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .list-main { flex: 1; min-width: 0; }
.list-item .list-title { font-size: 14px; font-weight: 500; }
.list-item .list-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.list-item .list-extra { text-align: right; }

/* 按钮 */
.btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
}

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

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

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

.btn-danger {
    background: #fff;
    border-color: #fbd5d5;
    color: var(--danger);
}

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.form-input {
    width: 100%;
    border: 1px solid var(--border);
    background: #fafbfc;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}
.form-input:focus { border-color: var(--primary); background: #fff; }
.form-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* 标签 / 徽章 */
.tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
}
.tag-gray { background: #f1f2f4; color: var(--text-sub); }
.tag-warn { background: #fef3e2; color: var(--warn); }
.tag-danger { background: #fdecec; color: var(--danger); }

/* 金额 */
.amount { color: var(--primary); font-weight: 700; }
.amount-lg { font-size: 22px; }

/* 空态 */
.empty {
    text-align: center;
    color: var(--text-faint);
    padding: 40px 16px;
    font-size: 13px;
}
.empty .empty-icon { font-size: 44px; margin-bottom: 8px; }

/* 商品行 */
.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }
.product-row .p-name { font-size: 14px; font-weight: 500; }
.product-row .p-spec { font-size: 12px; color: var(--text-sub); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fafbfc;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}
.stepper .qty { min-width: 24px; text-align: center; font-weight: 600; }

/* 支付弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
    padding: 20px;
}
.modal-box h3 { margin: 0 0 6px; font-size: 16px; }
.modal-box .modal-sub { font-size: 12.5px; color: var(--text-sub); margin-bottom: 16px; }

/* 提示 toast（app.js 使用） */
#toast-host {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(17, 24, 39, .92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 82vw;
    opacity: 0;
    transform: translateY(-8px);
    transition: all .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--primary); }
.toast-error { background: var(--danger); }

/* 登录 / 注册 */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #0e9f6e, #17b98a 55%, #d8f5ec);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 26px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.auth-card .brand { text-align: center; margin-bottom: 20px; }
.auth-card .brand .logo { font-size: 40px; }
.auth-card .brand h1 { margin: 6px 0 2px; font-size: 20px; color: var(--text); }
.auth-card .brand p { margin: 0; font-size: 12px; color: var(--text-sub); }
.auth-card .auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-sub); }

.demo-tip {
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--primary-light);
    border-radius: 8px;
    font-size: 12px;
    color: var(--primary-dark);
}

.splash-banner {
    max-width: 380px;
    width: 100%;
    margin-bottom: 14px;
    border-radius: 12px;
    overflow: hidden;
}
.splash-banner img { width: 100%; display: block; }

@media (max-width: 480px) {
    .app { box-shadow: none; }
}
