* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --u-primary: #1e6fff;
    --u-primary-dark: #1656c9;
    --u-bg: #f4f6fb;
    --u-text: #26334d;
    --u-muted: #8a96ab;
    --u-border: #eef1f7;
    --u-green: #18a058;
    --u-orange: #f0a020;
    --u-red: #d03050;
    --u-purple: #7c4dff;
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--u-text);
    background: var(--u-bg);
    font-size: 14px;
    line-height: 1.6;
}

.u-page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 60px;
    background: var(--u-bg);
}

/* ===== 顶部导航 ===== */
.u-topbar {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--u-border);
}

.u-topbar-left { display: flex; align-items: center; }

.u-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--u-text);
    letter-spacing: 1px;
}

.u-topbar-right { display: flex; gap: 14px; }
.u-top-link { color: var(--u-muted); text-decoration: none; font-size: 14px; }
.u-top-link.active { color: var(--u-primary); font-weight: 700; }

/* ===== 主内容 ===== */
.u-main { padding: 14px 12px; }

/* ===== 主视觉区 ===== */
.u-hero { display: flex; gap: 12px; margin-bottom: 14px; }

.u-hero-main {
    flex: 1.8;
    background: linear-gradient(135deg, #1e6fff, #3a8bff);
    border-radius: 16px;
    padding: 26px 20px;
    color: #fff;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(30, 111, 255, .26);
}
.u-hero-main::before {
    content: '';
    position: absolute;
    left: -34px; bottom: -46px;
    width: 130px; height: 130px;
    background: rgba(255, 255, 255, .14);
    border-radius: 50%;
}
.u-hero-main::after {
    content: '';
    position: absolute;
    right: 14px; top: 12px;
    width: 46px; height: 46px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
}

.u-hero-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 1; }
.u-hero-sub { font-size: 13px; opacity: .88; position: relative; z-index: 1; }

.u-hero-side {
    flex: 1;
    background: linear-gradient(135deg, #2fc6a5, #3fd9bb);
    border-radius: 16px;
    padding: 22px 14px;
    color: #fff;
    text-decoration: none;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(47, 198, 165, .26);
}
.u-hero-side::after {
    content: '';
    position: absolute;
    right: -16px; bottom: -18px;
    width: 64px; height: 64px;
    background: rgba(255, 255, 255, .16);
    border-radius: 50%;
}
.u-hero-side-title { font-size: 17px; font-weight: 700; margin-bottom: 5px; position: relative; z-index: 1; }
.u-hero-side-sub { font-size: 12px; opacity: .9; position: relative; z-index: 1; }

/* ===== 卡片 ===== */
.u-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(31, 45, 86, .05);
}

.u-card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 12px;
}

.u-card-head-text { display: flex; flex-direction: column; gap: 2px; }
.u-card-title-sm { font-size: 12px; color: var(--u-muted); }
.u-card-title { font-size: 17px; font-weight: 700; }
.u-card-body { padding: 6px 16px 16px; }

.u-head-right { display: flex; align-items: center; gap: 10px; }
.u-muted { color: var(--u-muted); font-size: 12px; }

.u-link { color: var(--u-primary); text-decoration: none; font-size: 13px; }

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

/* ===== 快捷入口 ===== */
.u-grid4 { display: flex; padding: 20px 8px 18px; }

.u-grid-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    text-decoration: none; color: var(--u-text);
}

.u-icon {
    width: 48px; height: 48px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    box-shadow: 0 8px 16px rgba(31, 45, 86, .14);
}
.u-icon-blue { background: linear-gradient(135deg, #1e6fff, #5b9dff); }
.u-icon-purple { background: linear-gradient(135deg, #7c4dff, #a67dff); }
.u-icon-orange { background: linear-gradient(135deg, #f0a020, #ffc04d); }
.u-icon-green { background: linear-gradient(135deg, #18a058, #3fd98a); }

.u-grid-label { font-size: 13px; font-weight: 500; }

/* ===== 列表 ===== */
.u-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    text-decoration: none; color: var(--u-text);
    border-bottom: 1px solid var(--u-border);
    transition: background .15s;
}
.u-list-item:last-child { border-bottom: none; }
.u-list-item:hover { background: #fafbfe; }

.u-tag {
    background: #e8f0ff; color: var(--u-primary);
    font-size: 11px; padding: 3px 9px; border-radius: 6px;
    flex-shrink: 0;
}

.u-list-title { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-arrow { color: #c3cbd8; font-size: 18px; }

.u-empty { text-align: center; color: var(--u-muted); padding: 30px 16px; }

/* ===== 分类导航 ===== */
.u-cat-nav { display: flex; gap: 8px; padding: 12px 16px 4px; flex-wrap: wrap; }
.u-cat {
    padding: 6px 15px; border-radius: 20px;
    font-size: 13px; color: var(--u-muted);
    text-decoration: none; background: #f4f6fb;
    border: 1px solid transparent;
}
.u-cat.active { background: var(--u-primary); color: #fff; }

/* ===== 表单 ===== */
.u-field { margin-bottom: 15px; }
.u-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.u-required { color: var(--u-red); }

.u-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    color: var(--u-text);
    background: #f6f8fc;
    transition: all .15s;
}
.u-input:focus { outline: none; background: #fff; border-color: var(--u-primary); box-shadow: 0 0 0 3px rgba(30, 111, 255, .12); }
.u-textarea { resize: vertical; }

.u-code-row { display: flex; gap: 8px; }
.u-code-row .u-input { flex: 1; }

.u-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s;
}
.u-btn-primary { background: var(--u-primary); color: #fff; box-shadow: 0 6px 14px rgba(30, 111, 255, .22); }
.u-btn-primary:hover { background: var(--u-primary-dark); }
.u-btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.u-btn-light { background: #f0f3f9; color: var(--u-text); border-color: #e3e8f2; }
.u-btn-light:hover { background: #e6ebf4; }
.u-btn-block { width: 100%; }

.u-inline { display: inline; }

/* ===== 提示 ===== */
.u-alert {
    padding: 11px 13px; border-radius: 12px;
    font-size: 13px; margin-bottom: 12px;
}
.u-alert-error { background: #fdeaea; color: #b01a2e; }
.u-tip { font-size: 12px; color: var(--u-muted); margin-bottom: 12px; }

/* ===== 订单卡片 ===== */
.u-order {
    margin: 12px;
    padding: 14px;
    border: 1px solid var(--u-border);
    border-radius: 14px;
    background: #fff;
}
.u-order-row { display: flex; padding: 5px 0; font-size: 13px; }
.u-order-label { width: 88px; color: var(--u-muted); flex-shrink: 0; }
.u-order-value { flex: 1; word-break: break-all; }
.u-mono { font-family: Consolas, "Courier New", monospace; }
.u-order .u-btn { margin-top: 12px; }

/* ===== 文章 ===== */
.u-article { padding: 18px 16px; }
.u-article-title { font-size: 19px; font-weight: 700; margin: 10px 0 6px; line-height: 1.4; }
.u-article-meta { font-size: 12px; color: var(--u-muted); }
.u-article-body { padding: 14px 4px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

/* ===== 聊天 ===== */
.u-chat { padding: 14px 12px; min-height: 320px; max-height: 480px; overflow-y: auto; background: #f7f9fd; }
.u-chat-welcome { text-align: center; color: var(--u-muted); font-size: 13px; padding: 20px 0; }

.u-msg { margin-bottom: 12px; }
.u-msg-me { text-align: right; }
.u-msg-them { text-align: left; }

.u-bubble {
    display: inline-block;
    max-width: 78%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    text-align: left;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(31, 45, 86, .06);
}
.u-msg-me .u-bubble { background: var(--u-primary); color: #fff; border-top-right-radius: 4px; }
.u-msg-them .u-bubble { background: #fff; color: var(--u-text); border: 1px solid var(--u-border); border-top-left-radius: 4px; }
.u-msg-time { font-size: 11px; color: var(--u-muted); margin-top: 4px; }

.u-chat-input { display: flex; gap: 8px; padding: 12px; }
.u-chat-hint { text-align: center; font-size: 12px; color: var(--u-muted); padding-bottom: 10px; }

/* ===== 底部导航 ===== */
.u-tabbar {
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: #fff;
    border-top: 1px solid var(--u-border);
    display: flex;
    padding: 0 0 env(safe-area-inset-bottom);
    z-index: 60;
}

.u-tab {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: var(--u-muted);
    font-size: 14px;
    padding: 13px 0;
    position: relative;
    transition: color .15s;
}
.u-tab.active { color: var(--u-primary); font-weight: 700; }
.u-tab.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--u-primary);
}

.u-footer { text-align: center; color: var(--u-muted); font-size: 11px; padding: 16px 0; }
