/* ==========================================================================
   星游纪 H5 · 设计系统
   仅服务 public/h5 下的分销商移动端页面
   ========================================================================== */

:root {
    --brand-700: #1442b8;
    --brand-600: #1a56db;
    --brand-500: #2f6bff;
    --brand-400: #5c8dff;
    --brand-050: #eef4ff;

    --navy-900: #071022;
    --navy-700: #0d2457;
    --hero-gradient: linear-gradient(158deg, #071022 0%, #0d2457 46%, #1a56db 100%);

    --bg: #f6f8fc;
    --card: #ffffff;
    --text-1: #101828;
    --text-2: #475467;
    --text-3: #98a2b3;
    --line: #edf1f7;

    --price: #e5484d;
    --success: #12b76a;
    --warning: #f79009;
    --danger: #d92d20;

    --r-xl: 22px;
    --r-lg: 18px;
    --r-md: 14px;
    --r-sm: 10px;

    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 24px -16px rgba(16, 24, 40, .14);
    --shadow-float: 0 8px 24px -8px rgba(26, 86, 219, .45);

    --tab-h: 58px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.5;
    max-width: 540px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 桌面浏览器下给手机版一个容器边界 */
@media (min-width: 560px) {
    body {
        background: #eef1f7;
        box-shadow: 0 0 0 1px rgba(16, 24, 40, .04), 0 24px 80px -24px rgba(16, 24, 40, .25);
    }
}

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

.page { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
.page--plain { padding-bottom: calc(var(--safe-b) + 24px); }

/* ---------------------------------------------------------------- 顶部导航 */
.navbar {
    position: sticky; top: 0; z-index: 100;
    height: 52px;
    display: flex; align-items: center; gap: 8px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(16, 24, 40, .05);
}
.navbar__back {
    width: 32px; height: 32px; margin-left: -6px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; border-radius: 10px; cursor: pointer;
    color: var(--text-1);
}
.navbar__back:active { background: rgba(16, 24, 40, .06); }
.navbar__title { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.navbar__action { margin-left: auto; font-size: 13px; color: var(--brand-600); font-weight: 500; }

/* ---------------------------------------------------------------- 通用卡片 */
.card {
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
}
.section { padding: 0 16px; margin-top: 22px; }
.section__head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px;
}
.section__title { font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.section__sub { font-size: 12px; color: var(--text-3); }
.section__more { font-size: 12px; color: var(--brand-600); font-weight: 500; }

/* 分组小标题（带右侧渐隐细线） */
.section-label {
    margin: 22px 16px 9px;
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 600; letter-spacing: 1px;
    color: #98a2b3;
}
.section-label::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(16, 24, 40, .09), rgba(16, 24, 40, 0));
}

/* 首屏元素轻量上浮 */
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.rise { animation: rise .52s cubic-bezier(.32, .72, 0, 1) both; }
.rise--d1 { animation-delay: .05s; }
.rise--d2 { animation-delay: .1s; }
.rise--d3 { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
    .rise { animation: none; }
}

/* ---------------------------------------------------------------- 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px; width: 100%;
    border: none; border-radius: 999px;
    font-size: 16px; font-weight: 600; letter-spacing: .3px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500) 55%, var(--brand-400));
    box-shadow: var(--shadow-float);
}
.btn--ghost {
    background: #fff; color: var(--brand-600);
    border: 1.5px solid rgba(26, 86, 219, .28);
}
.btn--soft { background: var(--brand-050); color: var(--brand-600); }
.btn--sm { height: 38px; font-size: 14px; width: auto; padding: 0 18px; }
.btn__icon { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- 底部 Tab */
.tabbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 540px;
    height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid rgba(16, 24, 40, .06);
    display: flex; z-index: 200;
}
.tabbar__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: none; cursor: pointer;
    color: var(--text-3); font-size: 11px; font-weight: 500;
    transition: color .18s ease;
}
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__item.is-active { color: var(--brand-600); }
.tabbar__item.is-active svg { stroke-width: 2.2; }

/* ---------------------------------------------------------------- 缩略图 / 占位 */
.thumb {
    position: relative; overflow: hidden; flex: none;
    background: linear-gradient(135deg, #dbe6ff, #eef4ff 60%, #e4ecff);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-md);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb::after {
    content: attr(data-letter);
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; letter-spacing: 1px;
    color: rgba(26, 86, 219, .45);
    z-index: 0;
}
.thumb img { position: relative; z-index: 1; background: transparent; }
.thumb.is-fallback::after { z-index: 2; }

/* ---------------------------------------------------------------- 状态徽章 */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .2px;
    background: var(--brand-050); color: var(--brand-600);
}
.badge--wait { background: #fff6e8; color: #b54708; }
.badge--ship { background: #e9f3ff; color: #175cd3; }
.badge--done { background: #e7f8ef; color: #067647; }
.badge--reject { background: #feeceb; color: #b42318; }

/* ---------------------------------------------------------------- 价格 */
.price { color: var(--price); font-weight: 700; font-variant-numeric: tabular-nums; }
.price__sign { font-size: .72em; margin-right: 1px; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }

/* ---------------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field__label {
    display: block; font-size: 12px; font-weight: 600; color: var(--text-2);
    margin-bottom: 7px; letter-spacing: .3px;
}
.field__control {
    display: flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 14px;
    background: #f8fafc;
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.field__control:focus-within {
    background: #fff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(47, 107, 255, .12);
}
.field__control input {
    flex: 1; min-width: 0; height: 100%;
    border: none; outline: none; background: transparent;
    font-size: 15px; font-weight: 500;
}
.field__control input::placeholder { color: var(--text-3); font-weight: 400; }
.field__icon { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.field__toggle {
    border: none; background: none; padding: 4px; cursor: pointer;
    color: var(--text-3); display: flex;
}
.field__error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field.has-error .field__control { border-color: var(--danger); background: #fffbfb; }
.field.has-error .field__error { display: block; }

/* ---------------------------------------------------------------- 步进器 */
.stepper {
    display: inline-flex; align-items: center;
    height: 34px; border-radius: 999px;
    background: #f1f5fb; overflow: hidden;
}
.stepper button {
    width: 34px; height: 34px; border: none; background: none; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--brand-600); font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.stepper button:disabled { color: #c9d2e0; cursor: not-allowed; }
.stepper button:active:not(:disabled) { background: rgba(26, 86, 219, .08); }
.stepper input {
    width: 42px; height: 34px; border: none; background: none; outline: none;
    text-align: center; font-size: 14px; font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #eef2f8 25%, #f6f9fd 37%, #eef2f8 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------------------------------------------------------------- 空 / 错误态 */
.state {
    padding: 56px 24px; text-align: center;
}
.state__icon {
    width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 20px; background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-card); color: var(--brand-400);
}
.state__icon svg { width: 28px; height: 28px; }
.state__title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.state__desc { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.state .btn { margin-top: 18px; }

/* ---------------------------------------------------------------- Toast */
.toast-layer {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 2000;
}
.toast {
    max-width: 76vw; padding: 12px 20px; border-radius: 14px;
    background: rgba(16, 24, 40, .88); color: #fff;
    font-size: 14px; line-height: 1.5; text-align: center;
    box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .5);
    backdrop-filter: blur(8px);
    opacity: 0; transform: translateY(8px) scale(.96);
    transition: opacity .22s ease, transform .22s ease;
}
.toast.is-show { opacity: 1; transform: translateY(0) scale(1); }
.toast--success { background: rgba(6, 118, 71, .94); }
.toast--error { background: rgba(180, 35, 24, .94); }

/* ---------------------------------------------------------------- 全屏 loading */
.boot {
    position: fixed; inset: 0; z-index: 1900;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
    background: rgba(246, 248, 252, .72);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.boot.is-show { opacity: 1; visibility: visible; }
.boot__spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(26, 86, 219, .18);
    border-top-color: var(--brand-600);
    animation: spin .8s linear infinite;
}
.boot__text { font-size: 13px; color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 底部操作条 */
.actionbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 540px; z-index: 300;
    padding: 12px 16px calc(12px + var(--safe-b));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid rgba(16, 24, 40, .06);
    display: flex; align-items: center; gap: 14px;
}
.actionbar__summary { flex: 1; min-width: 0; }
.actionbar__label { font-size: 11px; color: var(--text-3); }
.actionbar__amount { font-size: 19px; font-weight: 750; color: var(--price); font-variant-numeric: tabular-nums; }
.actionbar .btn { width: auto; min-width: 132px; height: 46px; padding: 0 22px; font-size: 15px; }

/* ---------------------------------------------------------------- 弹层 */
.sheet-mask {
    position: fixed; inset: 0; z-index: 1500;
    background: rgba(16, 24, 40, .42);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility .24s;
}
.sheet-mask.is-show { opacity: 1; visibility: visible; }
.sheet {
    position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
    width: 100%; max-width: 540px; z-index: 1600;
    background: #fff; border-radius: 24px 24px 0 0;
    padding: 22px 20px calc(20px + var(--safe-b));
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.sheet.is-show { transform: translate(-50%, 0); }
.sheet__handle {
    width: 38px; height: 4px; border-radius: 2px; background: #e4e9f2;
    margin: -8px auto 16px;
}
.sheet__title { font-size: 17px; font-weight: 650; margin-bottom: 4px; }
.sheet__desc { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }

.dialog {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.94);
    width: calc(100% - 64px); max-width: 340px; z-index: 1600;
    background: #fff; border-radius: 20px; padding: 22px 20px 16px;
    opacity: 0; visibility: hidden; transition: all .22s ease;
}
.dialog.is-show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.dialog__title { font-size: 16px; font-weight: 650; text-align: center; margin-bottom: 8px; }
.dialog__desc { font-size: 13px; color: var(--text-2); text-align: center; line-height: 1.6; margin-bottom: 18px; }
.dialog__actions { display: flex; gap: 10px; }
.dialog__actions .btn { height: 44px; font-size: 15px; }

/* ---------------------------------------------------------------- 杂项 */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.safe-note { font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.7; }
