:root {
  --bg1: #eef7f3; --bg2: #fdf6ec; --card: #ffffff; --ink: #0f2e2b; --ink2: #5b7a76;
  --line: #e3efec; --primary: #0d9488; --amber: #d97706; --red: #dc2626; --green: #16a34a;
  --radius: 18px; --shadow: 0 6px 24px rgba(15,46,43,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif; background: linear-gradient(160deg, var(--bg1), var(--bg2)); color: var(--ink); min-height: 100%; }
a { color: var(--primary); }
.app { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 4px 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 34px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.brand-text h1 { font-size: 21px; letter-spacing: 1px; }
.brand-text p { font-size: 12px; color: var(--ink2); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.icon-btn:active { transform: scale(.92); }
.credits-chip { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 8px; background: rgba(255,255,255,.6); padding: 6px; border-radius: 14px; margin-bottom: 14px; border: 1px solid var(--line); }
.tab { flex: 1; border: none; background: transparent; padding: 10px 0; border-radius: 10px; font-size: 15px; color: var(--ink2); cursor: pointer; transition: all .2s; font-weight: 600; }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(13,148,136,.35); }
.tab-page { display: none; animation: fadeUp .25s ease; }
.tab-page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
.budget-bar .budget-text { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink2); margin-bottom: 10px; }
.budget-bar strong { color: var(--ink); font-size: 15px; }
.progress { height: 8px; background: #e8f1ef; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#14b8a6,#0d9488); border-radius: 99px; transition: width .5s ease; }
.progress-fill.over { background: linear-gradient(90deg,#f59e0b,#dc2626); }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 7px; font-weight: 600; }
.field-label i { font-weight: 400; font-size: 11px; color: #9bb8b3; font-style: normal; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px; color: var(--ink); background: #fbfdfc; outline: none; transition: border .2s, box-shadow .2s; font-family: inherit; resize: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.row { display: flex; gap: 12px; }
.row .grow { flex: 1; }
.money-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfdfc; overflow: hidden; }
.money-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.money-input .cny { padding-left: 14px; color: var(--ink2); font-weight: 700; }
.money-input input { border: none; box-shadow: none; background: transparent; }
.money-input input:focus { box-shadow: none; }
.primary-btn { width: 100%; border: none; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(135deg,#14b8a6,#0d9488); box-shadow: 0 6px 18px rgba(13,148,136,.35); transition: transform .15s, opacity .2s; }
.primary-btn:active { transform: scale(.98); }
.primary-btn:disabled { opacity: .6; cursor: default; }
.primary-btn.small { padding: 10px; font-size: 14px; border-radius: 12px; }
.ghost-btn { width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--ink2); padding: 10px; border-radius: 12px; font-size: 13px; cursor: pointer; margin-top: 6px; }
.result { animation: fadeUp .3s ease; }
.product-info { margin-bottom: 12px; padding: 10px 12px; background: #f0f7f5; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.product-info a { word-break: break-all; }
.product-info .price-tag { display: inline-block; margin-left: 8px; color: var(--red); font-weight: 700; }
.link-warn { margin-bottom: 12px; padding: 8px 12px; background: #fdf3e3; color: var(--amber); border-radius: 10px; font-size: 12px; }
.verdict { display: flex; align-items: center; gap: 14px; }
.verdict-emoji { font-size: 44px; }
.verdict-text { flex: 1; }
.verdict-text h2 { font-size: 24px; color: var(--vcolor); }
.verdict-text p { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.score-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--vcolor) calc(var(--p)*1%), #e8f1ef 0); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.score-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.score-ring strong { position: relative; font-size: 18px; color: var(--ink); }
.score-ring span { position: relative; font-size: 10px; color: var(--ink2); }
.summary { margin-top: 12px; padding: 10px 12px; background: #f4f9f8; border-radius: 10px; font-size: 14px; line-height: 1.6; }
.result h3 { font-size: 14px; margin-top: 14px; color: var(--ink); }
.reasons, .suggestions { list-style: none; margin-top: 8px; }
.reasons li, .suggestions li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.55; align-items: flex-start; }
.reasons li:last-child, .suggestions li:last-child { border-bottom: none; }
.reasons .fx { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.fx.plus { color: var(--green); background: #e8f7ee; }
.fx.minus { color: var(--red); background: #fdeaea; }
.result-meta { margin-top: 12px; font-size: 12px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 2px 9px; border-radius: 99px; background: #eef4f3; font-size: 11px; }
.tag.warn { background: #fdf3e3; color: var(--amber); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; text-align: center; padding: 16px 12px; }
.stat b { display: block; font-size: 20px; }
.stat.blue b { color: var(--primary); }
.stat.green b { color: var(--green); }
.stat.red b { color: var(--red); }
.stat span { font-size: 12px; color: var(--ink2); }
.history-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 18px; border: 1px solid var(--line); }
.history-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: none; }
.history-emoji { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.history-main { flex: 1; min-width: 0; }
.history-main h4 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-sub { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.history-right { text-align: right; flex-shrink: 0; }
.history-right b { font-size: 15px; }
.history-right span { display: block; font-size: 12px; margin-top: 2px; font-weight: 700; }
.history-empty { text-align: center; color: var(--ink2); padding: 40px 0; font-size: 14px; }
.footer { text-align: center; color: var(--ink2); font-size: 12px; margin-top: 24px; }
.banner { padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.banner.ok { background: #e8f7ee; color: #15803d; }
.banner.warn { background: #fdf3e3; color: #b45309; }
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.plan { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 10px; text-align: center; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.plan.hot { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.plan-name { font-weight: 700; font-size: 14px; }
.plan-credits { font-size: 18px; color: var(--primary); font-weight: 700; }
.plan-price { font-size: 20px; font-weight: 800; }
.plan-desc { font-size: 11px; color: var(--ink2); line-height: 1.4; }
.redeem-box { display: flex; gap: 8px; margin-top: 6px; }
.redeem-box input { flex: 1; }
.orders { margin-top: 6px; }
.order-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.order-item:last-child { border-bottom: none; }
.order-status { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.order-status.pending { background: #fdf3e3; color: var(--amber); }
.order-status.paid { background: #e8f7ee; color: var(--green); }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden, .hidden { display: none !important; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,46,43,.4); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: 100%; max-width: 560px; background: #fff; border-radius: 22px 22px 0 0; padding: 20px; max-height: 88vh; overflow-y: auto; animation: slideUp .25s ease; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; }
.modal-hint { font-size: 12px; color: var(--ink2); line-height: 1.6; margin-bottom: 14px; background: #f4f9f8; padding: 10px 12px; border-radius: 10px; }
.pay-amount { text-align: center; font-size: 34px; font-weight: 800; color: var(--ink); margin: 10px 0 4px; }
.pay-plan { text-align: center; color: var(--ink2); font-size: 14px; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(15,46,43,.92); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; z-index: 99; animation: fadeUp .2s ease; max-width: 86%; }
.disclaimer { margin-top: 10px; font-size: 11px; color: #9bb8b3; line-height: 1.5; }
.history-item { cursor: pointer; }
#detail-content h3 { font-size: 14px; margin-top: 12px; }
#detail-content .reasons, #detail-content .suggestions { list-style: none; margin-top: 8px; }
#detail-content .reasons li, #detail-content .suggestions li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.55; align-items: flex-start; }
#detail-content .reasons li:last-child, #detail-content .suggestions li:last-child { border-bottom: none; }
.account-btn { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; box-shadow: var(--shadow); max-width: 128px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qr-wrap { text-align: center; margin: 12px 0; }
.qr-img { width: 200px; height: 200px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; }
.qr-tip { font-size: 12px; color: var(--ink2); margin-top: 6px; }
.pay-note { margin: 12px 0 6px; padding: 12px; background: #eef7ff; border-radius: 10px; font-size: 14px; line-height: 1.6; }
.note-code { display: inline-block; margin-left: 4px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.login-hint { font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.login-switch { text-align: center; margin-top: 12px; font-size: 13px; color: var(--ink2); }
.login-switch a { color: var(--primary); cursor: pointer; }
.login-error { margin-top: 12px; padding: 10px 12px; background: #fdeaea; color: var(--red); border-radius: 10px; font-size: 13px; }
@media (max-width: 420px) { .plans { grid-template-columns: 1fr; } .row { flex-direction: column; gap: 0; } }
