/* jz.taou.net 记账 - 移动端样式
   参考 sextoy8/mobile 风格: 主色 #206bc4 / 背景 #f6f8fb / 圆角卡片 / 柔和阴影 / 蓝色渐变 Hero
   自包含, 不依赖外部框架 */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f6f8fb;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
input, select, button, textarea { font: inherit; color: inherit; }

.mobile-page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f6f8fb; position: relative; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.mobile-header {
    position: sticky; top: 0; z-index: 20;
    height: 52px; display: flex; align-items: center;
    background: #fff; border-bottom: 1px solid #edf0f4; padding: 0 12px;
}
.mobile-header-side { width: 64px; display: flex; align-items: center; }
.mobile-header-side:last-child { justify-content: flex-end; }
.mobile-header-title { flex: 1; text-align: center; font-weight: 600; font-size: 16px; color: #111827; }
.mobile-header-action { color: #206bc4; font-size: 14px; padding: 6px 4px; white-space: nowrap; }

/* ---------- content / tabbar ---------- */
.mobile-content { flex: 1; padding: 14px 14px 24px; }
.mobile-tabbar {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; background: #fff; border-top: 1px solid #edf0f4;
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; color: #98a2b3; font-size: 11px; }
.mobile-tabbar-item.active { color: #206bc4; }
.mobile-tabbar-icon { font-size: 18px; line-height: 1; }

/* ---------- alert ---------- */
.mobile-alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.mobile-alert-error { background: #fee4e2; color: #b42318; }
.mobile-alert-success { background: #dcfae6; color: #027a48; }
.mobile-alert-warning { background: #fff4e5; color: #b54708; }

/* ---------- month switch ---------- */
.mobile-month-switch { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-month-arrow { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f4f7fb; color: #206bc4; font-size: 18px; }
.mobile-month-text { font-weight: 600; font-size: 16px; color: #111827; }

/* ---------- summary card (蓝色渐变) ---------- */
.mobile-summary-card { display: flex; gap: 8px; background: linear-gradient(135deg, #0b4fc4 0%, #206bc4 50%, #63a1ff 100%); border-radius: 18px; padding: 16px 12px; margin-bottom: 14px; color: #fff; box-shadow: 0 18px 38px rgba(32,107,196,.22); }
.mobile-summary-item { flex: 1; text-align: center; }
.mobile-summary-label { display: block; font-size: 11px; opacity: .85; margin-bottom: 4px; }
.mobile-summary-amount { display: block; font-size: 15px; font-weight: 700; }
.mobile-summary-card .mobile-summary-amount { color: #fff; }
.mobile-amount-income { color: #027a48; }
.mobile-amount-expense { color: #b42318; }

/* ---------- entry list ---------- */
.mobile-entry-list { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-entry-item { border-bottom: 1px solid #edf0f4; }
.mobile-entry-item:last-child { border-bottom: 0; }
.mobile-entry-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.mobile-entry-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.mobile-entry-icon.is-income { background: #dcfae6; color: #027a48; }
.mobile-entry-icon.is-expense { background: #fee4e2; color: #b42318; }
.mobile-entry-main { flex: 1; min-width: 0; }
.mobile-entry-note { font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-entry-meta { font-size: 11px; color: #98a2b3; margin-top: 2px; }
.mobile-entry-amount { font-size: 15px; font-weight: 700; flex-shrink: 0; }

.mobile-empty { text-align: center; color: #98a2b3; padding: 48px 20px; background: #fff; border-radius: 14px; line-height: 1.8; }

/* ---------- form ---------- */
.mobile-form { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-form-group { margin-bottom: 14px; }
.mobile-form-label { display: block; font-size: 13px; font-weight: 600; color: #344054; margin-bottom: 6px; }
.mobile-form-label small { color: #98a2b3; font-weight: 400; }
.mobile-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #dbe3ef; border-radius: 12px; background: #f8fafc; font-size: 14px; }
.mobile-input:focus { outline: none; border-color: #206bc4; background: #fff; }
.mobile-file-input { width: 100%; padding: 10px; border: 1px dashed #dbe3ef; border-radius: 12px; background: #f8fafc; font-size: 13px; }
.mobile-form-check label { display: flex; align-items: center; gap: 6px; }

.mobile-type-toggle { display: flex; gap: 8px; }
.mobile-type-opt { flex: 1; text-align: center; padding: 10px; border: 1px solid #dbe3ef; border-radius: 12px; background: #f8fafc; cursor: pointer; font-weight: 600; color: #667085; }
.mobile-type-opt input { display: none; }
.mobile-type-opt.active { border-color: #206bc4; background: #edf5ff; color: #206bc4; }

/* ---------- button ---------- */
.mobile-btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; background: #edf0f4; color: #344054; }
.mobile-btn-primary { background: #206bc4; color: #fff; }
.mobile-btn-outline { background: #fff; border: 1px solid #206bc4; color: #206bc4; }
.mobile-btn-danger { background: #fee4e2; color: #b42318; }
.mobile-btn-block { display: flex; width: 100%; margin-top: 4px; }

/* ---------- FAB (悬浮记账按钮) ---------- */
.mobile-fab { position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; height: 46px; padding: 0 20px; border-radius: 999px; background: #206bc4; color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 8px 20px rgba(32,107,196,.35); }

/* ---------- attach ---------- */
.mobile-attach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mobile-attach-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #f4f7fb; }
.mobile-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mobile-attach-del { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; text-align: center; padding: 3px; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* ---------- detail ---------- */
.mobile-detail-hero { text-align: center; padding: 24px 16px; border-radius: 18px; margin-bottom: 14px; color: #fff; background: linear-gradient(135deg, #0b4fc4, #206bc4, #63a1ff); box-shadow: 0 18px 38px rgba(32,107,196,.22); }
.mobile-detail-hero.is-expense { background: linear-gradient(135deg, #b42318, #d92d20, #f04438); box-shadow: 0 18px 38px rgba(180,35,24,.22); }
.mobile-detail-label { font-size: 12px; opacity: .85; margin: 0 0 4px; }
.mobile-detail-amount { font-size: 32px; font-weight: 700; }
.mobile-detail-note { font-size: 13px; opacity: .9; margin: 6px 0 0; }
.mobile-detail-list { background: #fff; border-radius: 14px; padding: 4px 14px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-detail-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf0f4; font-size: 14px; }
.mobile-detail-list li:last-child { border-bottom: 0; }
.mobile-detail-list li span { color: #667085; }
.mobile-detail-list li strong { color: #111827; }
.mobile-detail-actions { display: flex; gap: 10px; }
.mobile-detail-actions .mobile-btn, .mobile-detail-actions form { flex: 1; }
.mobile-detail-actions .mobile-btn { width: 100%; }

/* ---------- section ---------- */
.mobile-section { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-section-title { font-size: 14px; font-weight: 600; color: #111827; margin: 0 0 10px; }

/* ---------- monthly (支出/收入分表, 不同颜色) ---------- */
.mobile-monthly-block { background: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-monthly-block-title { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-size: 14px; font-weight: 600; margin: 0; }
.mobile-monthly-block-title span { font-size: 13px; font-weight: 700; }
.mobile-monthly-block.is-expense .mobile-monthly-block-title { background: #fee4e2; color: #b42318; }
.mobile-monthly-block.is-income .mobile-monthly-block-title { background: #dcfae6; color: #027a48; }
.mobile-monthly-table { margin: 0; }
.mobile-monthly-table li { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid #edf0f4; font-size: 14px; }
.mobile-monthly-table li span { color: #344054; }
.mobile-monthly-table li strong { font-size: 15px; }
.mobile-monthly-empty { color: #98a2b3 !important; justify-content: center !important; font-size: 13px !important; }

/* ---------- user ---------- */
.mobile-user-list { background: #fff; border-radius: 14px; overflow: hidden; margin-top: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-user-item { border-bottom: 1px solid #edf0f4; }
.mobile-user-item:last-child { border-bottom: 0; }
.mobile-user-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; gap: 8px; }
.mobile-user-info strong { display: block; color: #111827; }
.mobile-user-sub { font-size: 11px; color: #98a2b3; }
.mobile-user-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mobile-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mobile-tag-primary { background: #edf5ff; color: #206bc4; }
.mobile-tag-muted { background: #f4f7fb; color: #667085; }
.mobile-tag-danger { background: #fee4e2; color: #b42318; }
.mobile-tag-warning { background: #fff4e5; color: #b54708; }

/* ---------- profile ---------- */
.mobile-profile-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #0b4fc4, #206bc4, #63a1ff); border-radius: 18px; padding: 18px; color: #fff; margin-bottom: 14px; box-shadow: 0 18px 38px rgba(32,107,196,.22); }
.mobile-profile-avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.mobile-profile-info strong { display: block; font-size: 17px; }
.mobile-profile-sub { font-size: 12px; opacity: .85; }

/* ---------- menu ---------- */
.mobile-menu-list { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.mobile-menu-list li { border-bottom: 1px solid #edf0f4; }
.mobile-menu-list li:last-child { border-bottom: 0; }
.mobile-menu-list a { display: block; padding: 14px; color: #344054; }
.mobile-menu-list a::after { content: "›"; float: right; color: #98a2b3; }

/* ---------- login ---------- */
.mobile-login-content { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 24px; }
.mobile-login-hero { text-align: center; margin-bottom: 24px; }
.mobile-login-hero h1 { font-size: 30px; font-weight: 700; margin: 0 0 6px; letter-spacing: 4px; background: linear-gradient(135deg, #0b4fc4, #63a1ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mobile-login-hero p { color: #667085; margin: 0; }
.mobile-login-card { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 24px 60px rgba(25,68,130,.18); }

/* ---------- error ---------- */
.mobile-error { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 12px; }
.mobile-error h2 { font-size: 48px; color: #206bc4; margin: 0; }
.mobile-error p { color: #667085; margin: 0 0 8px; }

/* ---------- search (时间范围快捷选项 + 区间输入) ---------- */
.mobile-quick-range { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mobile-quick-range button { padding: 6px 12px; font-size: 13px; border: 1px solid #e3e8ef; border-radius: 999px; background: #fff; color: #475467; cursor: pointer; transition: all .15s; }
.mobile-quick-range button.active { background: #206bc4; border-color: #206bc4; color: #fff; }
.mobile-range-inputs { display: flex; align-items: center; gap: 8px; }
.mobile-range-inputs .mobile-input { flex: 1; }
.mobile-range-sep { color: #98a2b3; font-size: 13px; flex-shrink: 0; }
.mobile-search-form { margin-bottom: 16px; }
.mobile-export-bar { text-align: right; margin-bottom: 10px; }
.mobile-export-bar .mobile-btn { height: 36px; padding: 0 14px; font-size: 13px; }
/* ---------- multiselect (下拉多选) ---------- */
.mobile-multiselect { position: relative; }
.mobile-multiselect-trigger { display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; }
.mobile-multiselect-arrow { color: #98a2b3; font-size: 12px; margin-left: 8px; }
.mobile-multiselect-panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #dbe3ef; border-radius: 12px; box-shadow: 0 12px 28px rgba(15,23,42,.12); max-height: 240px; overflow-y: auto; z-index: 15; padding: 6px 0; display: none; }
.mobile-multiselect-panel.open { display: block; }
.mobile-multiselect-option { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 14px; color: #344054; }
.mobile-multiselect-option.ms-all { border-bottom: 1px solid #edf0f4; font-weight: 600; }
.mobile-multiselect-option input { margin: 0; }

/* ---------- chat (输入栏固定底部) ---------- */
.mobile-content-chat { display: flex; flex-direction: column; padding-bottom: 0; }
.mobile-chat { display: flex; flex-direction: column; flex: 1; margin: -14px -14px 0; min-height: 0; }
.mobile-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 4px; -webkit-overflow-scrolling: touch; }
.mobile-chat-bubble { max-width: 80%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.mobile-chat-bubble.assistant { align-self: flex-start; background: #fff; color: #1f2937; box-shadow: 0 4px 12px rgba(15,23,42,.05); border-bottom-left-radius: 4px; }
.mobile-chat-bubble.user { align-self: flex-end; background: #206bc4; color: #fff; border-bottom-right-radius: 4px; }
.mobile-chat-input-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: #fff; border-top: 1px solid #edf0f4; }
.mobile-chat-input-wrap { flex: 1; min-width: 0; }
.mobile-chat-input { width: 100%; resize: none; min-height: 44px; max-height: 120px; padding: 10px 12px; border: 1px solid #dbe3ef; border-radius: 12px; background: #f8fafc; font-size: 14px; line-height: 22px; box-sizing: border-box; overflow-y: auto; vertical-align: bottom; }
.mobile-chat-input:focus { outline: none; border-color: #206bc4; background: #fff; }
#chat-send { flex-shrink: 0; height: 44px; }

/* ---------- chat draft (写操作确认卡片) ---------- */
.mobile-chat-draft { align-self: stretch; background: #fff; border: 1px solid #206bc4; border-radius: 12px; padding: 12px; box-shadow: 0 4px 12px rgba(32,107,196,.08); }
.mobile-chat-draft-summary { font-size: 14px; color: #1f2937; line-height: 1.5; }
.mobile-chat-draft-actions { display: flex; gap: 8px; margin-top: 10px; }
.mobile-chat-draft-actions .mobile-btn { flex: 1; height: 38px; font-size: 13px; }
.mobile-chat-draft.done { border-color: #027a48; background: #f6fff9; }
.mobile-chat-draft.cancelled { opacity: .6; }

/* ---------- chat drawer (会话抽屉) ---------- */
.mobile-drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 40; opacity: 0; visibility: hidden; transition: opacity .2s; }
.mobile-drawer-overlay.open { opacity: 1; visibility: visible; }
.mobile-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 78%; max-width: 320px; background: #fff; z-index: 41; transform: translateX(-100%); transition: transform .25s; display: flex; flex-direction: column; }
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid #edf0f4; font-weight: 600; }
.mobile-btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.mobile-drawer-list { flex: 1; overflow-y: auto; margin: 0; }
.mobile-drawer-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border-bottom: 1px solid #edf0f4; cursor: pointer; }
.mobile-drawer-item.active { background: #edf5ff; }
.mobile-drawer-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mobile-drawer-item-del { border: 0; background: transparent; color: #98a2b3; font-size: 18px; padding: 4px 8px; cursor: pointer; }
.mobile-drawer-empty { padding: 24px; text-align: center; color: #98a2b3; font-size: 13px; }
