* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #ececec; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; color: #333; font-size: 15px; }

#app { max-width: 430px; margin: 0 auto; min-height: 100%; background: #ececec; padding-bottom: env(safe-area-inset-bottom); }

.nav { display: none; align-items: center; justify-content: center; position: relative; height: 44px; padding-top: env(safe-area-inset-top); background: #ececec; }
.nav.show {
  display: flex;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 200;
  background: #ececec;
}
.nav.show.light {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 200;
  background: transparent;
}
.nav.light { background: transparent; color: #fff; }
.nav.light .nav-back {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-size: 22px;
  font-weight: 600;
}
.nav.light .nav-title { color: #fff; }
.nav-back {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  font-size: 20px;
  color: #007aff;
  line-height: 44px;
  z-index: 201;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-back.hidden { display: none; }
.nav-title { font-size: 17px; font-weight: 600; }

.page { padding: 10px 14px 20px; padding-top: calc(10px + env(safe-area-inset-top)); }
.view { display: none; }
.view.active { display: block; }

.card { background: #fff; border-radius: 12px; margin-bottom: 10px; }
.home-weather { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px; background: linear-gradient(120deg, #45b06a, #3d9fd4); color: #fff; }
.home-weather .weather-temp { font-size: 40px; font-weight: 300; }
.home-weather .weather-desc { font-size: 14px; margin-top: 6px; }
.home-weather .weather-icon { font-size: 44px; }

.row-2 { display: flex; gap: 10px; margin-bottom: 10px; }
.row-2 .card { flex: 1; margin-bottom: 0; }
.mini { padding: 14px; min-height: 96px; }
.mini.toolbox { background: linear-gradient(155deg, #f2c94c, #e8a020); }
.mini.calc-mini { background: linear-gradient(155deg, #8b93d8, #6b7fd6); color: #fff; }
.mini.calc-mini .mini-sub { color: rgba(255,255,255,0.85); }
.mini-icon { font-size: 26px; margin-bottom: 6px; }
.mini-name { font-size: 15px; font-weight: 500; }
.mini-sub { font-size: 11px; color: #999; margin-top: 3px; }
.mini.toolbox .mini-sub { color: rgba(0,0,0,0.45); }

.memo { padding: 14px 16px; }
.memo-head { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.memo-count { font-size: 12px; color: #999; font-weight: 400; }
.memo-preview { font-size: 14px; color: #666; line-height: 1.55; white-space: pre-line; }

.tools-row { display: flex; padding: 14px 4px; }
.tool-item { flex: 1; text-align: center; }
.tool-item:active { opacity: 0.55; }
.tool-icon { font-size: 30px; margin-bottom: 5px; }
.tool-name { font-size: 12px; color: #444; }

.about-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 15px; color: #007aff; font-size: 15px; }
.about-i { font-size: 17px; }

.weather-page { background: linear-gradient(180deg, #3a6ea5 0%, #2d4a6e 100%); margin: -10px -14px -20px; padding: calc(54px + env(safe-area-inset-top)) 14px 24px; min-height: 100vh; color: #fff; }
.weather-page.active { display: block; }

.wx-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wx-city { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 14px; }
.wx-actions { display: flex; gap: 8px; }
.wx-icon-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,0.2); color: #fff; font-size: 16px; }

.wx-main { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wx-temp { font-size: 56px; font-weight: 300; font-family: Georgia, "Times New Roman", serif; }
.wx-right { text-align: right; }
.wx-big-icon { font-size: 48px; }
.wx-sub { font-size: 13px; opacity: 0.9; margin-top: 4px; }

.wx-glass { background: rgba(255,255,255,0.12); border-radius: 14px; padding: 14px; margin-bottom: 14px; }

.wx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.wx-cell { background: rgba(255,255,255,0.12); border-radius: 12px; padding: 12px 8px; text-align: center; font-size: 11px; }
.wx-cell span { display: block; font-size: 18px; margin-bottom: 4px; }
.wx-cell b { display: block; opacity: 0.85; font-weight: 400; margin-bottom: 4px; }
.wx-cell i { font-style: normal; font-size: 14px; font-weight: 500; }

.wx-sunbar { display: flex; align-items: center; justify-content: space-between; }
.wx-sunbar small { display: block; font-size: 11px; opacity: 0.8; }
.wx-sunbar b { font-size: 16px; font-weight: 500; }
.wx-sunline { flex: 1; height: 3px; background: rgba(255,255,255,0.2); margin: 0 12px; border-radius: 2px; position: relative; }
.wx-sunline i { position: absolute; left: 35%; top: -4px; width: 10px; height: 10px; background: #fff; border-radius: 50%; }

.wx-sec-title { font-size: 14px; margin: 12px 0 8px; opacity: 0.95; }
.wx-sec-title.inner { margin-top: 0; }

.wx-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.wx-scroll::-webkit-scrollbar { display: none; }

.wx-day { flex: 0 0 72px; background: rgba(255,255,255,0.12); border-radius: 12px; padding: 10px 6px; text-align: center; font-size: 11px; }
.wx-day .d { opacity: 0.85; margin-bottom: 6px; }
.wx-day .i { font-size: 22px; margin: 4px 0; }
.wx-day .t { font-size: 10px; opacity: 0.8; }
.wx-day .h { font-size: 12px; margin-top: 4px; }
.wx-day .r { font-size: 10px; opacity: 0.7; margin-top: 4px; }
.wx-hour .wx-day { flex: 0 0 52px; }

.wx-life { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.wx-life-item { background: rgba(255,255,255,0.12); border-radius: 12px; padding: 12px; font-size: 12px; }
.wx-life-item .ic { font-size: 20px; margin-bottom: 4px; }
.wx-life-item .nm { font-weight: 500; margin-bottom: 2px; }
.wx-life-item .lv { color: #ffe082; margin-bottom: 4px; }
.wx-life-item .tx { opacity: 0.75; font-size: 11px; line-height: 1.4; }

.wx-air-top { display: flex; justify-content: space-between; align-items: center; }
.wx-air-top small { background: rgba(255,200,80,0.3); padding: 2px 8px; border-radius: 8px; }
.wx-air-num { font-size: 48px; font-weight: 300; text-align: right; margin: -30px 0 10px; font-family: Georgia, serif; color: #ffd54f; }
.wx-air-row { display: flex; justify-content: space-between; text-align: center; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 10px; }
.wx-air-row b { display: block; font-size: 16px; }
.wx-air-row i { font-style: normal; font-size: 11px; opacity: 0.7; }
.wx-tip p { font-size: 13px; line-height: 1.6; opacity: 0.9; }

.city-sheet { display: none; position: fixed; inset: 0; z-index: 1000; }
.city-sheet.on { display: block; }
.city-sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.city-sheet-body { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 16px 16px 0 0; padding: 16px; max-height: 50vh; overflow-y: auto; }
.city-sheet-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; text-align: center; }
.city-item { padding: 14px; border-bottom: 1px solid #eee; text-align: center; font-size: 15px; }
.city-item.on { color: #007aff; }

.native-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0; }
.native-card { background: #fff; border-radius: 14px; padding: 24px 16px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.native-icon { font-size: 36px; margin-bottom: 10px; }
.native-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.native-sub { font-size: 12px; color: #999; }

.tool-card { background: #fff; border-radius: 14px; padding: 18px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.tool-card-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; text-align: center; }
.slider-label { display: block; font-size: 14px; color: #666; margin: 12px 0 8px; }
.slider { width: 100%; accent-color: #007aff; }

.bmi-result-label { text-align: center; font-size: 13px; color: #999; margin-top: 20px; }
.bmi-num { text-align: center; font-size: 44px; font-weight: 600; color: #34c759; margin: 4px 0; }
.bmi-lv { text-align: center; font-size: 15px; color: #34c759; margin-bottom: 16px; }
.bmi-gauge svg { width: 100%; height: 100px; display: block; }

.loan-page { background: #8b93d8; margin: -10px -14px -20px; padding: calc(44px + env(safe-area-inset-top)) 14px 80px; min-height: 100vh; }
.loan-page.active { display: block; }
.loan-card { background: #fff; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.loan-h { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.loan-input { background: #f3f3f5; border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; }
.loan-input input { flex: 1; border: none; background: none; font-size: 18px; text-align: right; outline: none; }
.loan-input em { font-style: normal; color: #666; margin-left: 6px; font-size: 14px; }
.loan-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.loan-tags button { border: none; background: #f0f0f2; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: #666; }
.loan-tags button.on { background: #007aff; color: #fff; }
.loan-row2 { display: flex; gap: 10px; margin-bottom: 10px; }
.loan-mini { flex: 1; background: #fff; border-radius: 14px; padding: 14px; }
.loan-mini small { display: block; color: #999; font-size: 12px; margin-bottom: 6px; }
.loan-mini b { font-size: 20px; color: #007aff; }
.loan-note { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 12px; color: #999; }
.loan-note a { color: #007aff; margin-left: auto; text-decoration: none; }
.loan-mode { display: flex; gap: 8px; }
.loan-mode button { flex: 1; border: none; border-radius: 12px; padding: 12px 8px; background: #f0f0f2; text-align: left; font-size: 14px; }
.loan-mode button.on { background: linear-gradient(135deg, #7b6fd6, #5b7fd6); color: #fff; }
.loan-mode small { display: block; font-size: 11px; opacity: 0.85; margin-top: 4px; }
.loan-result-head { display: flex; justify-content: space-between; font-weight: 600; }
.loan-result-head em { font-style: normal; font-size: 12px; color: #999; font-weight: 400; }
.loan-result-card { background: linear-gradient(135deg, #7b6fd6, #5068c8); border-radius: 16px; padding: 18px; color: #fff; margin-bottom: 10px; text-align: center; }
.loan-month { font-size: 32px; font-weight: 600; font-family: Georgia, serif; margin: 8px 0 14px; }
.loan-sum-row { display: flex; border-top: 1px solid rgba(255,255,255,0.25); padding-top: 12px; }
.loan-sum-row div { flex: 1; }
.loan-sum-row small { display: block; font-size: 11px; opacity: 0.8; }
.loan-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.loan-tabs button { flex: 1; border: none; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.5); font-size: 14px; }
.loan-tabs button.on { background: #007aff; color: #fff; }
.loan-legend { display: flex; justify-content: center; gap: 20px; margin-top: 8px; font-size: 13px; }
.loan-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.loan-legend .c1 { background: #4caf50; }
.loan-legend .c2 { background: #ff9800; }
.loan-plan-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; }
.loan-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.loan-table th { background: #f5f5f5; padding: 8px 4px; font-weight: 500; color: #666; }
.loan-table td { padding: 8px 4px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.loan-bottom { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #fff; display: flex; border-top: 1px solid #e0e0e0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.loan-bottom button { flex: 1; border: none; background: none; font-size: 11px; color: #666; }
.loan-bottom span { display: block; font-size: 20px; margin-bottom: 2px; }

.base-table { background: #f5f5f5; border-radius: 10px; padding: 4px 0; margin: 16px 0; }
.base-table div { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid #ebebeb; font-size: 14px; }
.base-table div:last-child { border-bottom: none; }
.base-table span { color: #888; }
.base-chart-title { text-align: center; font-size: 12px; color: #999; margin-bottom: 8px; }

.about-top { text-align: center; padding: 28px 0 20px; }
.app-icon { width: 70px; height: 70px; margin: 0 auto 10px; border-radius: 15px; background: #34c759; position: relative; }
.app-icon::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); width: 26px; height: 34px; border: 4px solid #fff; border-top: none; border-radius: 0 0 13px 13px; }
.app-name { font-size: 19px; font-weight: 600; }
.app-ver { font-size: 13px; color: #999; }
.block { padding: 14px 16px; }
.block-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.block-text { font-size: 14px; color: #666; line-height: 1.65; }
.legal-meta { font-size: 12px; color: #999; margin-bottom: 10px; }
.legal-h { font-size: 14px; font-weight: 600; color: #333; margin: 14px 0 6px; }
.legal-h:first-child { margin-top: 0; }
.legal-ul { margin: 0 0 8px 18px; padding: 0; font-size: 14px; color: #666; line-height: 1.65; }
.legal-ul li { margin-bottom: 4px; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.feature-tag { padding: 4px 10px; border-radius: 999px; background: #f0f0f5; font-size: 12px; color: #555; }
.list-item { padding: 13px 16px; border-bottom: 1px solid #efefef; display: flex; justify-content: space-between; }
.arrow { color: #c7c7cc; }
.copyright { text-align: center; padding: 20px 0; font-size: 11px; color: #aaa; }
.field-label { font-size: 13px; color: #888; margin: 10px 0 5px; display: block; }
.input { width: 100%; height: 42px; border: 1px solid #ddd; border-radius: 8px; padding: 0 11px; font-size: 16px; background: #fafafa; outline: none; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input.flex { flex: 1; }
.btn { height: 42px; border: none; border-radius: 8px; background: #007aff; color: #fff; font-size: 15px; width: 100%; margin-top: 12px; }
.btn-gray { background: #e5e5ea; color: #333; }
.btn-sm { height: 42px; padding: 0 16px; border: none; border-radius: 8px; background: #007aff; color: #fff; font-size: 14px; }
.result { margin-top: 12px; padding: 11px; background: #f4f4f4; border-radius: 8px; font-size: 14px; word-break: break-all; }
.todo-list { list-style: none; margin-top: 10px; }
.todo-list li { display: flex; align-items: center; padding: 11px 0; border-bottom: 1px solid #f0f0f0; }
.todo-list li.done { color: #bbb; text-decoration: line-through; }
.todo-del { margin-left: auto; color: #ff3b30; border: none; background: none; font-size: 13px; }
.flash-panel { min-height: 70vh; display: flex; align-items: center; justify-content: center; background: #2c2c2c; border-radius: 12px; color: #888; }
.flash-panel.on { background: #fff; color: #ccc; }
.flash-overlay { display: none; position: fixed; inset: 0; background: #fff; z-index: 999; }
.flash-overlay.on { display: block; }
.scan-wrap { position: relative; aspect-ratio: 1; max-height: 280px; background: #111; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: rgba(0,200,80,0.8); }
.img-preview { margin: 12px 0; min-height: 120px; background: #f4f4f4; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.img-preview img { max-width: 100%; max-height: 200px; }
.img-placeholder { color: #aaa; }
.btn-row2 { display: flex; gap: 8px; margin-top: 12px; }
.btn-row2 .btn { flex: 1; margin-top: 0; }
.hidden { display: none !important; }
