:root {
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172d30;
  background: #f5f7f6;
  --ink: #172d30;
  --muted: #637572;
  --line: #dbe4e0;
  --green: #13775d;
  --deep: #112a2b;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #43987f; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .62; }
h1, h2, p { margin: 0; }
svg.icon { display: block; flex-shrink: 0; width: 20px; height: 20px; }
i[data-icon] { display: inline-flex; font-style: normal; flex-shrink: 0; }
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-pane { width: min(100%, 380px); }
.auth-card { padding: clamp(22px, 4vw, 32px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.auth-card h1 { margin-bottom: 24px; font-size: 26px; line-height: 1.25; }
.content h1 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.25; letter-spacing: -.035em; font-weight: 700; }
dialog p { color: var(--muted); line-height: 1.65; font-size: 14px; }
label { display: block; font-size: 13px; font-weight: 650; margin: 0 0 9px; }
input, select { min-width: 0; border: 1px solid #cbd8d1; border-radius: 9px; width: 100%; height: 47px; padding: 0 14px; color: var(--ink); background: #fff; font-size: 14px; }
input::placeholder { color: #73847e; }
input:read-only { background: #f2f5f1; color: #586a64; }
.input-wrap { display: flex; align-items: center; gap: 10px; border: 1px solid #cbd8d1; border-radius: 9px; padding: 0 12px; background: #fff; color: #6c8379; min-width: 0; }
.input-wrap:focus-within { border-color: #55a086; box-shadow: 0 0 0 3px #41936d20; }
.input-wrap>input { flex: 1; border: 0; outline: none; box-shadow: none; padding: 0; background: transparent; }
.input-wrap>input:focus-visible { outline: none; }
.input-wrap>i .icon { width: 17px; height: 17px; }
.input-wrap+.input-wrap, .input-wrap+label, dialog input+label, #direction-field { margin-top: 18px; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 7px; color: #587067; }
.icon-button:hover { background: #eaf1eb; color: #174b39; }
.icon-button .icon { width: 17px; height: 17px; }
.primary, .secondary, .danger { border-radius: 8px; padding: 11px 17px; min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 14px; font-weight: 650; transition: background-color .15s; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: #0c614c; }
.secondary { color: #344c42; background: #fff; border: 1px solid #ccd8cf; }
.secondary:hover { background: #f1f5f0; }
.danger { color: #fff; background: #a43f36; }
.danger:hover { background: #8c312a; }
.primary .icon, .secondary .icon { width: 17px; height: 17px; }
.auth-submit { width: 100%; position: relative; margin-top: 26px; min-height: 47px; }
.auth-submit i { position: absolute; right: 17px; }
.error { color: #ac3c33; font-size: 13px; line-height: 1.6; margin-top: 12px; }
.error:empty { display: none; }
.workspace { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 225px minmax(0,1fr); }
.sidebar { background: var(--deep); color: #d4e8df; display: flex; flex-direction: column; min-height: 100vh; height: 100dvh; position: sticky; top: 0; padding: 36px 18px 26px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav button { min-height: 46px; color: #bbd2c9; display: flex; gap: 12px; align-items: center; border-radius: 8px; padding: 0 15px; text-align: left; font-size: 14px; font-weight: 550; }
.sidebar nav button[aria-current="page"] { background: #295044; color: #cdffdc; }
.sidebar nav button:hover { background: #24463e; color: #e7fff0; }
.sidebar nav .icon { width: 18px; height: 18px; }
.app-body { min-width: 0; }
.topbar { min-height: 56px; border-bottom: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; padding: 0 clamp(21px,4vw,70px); gap: 12px; background: #fafbf9; }
.account { display: flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.account #account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar, .row-emblem { border-radius: 9px; width: 33px; height: 33px; background: #e4efe7; color: #327457; display: inline-grid; place-items: center; flex-shrink: 0; }
.avatar .icon { width: 16px; height: 16px; }.account .icon-button { margin-left: 4px; }
.content { max-width: 1220px; margin: 0 auto; padding: 32px clamp(21px,4vw,70px) 48px; }
.page-intro { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 29px; }
.page-intro h1 { outline: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel+.panel { margin-top: 20px; }
.query-panel { padding: 20px 25px 26px; }
.search-row { display: flex; gap: 10px; }.search-row>.input-wrap { flex: 1; }.search-row>.primary { min-width: 88px; }
.panel-title { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 13px 23px; border-bottom: 1px solid var(--line); }
.panel-title>i { color: #378067; }.panel-title h2 { font-size: 16px; }.refresh { margin-left: auto; }
.state { margin: 0; min-height: 180px; padding: 32px 20px; display: grid; place-content: center; text-align: center; justify-items: center; gap: 10px; }
.state>i { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; color: #5c8973; background: #eff5f0; }
.state strong { font-size: 14px; color: #476457; }.state p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.state.failed>i { color: #9a4b3d; background: #f7eeea; }
.query-output { padding: 24px; line-height: 1.9; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-address { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 11px; padding: 12px 23px; background: #f4f8f4; color: #536a5d; font-size: 12px; }
.result-address code { font-family: var(--mono); overflow-wrap: anywhere; }
a { color: #117257; text-underline-offset: 3px; }
.rows { padding: 0 20px; }.item-row { padding: 15px 3px; display: flex; align-items: center; gap: 12px; }
.item-row+.item-row { border-top: 1px solid #e6ece8; }.row-emblem { width: 37px; height: 37px; border-radius: 10px; }
.row-emblem .icon { width: 18px; height: 18px; }.row-body { flex: 1; min-width: 0; }
.row-title, .row-sub { overflow-wrap: anywhere; display: block; }.row-title { font-size: 14px; font-weight: 650; }
.row-sub, .row-body time { display: block; font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 3px; }
.mono { font-family: var(--mono); }.tag { font-size: 11px; border-radius: 5px; background: #edf2ef; padding: 4px 7px; color: #52665b; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.row-actions .icon-button { width: 34px; height: 34px; }.row-actions .remove:hover { color: #9b3e33; background: #f7ede9; }
.amount { font: 650 14px/1.5 var(--mono); overflow-wrap: anywhere; }.incoming { color: #16724f; }.outgoing { color: #925536; }
.activity-row { align-items: flex-start; }.activity-row a { display: inline-block; font-size: 12px; }
.watch-actions { display: flex; align-items: center; gap: 8px; }
.watch-list { display: grid; gap: 18px; }
.watch-list>.panel+.panel { margin: 0; }
.watch-list>.state { background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.watch-head { padding: 17px 21px; background: #f8faf8; border-bottom: 1px solid var(--line); }
.watch-head h2 { margin: 0; }
.watch-record-title { margin: 16px 23px 0; font-size: 13px; color: #476457; }
.watch-empty { margin: 15px 3px 19px; color: var(--muted); font-size: 13px; }
.watch-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 11px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.watch-pager label { display: flex; align-items: center; gap: 7px; margin: 0 auto 0 0; font-size: 12px; font-weight: 500; }
.watch-pager select { width: auto; height: 35px; padding: 0 6px; font-size: 12px; }
.watch-pager button { min-height: 35px; padding: 6px 10px; font-size: 12px; }
.watch-pager button:disabled { opacity: .55; cursor: default; }
.watch-error { margin: 0 22px 12px; }
.watch-archive { margin-top: 24px; }
.watch-archive>summary { cursor: pointer; padding: 8px 2px; font-size: 14px; font-weight: 650; color: #476457; }
.watch-archive>summary:focus-visible { outline: 3px solid #43987f; outline-offset: 2px; }
.watch-archive[open]>summary { margin-bottom: 8px; }
.more-wrap:has([hidden]) { display: none; }.more-wrap { text-align: center; padding: 8px 15px 19px; }
dialog { width: min(430px,calc(100% - 32px)); max-height: 90dvh; overflow-y: auto; border: 1px solid #d2ded6; border-radius: 15px; padding: 25px; color: var(--ink); box-shadow: 0 22px 80px #0e2f292f; }
dialog::backdrop { background: #0a252472; }.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dialog-head h2 { font-size: 21px; letter-spacing: -.025em; }.dialog-head .icon-button { margin-right: -5px; }
dialog label small { color: #74857c; font-size: 11px; font-weight: 400; margin-left: 4px; }.field-hint { font-size: 12px; margin: 9px 0 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
dialog code { display: block; margin-top: 12px; padding: 10px; background: #f0f4ef; border-radius: 6px; overflow-wrap: anywhere; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: 90vw; border-radius: 8px; background: #163c30; color: white; font-size: 13px; line-height: 1.5; padding: 10px 16px; box-shadow: 0 4px 20px #0e352225; }
#toast:empty { display: none; }
.energy-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(215px,1fr); align-items: start; gap: 18px; }
.energy-layout>.panel+.panel { margin-top: 0; }
.energy-simulation { margin: 0 0 15px; padding: 10px 15px; border-left: 3px solid #33896b; color: #1b624c; font-size: 14px; font-weight: 650; background: #e2f2e9; }
.energy-fields, .energy-balance { padding: 22px; }
.energy-fields { display: grid; gap: 19px; }
.energy-fields .error { margin: 0; }.energy-fields>.primary { justify-self: end; }
.energy-quote { background: #eff6ef; border: 1px solid #d8e6d9; border-radius: 9px; padding: 16px 18px; }
.energy-quote-head, .energy-meta, .energy-notice, .energy-order summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.energy-quote-head { font-size: 13px; font-weight: 650; }.energy-inline { color: var(--green); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.energy-price { margin: 7px 0 11px; color: #245940; font: 600 13px var(--mono); overflow-wrap: anywhere; }.energy-price strong { font-size: 31px; }
.energy-meta { flex-wrap: wrap; color: #586e60; font-size: 12px; }.energy-meta b { font-weight: 550; }
.energy-balance { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 18px 10px; margin: 0; }
.energy-balance dt { color: #576d61; font-size: 13px; }.energy-balance dd { color: #224f3b; text-align: right; margin: 0; font: 600 21px var(--mono); overflow-wrap: anywhere; }
.energy-balance-panel>p { margin: 0 22px 20px; color: var(--muted); }
.field-hint:empty, #energy-dialog-hint:empty { display: none; }
.energy-history { margin-top: 20px; }.energy-history>.error { margin: 12px 20px; }
.energy-notice { padding: 13px 16px; border: 1px solid #e7d7b5; border-radius: 8px; background: #fbf5e9; color: #704f22; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
#view-energy>.energy-notice { margin-bottom: 15px; }.energy-notice button { flex: none; min-height: 36px; padding: 6px 10px; }
.energy-order { border-bottom: 1px solid var(--line); padding: 0 20px; }.energy-order:last-child { border-bottom: 0; }
.energy-order summary { padding: 16px 0; cursor: pointer; list-style: none; }.energy-order summary::-webkit-details-marker { display: none; }
.energy-order summary::after { content: '⌄'; color: var(--green); }.energy-order[open] summary::after { transform: rotate(180deg); }
.energy-order summary>span:first-child { flex: 1; min-width: 0; }.energy-order .tag[data-alert] { color: #7a4825; background: #fbeddc; }
.energy-order-body { padding-bottom: 18px; }.energy-order-body p { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 9px 0; overflow-wrap: anywhere; }
.energy-facts { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 16px; margin: 0 0 15px; padding: 13px; border-radius: 8px; background: #f4f7f3; font-size: 13px; }
.energy-facts:empty { display: none; }.energy-facts dt { color: var(--muted); }.energy-facts dd { margin: 0; overflow-wrap: anywhere; }
.energy-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }.energy-actions button { padding: 7px 11px; min-height: 35px; font-size: 12px; }
#energy-sn-field, #energy-note-field, .energy-check { margin-top: 18px; }.energy-check { display: flex; align-items: center; gap: 8px; }.energy-check input { flex: none; width: 16px; height: 16px; }
#energy-dialog:modal, #energy-dialog::backdrop { overscroll-behavior: contain; }#energy-dialog::backdrop { overflow: hidden; }
@media (max-width:820px) { .energy-layout { grid-template-columns: minmax(0,1fr); }.energy-balance { padding: 15px 22px; gap: 10px; } }
@media (max-width:540px) { .sidebar nav button i { display: none; }.energy-fields { padding: 16px; }.energy-notice { align-items: flex-start; flex-wrap: wrap; } }
@media (max-width:900px) {
  .workspace { grid-template-columns: 175px minmax(0,1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
}
@media (max-width:700px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; min-height: 0; padding: 8px 12px; }
  .sidebar nav { grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 2px; }.sidebar nav button { min-height: 40px; justify-content: center; gap: 4px; padding: 0 2px; font-size: 13px; white-space: nowrap; }.sidebar nav .icon { width: 15px; height: 15px; }.topbar { min-height: 44px; padding: 0 20px; }.account .avatar { display:none; }
  .content { padding: 29px 16px 40px; }.content h1 { font-size: 28px; }.page-intro { flex-wrap: wrap; gap: 14px; margin-bottom: 21px; }
  .panel-title { padding: 12px 16px; min-height: 55px; }.query-panel { padding: 16px; }.search-row { flex-wrap: wrap; }.search-row>.input-wrap { flex: 1 1 210px; }.search-row>.primary { flex: 1 0 70px; }.query-output { padding: 17px; }.rows { padding: 0 12px; }.item-row { flex-wrap: wrap; gap: 7px; }.row-emblem { width: 29px; height: 29px; }.row-body { flex-basis: 50%; }.amount { flex-basis: 100%; padding-left: 36px; }.row-actions .icon-button { width: 31px; }.item-row .tag { font-size: 10px; }
}
@media (max-width:360px) { .sidebar nav button { padding: 0 2px; font-size: 12px; }.sidebar nav .icon { display: none; } }
@media (max-width:700px) {
  .watch-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; padding: 12px 14px; }
  .watch-head>.tag { grid-column: 2; justify-self: start; }
  .watch-head>.row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .watch-record-title { margin: 13px 15px 0; }
  .watch-pager { padding: 9px 12px; gap: 6px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }
