/* ============================================================
   vQ安全工具箱 · 深色科技风设计系统
   深色底 + 霓虹蓝紫点缀 + 玻璃拟态 + 极客安全气质
   ============================================================ */
:root {
  --bg: #0A0E1A;
  --bg2: #0F1526;
  --surface: #141B2E;
  --surface2: #1B2440;
  --glass: rgba(27, 36, 64, .55);
  --border: rgba(120, 150, 255, .14);
  --border-hi: rgba(120, 150, 255, .32);
  --text: #E8EEFF;
  --text2: #93A0C0;
  --text3: #5E6B8C;
  --blue: #3B82F6;
  --blue-hi: #60A5FA;
  --purple: #8B5CF6;
  --cyan: #22D3EE;
  --green: #34D399;
  --orange: #FBBF24;
  --red: #F87171;
  --grad: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  --grad-cy: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  --grad-hot: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);
  --radius: 18px;
  --glow: 0 0 0 1px var(--border), 0 8px 32px rgba(0, 0, 0, .4);
  --neon-glow: 0 0 20px rgba(59, 130, 246, .25);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --sb-h: 32px;
  --tab-h: 64px;
}
[data-theme="light"] {
  --bg: #F4F6FC; --bg2: #EEF2FB; --surface: #FFFFFF; --surface2: #F0F4FF;
  --glass: rgba(255,255,255,.7); --border: rgba(30,60,140,.1); --border-hi: rgba(30,60,140,.22);
  --text: #141B2E; --text2: #4A5673; --text3: #6E7A98;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #05070E; color: var(--text); display: flex; align-items: center; justify-content: center;
  overflow: hidden; user-select: none;
  background-image: radial-gradient(circle at 15% 0%, rgba(59,130,246,.12), transparent 40%), radial-gradient(circle at 85% 100%, rgba(139,92,246,.12), transparent 40%);
}
button, input, textarea, select { font-family: inherit; }
button { border: none; background: none; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.phone-frame { position: relative; width: 400px; height: 860px; background: #000; border-radius: 48px; padding: 11px; box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 2px #1a2233 inset; flex: none; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #000; border-radius: 16px; z-index: 60; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; transition: background .3s; }

/* 状态栏 */
.statusbar { height: var(--sb-h); flex: none; padding: 8px 24px 0; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; z-index: 40; }
.sb-right { display: flex; align-items: center; gap: 5px; }
.sb-ico { width: 15px; height: 15px; stroke-width: 2.3; }
.sb-battery { width: 22px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; padding: 1.5px; position: relative; }
.sb-battery::after { content: ''; position: absolute; right: -3px; top: 3px; width: 2px; height: 5px; background: currentColor; border-radius: 0 2px 2px 0; }
.sb-battery i { display: block; width: 72%; height: 100%; background: currentColor; border-radius: 1px; }

.app { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.app::-webkit-scrollbar { display: none; }
.app.has-tab { padding-bottom: calc(var(--tab-h) + 14px); }
.page { animation: pageIn .3s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 启动页 */
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot-logo { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 32px; font-weight: 900; box-shadow: 0 0 40px rgba(59,130,246,.5); animation: bootPulse 1.4s infinite var(--ease); }
@keyframes bootPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.boot-text { color: var(--text2); font-size: 13px; letter-spacing: 1px; }

/* ============ 首页封面（重做）============ */
.home-cover { position: relative; padding: 20px 20px 0; overflow: hidden; }
.cover-glow { position: absolute; top: -80px; left: -40px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.35), transparent 70%); filter: blur(10px); pointer-events: none; }
.cover-glow2 { position: absolute; top: 40px; right: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.3), transparent 70%); filter: blur(10px); pointer-events: none; }
.cover-head { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.cover-brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); font-weight: 900; font-size: 18px; color: #fff; box-shadow: var(--neon-glow); position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: -2px; border-radius: 15px; border: 1px solid rgba(96,165,250,.5); }
.brand-title { font-size: 20px; font-weight: 900; letter-spacing: .5px; }
.brand-title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10px; color: var(--text2); letter-spacing: 2px; margin-top: 2px; }
.cover-avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--border); font-size: 18px; }

/* Banner 主视觉 */
.hero-banner { position: relative; border-radius: 22px; padding: 22px 20px; min-height: 132px; overflow: hidden; border: 1px solid var(--border-hi); display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 16px; }
.hero-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--c1), var(--c2)); opacity: .92; }
.hero-banner::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 50%); }
.hero-inner { position: relative; z-index: 2; }
.hero-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 4px 9px; border-radius: 20px; background: rgba(255,255,255,.18); color: #fff; margin-bottom: 10px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: #4ADE80; }
.hero-title { color: #fff; font-size: 21px; font-weight: 900; margin: 0 0 5px; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
.hero-sub { color: rgba(255,255,255,.85); font-size: 11px; line-height: 1.5; }
.hero-deco { position: absolute; right: 8px; top: 8px; width: 96px; height: 96px; opacity: .3; z-index: 1; }
.hero-deco svg { width: 100%; height: 100%; stroke-width: 1; }
.hero-dots { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 5px; z-index: 3; }
.hdot { width: 5px; height: 5px; border-radius: 4px; background: rgba(255,255,255,.5); transition: .3s; }
.hdot.on { width: 16px; background: #fff; }

/* 搜索栏 */
.search-wrap { padding: 0 20px; }
.search-box { height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 14px; transition: .2s; }
.search-box:focus-within { border-color: var(--blue); box-shadow: var(--neon-glow); }
.search-box svg { width: 18px; height: 18px; color: var(--text3); }
.search-box input { flex: 1; border: none; outline: none; background: none; color: var(--text); font-size: 13px; min-width: 0; }
.search-box input::placeholder { color: var(--text3); }
.search-box .s-clear { color: var(--text3); font-size: 20px; display: none; }
.search-box.has-value .s-clear { display: block; }
.kbd { font-size: 9px; color: var(--text3); border: 1px solid var(--border); padding: 2px 5px; border-radius: 5px; }

/* 分区标题 */
.section { padding: 20px 20px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.sec-title { font-size: 16px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sec-title .bar { width: 3px; height: 15px; border-radius: 3px; background: var(--c, var(--blue)); box-shadow: 0 0 10px var(--c, var(--blue)); }
.sec-title small { font-size: 10px; color: var(--text3); font-weight: 500; margin-left: 2px; }
.sec-more { font-size: 11px; color: var(--text2); display: flex; align-items: center; gap: 2px; }
.sec-more svg { width: 13px; height: 13px; }

/* 分区卡片（三个大入口） */
.section-cards { display: grid; gap: 10px; }
.section-card { border-radius: var(--radius); padding: 15px; display: flex; align-items: center; gap: 13px; position: relative; overflow: hidden; border: 1px solid var(--border); background: var(--surface); transition: transform .18s var(--ease), border-color .2s; }
.section-card:active { transform: scale(.98); }
.section-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: .13; pointer-events: none; }
.sc-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.sc-icon svg { width: 24px; height: 24px; }
.sc-body { flex: 1; min-width: 0; }
.sc-name { font-size: 15px; font-weight: 800; }
.sc-desc { font-size: 10px; color: var(--text2); margin-top: 3px; }
.sc-count { font-size: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); padding: 3px 9px; border-radius: 10px; font-weight: 700; }
.sc-arrow { color: var(--text3); width: 16px; height: 16px; }

/* 工具网格（玻璃卡片） */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px; }
.tool-card { border-radius: var(--radius); padding: 14px; background: var(--glass); border: 1px solid var(--border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); position: relative; transition: transform .18s var(--ease), border-color .2s; overflow: hidden; }
.tool-card:active { transform: scale(.97); }
.tool-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--c); opacity: .7; }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 11px; }
.t-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.t-icon svg { width: 21px; height: 21px; }
.fav-btn { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--text3); }
.fav-btn svg { width: 16px; height: 16px; }
.fav-btn.on { color: var(--orange); }
.fav-btn.on svg { fill: var(--orange); }
.t-name { font-size: 13px; font-weight: 800; }
.t-desc { font-size: 10px; color: var(--text2); margin-top: 4px; line-height: 1.45; min-height: 28px; }
.t-tag { display: inline-block; font-size: 8px; font-weight: 800; padding: 2px 7px; border-radius: 7px; margin-top: 8px; letter-spacing: .3px; }
.tag-real { color: var(--green); background: rgba(52,211,153,.12); }
.tag-sys { color: var(--orange); background: rgba(251,191,36,.12); }

/* 安全状态条 */
.status-strip { margin: 4px 20px 0; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; background: linear-gradient(135deg, rgba(52,211,153,.1), rgba(59,130,246,.08)); border: 1px solid rgba(52,211,153,.2); }
.status-strip .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.status-strip .st-text { flex: 1; font-size: 11px; }
.status-strip .st-text b { display: block; font-size: 12px; margin-bottom: 2px; }
.status-strip svg { width: 16px; color: var(--green); }

/* 底部三 Tab */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--tab-h); z-index: 50; background: rgba(15,21,38,.9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-around; padding-bottom: 6px; }
[data-theme="light"] .tabbar { background: rgba(255,255,255,.9); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text3); position: relative; }
.tab svg { width: 23px; height: 23px; transition: .2s; }
.tab span { font-size: 10px; font-weight: 700; }
.tab.on { color: var(--blue-hi); }
.tab.on svg { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(96,165,250,.6)); }
.tab.on::before { content: ''; position: absolute; top: -6px; width: 24px; height: 3px; border-radius: 3px; background: var(--grad); box-shadow: var(--neon-glow); }

/* ============ 功能页通用 ============ */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 11px; padding: 12px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(.92); }
.tb-title { font-size: 16px; font-weight: 800; flex: 1; }
.tb-sub { font-size: 10px; color: var(--text3); }
.page-body { padding: 16px 18px 30px; }

/* 真功能徽章 */
.real-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--green); background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.25); padding: 4px 10px; border-radius: 20px; margin-bottom: 14px; }
.real-badge svg { width: 13px; height: 13px; }
.sys-badge { color: var(--orange); background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.25); }

/* 输入/按钮 */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 11px; color: var(--text2); font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; font-size: 13px; background: var(--surface); color: var(--text); outline: none; resize: none; transition: .2s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: var(--neon-glow); }
.btn-primary { width: 100%; padding: 13px; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 800; background: var(--grad); box-shadow: 0 6px 20px rgba(59,130,246,.35); transition: .15s; }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn-primary { flex: 1; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.result { margin-top: 16px; padding: 15px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--border); font-size: 13px; line-height: 1.7; word-break: break-all; }
.result.center { text-align: center; }
.hash-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.hash-row:last-child { border: none; }
.hash-name { font-size: 11px; font-weight: 800; color: var(--blue-hi); width: 62px; flex: none; }
.hash-val { font-family: ui-monospace, monospace; font-size: 10px; color: var(--text2); flex: 1; word-break: break-all; line-height: 1.5; }
.hash-copy { color: var(--text3); flex: none; }
.hash-copy svg { width: 15px; height: 15px; }

/* 密码强度 */
.strength-meter { height: 8px; border-radius: 5px; background: var(--bg2); overflow: hidden; margin: 14px 0 8px; display: flex; gap: 3px; }
.strength-seg { flex: 1; border-radius: 3px; background: var(--bg2); transition: .3s; }
.strength-head { display: flex; justify-content: space-between; align-items: baseline; }
.strength-label { font-size: 22px; font-weight: 900; }
.strength-entropy { font-size: 11px; color: var(--text2); }
.tip-list { list-style: none; padding: 0; margin: 14px 0 0; }
.tip-list li { font-size: 11px; color: var(--text2); padding: 5px 0 5px 18px; position: relative; line-height: 1.5; }
.tip-list li::before { content: '›'; position: absolute; left: 2px; color: var(--blue); font-weight: 900; }

/* 开关 */
.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.toggle { width: 48px; height: 28px; border-radius: 20px; background: #33405e; position: relative; transition: .25s var(--ease); flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); transition: .25s var(--ease); }
.toggle.on { background: var(--blue); box-shadow: var(--neon-glow); }
.toggle.on::after { left: 23px; }

/* 统计网格 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 6px; text-align: center; }
.stat-card .num { font-size: 20px; font-weight: 900; color: var(--blue-hi); }
.stat-card .lbl { font-size: 10px; color: var(--text2); margin-top: 5px; }

/* 列表行 */
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border: none; }
.lr-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(59,130,246,.12); color: var(--blue-hi); }
.lr-icon svg { width: 17px; height: 17px; }
.lr-text { flex: 1; min-width: 0; }
.lr-text b { font-size: 13px; display: block; }
.lr-text small { font-size: 10px; color: var(--text2); display: block; margin-top: 3px; line-height: 1.4; }
.lr-val { font-size: 11px; color: var(--text3); }
.chev { color: var(--text3); width: 15px; height: 15px; flex: none; }

/* 品牌/选项卡 */
.opt-card { border-radius: 14px; padding: 15px; margin-bottom: 10px; border: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, var(--surface)), var(--surface)); }
.opt-card .oc-name { font-size: 14px; font-weight: 800; }
.opt-card .oc-desc { font-size: 10px; color: var(--text2); margin-top: 5px; }

/* 趋势柱状图 */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chart-tabs { display: flex; gap: 3px; background: var(--bg2); border-radius: 9px; padding: 3px; }
.chart-tab { font-size: 10px; padding: 5px 10px; border-radius: 7px; color: var(--text2); }
.chart-tab.on { background: var(--blue); color: #fff; font-weight: 700; }
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 18px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--blue-hi), var(--purple)); transition: height .5s var(--ease); min-height: 3px; }
.bar-col span { font-size: 8px; color: var(--text3); }

/* 清理动画 */
.clean-stage { text-align: center; padding: 20px 0; }
.clean-ring { width: 140px; height: 140px; margin: 0 auto 18px; position: relative; }
.clean-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.clean-ring .cr-bg { stroke: var(--bg2); stroke-width: 9; }
.clean-ring .cr-fg { stroke: url(#cleanGrad); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.clean-ring .cr-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; font-weight: 900; color: var(--blue-hi); }

/* 收藏/我的 */
.profile-hero { border-radius: 20px; padding: 20px; background: var(--grad); position: relative; overflow: hidden; margin-bottom: 16px; }
.profile-hero::after { content: ''; position: absolute; right: -20px; top: -20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); }
.ph-avatar { width: 54px; height: 54px; border-radius: 17px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 26px; margin-bottom: 12px; }
.ph-name { font-size: 18px; font-weight: 900; color: #fff; }
.ph-sub { font-size: 11px; color: rgba(255,255,255,.8); margin-top: 4px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty .ei { width: 80px; height: 80px; border-radius: 24px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.empty .ei svg { width: 36px; height: 36px; color: var(--blue); }
.empty b { display: block; color: var(--text2); font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 12px; line-height: 1.6; }
.empty .ebtn { margin-top: 16px; padding: 10px 24px; border-radius: 20px; color: #fff; font-weight: 700; font-size: 13px; background: var(--grad); }

/* Toast / 弹层 */
.toast-wrap { position: absolute; left: 0; right: 0; top: 44px; z-index: 200; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.toast { background: rgba(20,27,46,.95); color: var(--text); border: 1px solid var(--border-hi); padding: 10px 18px; border-radius: 12px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastIn .25s var(--ease); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 82%; text-align: center; }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }
.sheet-root { position: absolute; inset: 0; pointer-events: none; z-index: 150; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.6); pointer-events: auto; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 18px 30px; pointer-events: auto; animation: sheetUp .3s var(--ease); max-height: 76%; overflow-y: auto; border-top: 1px solid var(--border-hi); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet h3 { margin: 0 0 14px; font-size: 16px; }
.sheet-close { float: right; color: var(--text3); }
.sheet-close svg { width: 20px; height: 20px; }
.sheet-opt { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.sheet-opt svg { width: 17px; height: 17px; color: var(--blue-hi); }

/* AI 聊天 */
.chat-page { display: flex; flex-direction: column; height: 100%; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.chat-list::-webkit-scrollbar { display: none; }
.msg { display: flex; gap: 9px; max-width: 88%; animation: msgIn .25s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.msg.user .avatar { background: var(--grad-hot); }
.msg.ai .avatar { background: var(--grad); }
.msg .bubble { padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.6; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: var(--grad); border: none; color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .bubble { border-bottom-left-radius: 4px; }
.typing::after { content: '···'; letter-spacing: 3px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chat-quick { flex: none; display: flex; gap: 7px; padding: 8px 14px; overflow-x: auto; scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.quick-chip { flex: none; padding: 7px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-size: 11px; color: var(--blue-hi); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.quick-chip svg { width: 14px; height: 14px; }
.chat-input { flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 14px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.ci-box { flex: 1; height: 40px; border-radius: 20px; background: var(--bg2); padding: 0 14px; display: flex; align-items: center; gap: 8px; }
.ci-box input { flex: 1; border: none; outline: none; background: none; color: var(--text); font-size: 13px; min-width: 0; }
.ci-box svg { width: 19px; height: 19px; color: var(--text3); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn svg { width: 19px; height: 19px; }

/* 二维码 */
.qr-result { display: grid; place-items: center; margin-top: 18px; }
.qr-box { background: #fff; padding: 12px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.qr-box img, .qr-box canvas { display: block; }

/* 图片压缩 */
.preview-img { max-width: 100%; max-height: 220px; border-radius: 12px; margin-top: 12px; display: block; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--blue); }

/* 弹幕 */
.dm-stage { height: 280px; border-radius: 16px; background: #04060d; border: 1px solid var(--border); position: relative; overflow: hidden; margin-top: 14px; }
.dm-track { position: absolute; white-space: nowrap; font-weight: 900; animation: dmMove linear infinite; }
@keyframes dmMove { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* 桌宠 */
.pet-stage { height: 280px; border-radius: 16px; background: linear-gradient(180deg, #141b3a, #1a1040); position: relative; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--border); }
.pet-creature { position: absolute; width: 88px; height: 88px; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 66px; text-align: center; cursor: grab; user-select: none; }
.pet-bubble { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border-hi); padding: 8px 14px; border-radius: 14px; font-size: 12px; white-space: nowrap; }

/* 小游戏 */
.game-canvas { background: #0a0f1e; border-radius: 14px; box-shadow: var(--glow); touch-action: none; max-width: 100%; }
.dpad { display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; justify-content: center; margin-top: 14px; }
.dpad button { width: 52px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 17px; }
.dpad button:active { background: var(--blue); color: #fff; }
.g2048-board { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; background: #1a2540; padding: 9px; border-radius: 14px; margin-top: 14px; }
.g2048-cell { aspect-ratio: 1; border-radius: 9px; background: rgba(255,255,255,.05); display: grid; place-items: center; font-weight: 900; font-size: 20px; color: #fff; }

/* 指南针 */
.compass-wrap { width: 220px; height: 220px; margin: 20px auto; position: relative; border-radius: 50%; background: conic-gradient(from 0deg, #1a2540, #0a0f1e, #1a2540); box-shadow: var(--glow), inset 0 0 0 12px var(--surface); }
.compass-needle { position: absolute; inset: 22px; transition: transform .6s var(--ease); }
.compass-needle::before { content: ''; position: absolute; left: 50%; top: 0; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 88px solid #f43f5e; transform: translateX(-50%); }
.compass-needle::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 88px solid #94a3b8; transform: translateX(-50%); }
.compass-dir { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: var(--blue-hi); }

/* 便签 */
.note-area { width: 100%; min-height: 240px; border: 1px solid var(--border); outline: none; background: var(--surface); border-radius: 14px; padding: 16px; font-size: 14px; line-height: 1.9; color: var(--text); resize: none; }

.foot-note { text-align: center; font-size: 10px; color: var(--text3); padding: 16px 0 4px; line-height: 1.7; }

/* 移动端全屏 */
@media (max-width: 520px) {
  body { background: var(--bg); }
  .phone-frame { width: 100%; height: 100%; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-notch { display: none; }
  .screen { border-radius: 0; }
  .statusbar { padding-top: env(safe-area-inset-top, 8px); height: calc(var(--sb-h) + env(safe-area-inset-top, 0px)); }
  .tabbar { padding-bottom: env(safe-area-inset-bottom, 6px); height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-height: 900px) and (min-width: 521px) { .phone-frame { transform: scale(.92); } }
