/* 仅在宽度不超过600px时加载，电脑端继续使用原样式。 */
html { scroll-padding-top: 82px; }
body { font-size: 14px; }
body:has(.workspace) #app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
button, a, input, select, textarea { touch-action: manipulation; }
.btn, .btn.small { min-height: 44px; padding: 10px 14px; }
input:not([type=checkbox]), select, textarea { font-size: 16px; min-height: 48px; }
input, select, textarea { scroll-margin: 96px 0 130px; }
.check { min-height: 44px; }
.check input { flex-shrink: 0; }
.field-error:empty { display: none; }
.row { gap: 10px; }
.grid, .stack { gap: 16px; }
.grid.two,.grid.three { grid-template-columns: minmax(0,1fr); }
.grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.card { padding: 20px; border-radius: 20px; }
.card-header { gap: 10px; margin-bottom: 16px; }
h1 { font-size: 25px; line-height: 1.4; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.page-head { margin-bottom: 20px; gap: 14px; }
.page-head p { margin-top: 7px; font-size: 13px; line-height: 1.7; }
.page-head > .btn { width: 100%; }
.main { padding: 18px 16px 24px; }
.main > .notice { padding: 10px 12px; margin-bottom: 20px; font-size: 11px; line-height: 1.6; }
.sidebar,.sidebar.open { display: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  gap: 12px;
}
.topbar .menu-button, .topbar > .row:first-child > .muted { display: none; }
.topbar .row { gap: 8px; }
.topbar > .row:first-child { margin-right: 0; }
.mobile-page-brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--color-text); font-size: 19px; font-weight: 650; white-space: nowrap; }
.mobile-page-brand img { width: 32px; height: 32px; }
.mobile-page-brand.mobile-back { font-size: 15px; font-weight: 500; gap: 10px; }
.mobile-back .icon { transform: rotate(180deg); }
.topbar .btn.small { width: 44px; height: 44px; padding: 10px; }
.avatar-button { width: 44px; height: 44px; }
.user-dropdown { top: calc(100% + 8px); max-width: calc(100vw - 32px); }
.user-dropdown a,.user-dropdown button { min-height: 48px; }
.mobile-tabbar {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  position: fixed;
  z-index: 45;
  inset: auto 0 0;
  margin: 0;
  padding: 7px max(10px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));
  gap: 4px;
  overflow: visible;
  border-top: 1px solid var(--race-edge);
  background: var(--race-menu);
  box-shadow: 0 -5px 24px var(--race-shadow);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.mobile-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 5px 0;
  border-radius: 13px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-muted);
  transition: background 180ms ease, color 180ms ease;
}
.mobile-tabbar .icon { width: 22px; height: 22px; }
.mobile-tabbar a.active { background: var(--color-soft); color: var(--color-primary); font-weight: 600; }
.mobile-tabbar a::after { display: none; }
.mobile-tabbar a:active { transform: scale(.96); }
.mobile-keyboard-open .mobile-tabbar { display: none; }
.account-navigation { padding: 12px 8px; margin-bottom: 20px; border-radius: 18px; }
.account-navigation > p { display: none; }
.account-navigation nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; margin: 0; overflow: visible; }
.account-navigation nav a { display: flex; flex-direction: column; gap: 7px; justify-content: center; padding: 10px 0; min-width: 0; min-height: 65px; font-size: 11px; }
.account-navigation .icon { width: 21px; height: 21px; }
.account-navigation .nav-desktop-label { display: none; }
.nav-mobile-label { display: inline; }
.main:has(>.account-navigation) { display: flex; flex-direction: column; }
.main:has(>.account-navigation) > * { order: 3; }
.main:has(>.account-navigation) > .notice { order: 0; }
.main:has(>.account-navigation) > .page-head { order: 1; }
.main:has(>.account-navigation) > .account-navigation { order: 2; }
.grid.overview-stats { gap: 0; }
.overview-stats .card { padding: 18px 16px; }
.overview-stats .metric { font-size: 25px; margin: 10px 0 6px; }
.overview-stats .card > p { font-size: 12px; }
.overview-stats .card a { display: inline-flex; min-height: 44px; align-items: center; }
.overview-stats .metric small { font-size: 11px; }
.usage { gap: 18px; min-height: 0; align-items: center; }
.usage > div:last-child { flex: 1; min-width: 0; }
.usage .metric { font-size: 23px; letter-spacing: -.5px; }
.usage .metric small { font-size: 12px; }
.usage p,.usage small { font-size: 11px; }
.ring { width: 98px; height: 98px; flex-shrink: 0; }
.ring-inner { width: 84px; height: 84px; }
.ring-inner strong { font-size: 23px; }
.usage > div:last-child > .row { margin-top: 12px !important; }
.usage .row .btn { flex: 1; padding: 10px 8px; font-size: 11px; }
.subscription-card > .row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.subscription-card > .row .btn { min-width: 0; }
.subscription-card > .row .btn.primary { grid-column: 1/-1; min-height: 48px; }
.dashboard-main,.dashboard-secondary { margin-top: 16px; }
.section-title { margin: 24px 0 16px; }
.tabs { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding: 3px 2px; scrollbar-width: none; }
.tabs .btn { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; font-size: 12px; }
.segmented { width: 100%; }
.segmented .btn { min-height: 46px; }
.plan { gap: 14px; padding: 22px; }
.plan .price { font-size: 32px; }
.plan ul { gap: 9px; font-size: 13px; }
.plan .btn { min-height: 48px; }
.plan-periods { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.plan-periods .btn { flex: 0 0 auto; min-height: 40px; }
.list-row { gap: 12px; padding: 16px 0; }
.list-row > div:first-child { flex: 1; min-width: 0; }
.list-row .btn { flex-shrink: 0; }
.list-row h3 { overflow-wrap: anywhere; }
.card > .row > .btn { flex-grow: 1; }
.card > form > .btn.primary { width: 100%; min-height: 48px; }
.switch { min-height: 58px; }
.switch input { flex-shrink: 0; }
.table-wrap { padding: 0; overflow: visible; }
.card > .table-wrap { margin-top: 16px; }
.mobile-records { display: block; width: 100%; white-space: normal; }
.mobile-records thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); }
.mobile-records tbody { display: block; }
.mobile-records tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; padding: 20px; border-bottom: 1px solid var(--color-border); }
.mobile-records tbody tr:last-child { border-bottom: 0; }
.card > .table-wrap .mobile-records tbody tr { padding: 18px 0; }
.mobile-records td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 14px; }
.mobile-records td::before { content: attr(data-label); font-size: 11px; color: var(--color-muted); font-weight: 400; }
.mobile-records td:first-child { grid-column: 1/-1; font-weight: 550; }
.mobile-records td:first-child br { display: none; }
.mobile-records td[data-label="操作"] { grid-column: 1/-1; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.mobile-records td[data-label="操作"]::before { margin-right: auto; }
.mobile-records td[data-label="操作"] .btn { min-width: 74px; }
.mobile-records td[colspan] { grid-column: 1/-1; padding: 18px 0; font-weight: 400; }
.mobile-records td[colspan]::before { display: none; }
#app[data-page="/trafficlog"] .main > .grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
#app[data-page="/trafficlog"] .main > .grid.three .card { padding: 14px 10px; }
#app[data-page="/trafficlog"] .main > .grid.three .card p { font-size: 11px; }
#app[data-page="/trafficlog"] .main > .grid.three .metric { font-size: 22px; }
#app[data-page="/trafficlog"] .main > .grid.three .metric small { font-size: 10px; }
.spark { gap: 4px; height: 150px; }
.article { line-height: 1.9; }
.article ol { padding-left: 20px; }
.message { padding: 14px; overflow-wrap: anywhere; }
.modal-backdrop { align-items: end; padding: 16px 0 0; }
.modal { width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top,0px)); border-radius: 24px 24px 0 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom,0px)); overflow-y: auto; overscroll-behavior: contain; }
.modal .card-header { align-items: flex-start; }
.modal .card-header > .btn { flex-shrink: 0; }
.modal .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.modal .actions > .btn:only-child { grid-column: 1/-1; }
#toasts { top: auto; bottom: calc(82px + env(safe-area-inset-bottom,0px)); left: 16px; right: 16px; max-width: none; }
.toast { margin: 8px 0 0; font-size: 13px; }
.public-header { min-height: 64px; padding: calc(10px + env(safe-area-inset-top,0px)) 20px 10px; }
.public-header .brand { font-size: 21px; gap: 9px; }
.public-header .brand img { width: 36px; height: 36px; }
.public-header .btn { width: 44px; height: 44px; padding: 10px; }
.public-main, body:has(.auth) .public-main { padding: 16px 16px 28px; }
.auth { display: grid; grid-template-columns: minmax(0,1fr); min-height: 0; margin: 0; border-radius: 24px; }
.auth-visual { display: grid; grid-template-columns: minmax(0,1fr) 122px; align-items: center; padding: 10px 22px; min-height: 112px; border: 0; border-bottom: 1px solid var(--auth-edge); }
.auth-visual .eyebrow,.auth-visual > p { display: none; }
.auth-visual h2 { font-size: 19px; line-height: 1.6; letter-spacing: 0; }
.auth-visual img { width: 128px; max-width: none; margin: -4px -8px -4px 0; }
.auth-form { padding: 26px 22px 22px; }
.auth-form h1 { font-size: 27px; margin-bottom: 6px; }
.auth-form > p { font-size: 11px; }
.auth-form form { gap: 16px; margin-top: 24px; }
.auth-form input:not([type=checkbox]) { font-size: 16px; height: 50px; }
.auth-form .check { min-height: 40px; font-size: 11px; }
.auth-password .btn { top: 3px; right: 4px; min-height: 44px; min-width: 52px; }
.auth-code { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 7px; }
.auth-code .btn { padding: 10px; font-size: 12px; }
.auth-links { gap: 16px; margin-top: -4px; }
.auth-links .btn { min-height: 44px; }
.auth-form .notice { margin-bottom: 0; padding: 10px 12px; }
.hero { padding: 24px 20px; gap: 16px; }
.hero h1 { font-size: 32px; }
.hero .row { display: grid; grid-template-columns: 1fr 1fr; }
.hero .row .btn { padding: 10px 8px; }
.hero-art { width: 68%; max-width: 220px; }
footer { padding: 20px 16px 10px; font-size: 11px; }
.preview { position: static; margin: 12px 16px 24px; }
.preview details { max-width: none; padding: 12px 14px; box-shadow: none; background: transparent; }
.preview summary { min-height: 24px; font-size: 12px; text-align: center; }
.preview details[open] summary { margin-bottom: 10px; }
@media(max-width:359px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 16px; }
  .table-wrap { padding: 0; }
  .account-navigation nav a { font-size: 10px; }
  .auth-form { padding: 24px 18px 20px; }
  .auth-visual { grid-template-columns: minmax(0,1fr) 98px; padding-left: 18px; }
  .auth-visual img { width: 108px; }
  .auth-visual h2 { font-size: 17px; }
  .usage { gap: 12px; }
  .ring { width: 86px; height: 86px; }
  .ring-inner { width: 74px; height: 74px; }
  .usage .metric { font-size: 20px; }
  .mobile-records tbody tr { padding: 16px; }
}
