* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; padding:0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: #f4f5f9;
    color: #222;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: #3b82f6; text-decoration: none; }

/* ===== 通用页容器 ===== */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-body { flex: 1; padding: 16px; max-width: 640px; width: 100%; margin: 0 auto; }

/* ===== 顶部导航 ===== */
.topbar {
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 600;
    position: sticky; top: 0; z-index: 50;
}
.topbar .back {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #333;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(20, 30, 60, .04);
    margin-bottom: 14px;
}

/* ===== 表单 ===== */
.field { margin-bottom: 14px; position: relative; }
.field label { display:block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: #fafbfd;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: #3b82f6;
    background: #fff;
}
.field input[readonly] { background: #f1f3f8; color: #666; }

/* ===== 按钮 ===== */
.btn {
    display: block; width: 100%;
    padding: 13px; border: 0; border-radius: 10px;
    background: #3b82f6; color: #fff;
    font-size: 16px; font-weight: 500;
    cursor: pointer; transition: opacity .15s;
    font-family: inherit;
}
.btn:active { opacity: .85; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-gray { background: #eceef3; color: #333; }
.btn-green { background: #22c55e; }
.btn-red { background: #ef4444; }
.btn-sm { padding: 8px 14px; width: auto; font-size: 14px; border-radius: 8px; }

/* ===== 提示 ===== */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.alert-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info{ background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.tip-line { font-size: 13px; margin-top: 6px; min-height: 18px; }
.tip-ok    { color: #16a34a; }
.tip-err   { color: #dc2626; }
.tip-load  { color: #888; }

/* ===== 底部导航 ===== */
.tabbar {
    height: 56px;
    background: #fff;
    border-top: 1px solid #eef0f4;
    display: flex;
    position: sticky; bottom: 0; z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #999; font-size: 11px; gap: 2px;
    transition: color .15s;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: #3b82f6; }

/* ===== 通用小工具 ===== */
.text-center { text-align: center; }
.text-mute   { color: #888; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* ===== 登录/注册主标题 ===== */
.auth-logo { text-align: center; padding: 40px 0 20px; }
.auth-logo .icon {
    width: 72px; height: 72px; margin: 0 auto 14px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: #fff;
    box-shadow: 0 8px 24px rgba(59, 130, 246, .3);
}
.auth-logo h1 { margin: 0; font-size: 20px; font-weight: 600; color: #1e293b; }
.auth-logo p { margin: 6px 0 0; font-size: 13px; color: #94a3b8; }