:root {
  --ink: #1d2a3b;
  --muted: #78869a;
  --line: #dbe7f5;
  --blue: #2f82f3;
  --green: #48c98b;
  --red: #ee6b68;
  --surface: rgba(255, 255, 255, 0.84);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(147, 212, 255, 0.3), transparent 29rem),
    radial-gradient(circle at 4% 90%, rgba(115, 183, 255, 0.18), transparent 27rem),
    linear-gradient(146deg, #f9fcff 0%, #eff6ff 47%, #f8fbff 100%);
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.34;
  background-image: linear-gradient(rgba(80, 137, 210, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(80, 137, 210, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.dashboard-shell {
  width: min(1510px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 28px;
  animation: reveal 560ms ease both;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 10px 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #5793d7;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  color: #17263a;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.05em;
}

.subtitle {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-tabs {
  display: inline-flex;
  gap: 3px;
  margin-top: 17px;
  padding: 3px;
  border: 1px solid rgba(181, 201, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.page-tab {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 6px;
  color: #61748a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.page-tab:hover {
  background: #f0f7ff;
  color: #216dc2;
}

.page-tab.is-active {
  background: #2f82f3;
  color: #fff;
}

.live-status {
  display: grid;
  grid-template-columns: 10px auto;
  align-items: center;
  column-gap: 9px;
  min-width: 202px;
  padding: 12px 16px;
  border: 1px solid rgba(171, 197, 226, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 22px rgba(48, 91, 148, 0.08);
  color: #4e627d;
  font-size: 13px;
}

.status-orb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aab7c6;
  box-shadow: 0 0 0 4px rgba(170, 183, 198, 0.16);
}

.live-status.is-live .status-orb {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(72, 201, 139, 0.15), 0 0 14px rgba(72, 201, 139, 0.8);
  animation: pulse 1.8s ease-in-out infinite;
}

.live-status.is-partial .status-orb {
  background: #ecb55a;
  box-shadow: 0 0 0 4px rgba(236, 181, 90, 0.14);
}

.live-status time {
  grid-column: 2;
  margin-top: 3px;
  color: #93a0b1;
  font-size: 11px;
}

.scene-panel {
  overflow: hidden;
  border: 1px solid rgba(194, 215, 239, 0.86);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 18px 58px rgba(55, 94, 143, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.energy-scene {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.scene-background {
  fill: url(#sceneWash);
  fill: #fafdff;
}

.isometric-grid {
  opacity: 0.86;
}

.center-halo {
  fill: rgba(131, 191, 255, 0.12);
  stroke: rgba(93, 161, 235, 0.17);
  stroke-width: 2;
}

.energy-rail {
  fill: none;
  stroke: #d2deed;
  stroke-width: 4;
  stroke-linecap: round;
}

.energy-flow {
  --flow-color: #9aaabd;
  --flow-duration: 1.6s;
  fill: none;
  stroke: var(--flow-color);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 5 17;
  opacity: 0;
  filter: drop-shadow(0 0 5px var(--flow-color));
}

.energy-flow.flow-active {
  opacity: 1;
}

.energy-flow.flow-forward {
  animation: stream-forward var(--flow-duration) linear infinite;
}

.energy-flow.flow-reverse {
  animation: stream-reverse var(--flow-duration) linear infinite;
}

.node-title,
.hub-title {
  fill: #566477;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hub-title {
  fill: #33455d;
  font-size: 27px;
}

.hub-subtitle {
  fill: #7d8ca0;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.node-dot {
  stroke: #fff;
  stroke-width: 2;
}

.node-dot.green,
.legend-green {
  fill: var(--green);
}

.node-dot.blue {
  fill: #70b3f8;
}

.node-dot.red,
.legend-red {
  fill: var(--red);
}

.metric-card rect,
.legend rect {
  fill: rgba(255, 255, 255, 0.79);
  stroke: rgba(179, 202, 229, 0.92);
  stroke-width: 1.3;
}

.metric-kicker {
  fill: #77869a;
  font-size: 13px;
  font-weight: 600;
}

.metric-value {
  fill: #26384e;
  font-size: 20px;
  font-weight: 750;
}

.metric-daily-divider {
  stroke: rgba(218, 194, 176, 0.88);
  stroke-width: 1;
}

.metric-daily-kicker {
  fill: #8c7565;
  font-size: 12px;
  font-weight: 700;
}

.metric-daily-value {
  fill: #26384e;
  font-size: 19px;
  font-weight: 750;
}

.storage-yesterday-label {
  fill: #8c7565;
  font-size: 11px;
  font-weight: 700;
}

.storage-today-label {
  fill: #62748b;
  font-size: 11px;
  font-weight: 700;
}

.storage-yesterday-value {
  fill: #26384e;
  font-size: 16px;
  font-weight: 750;
}

.storage-today-value {
  fill: #26384e;
  font-size: 16px;
  font-weight: 750;
}

.pv-details-object {
  overflow: visible;
}

.pv-details-card {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 13px 16px 11px;
  overflow: hidden;
  border: 1.3px solid rgba(179, 202, 229, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: #26384e;
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.pv-details-label,
.pv-inverter-heading {
  color: #77869a;
  font-size: 12px;
  font-weight: 600;
}

.pv-daily-energy {
  margin-top: 2px;
  color: #26384e;
  font-size: 21px;
  font-weight: 750;
  line-height: 1.2;
}

.pv-inverter-heading {
  margin-top: 10px;
}

.pv-inverter-list {
  max-height: 72px;
  margin-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.pv-inverter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
  color: #50647c;
  font-size: 12px;
  line-height: 1.55;
}

.pv-inverter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-inverter-energy {
  flex: 0 0 auto;
  color: #26384e;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.pv-inverter-empty {
  color: #93a0b1;
  font-size: 12px;
  line-height: 1.7;
}

.grid-daily-details-object {
  overflow: visible;
}

.grid-daily-details-card {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 12px 15px 10px;
  overflow: hidden;
  border: 1.3px solid rgba(177, 199, 229, 0.92);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(250, 253, 255, 0.95), rgba(255, 255, 255, 0.86));
  color: #26384e;
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.grid-daily-heading {
  color: #62748b;
  font-size: 12px;
  font-weight: 700;
}

.grid-daily-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.grid-daily-value {
  min-width: 0;
  padding-left: 9px;
  border-left: 3px solid #a9b8ca;
}

.grid-daily-value.import {
  border-left-color: var(--red);
}

.grid-daily-value.export {
  border-left-color: var(--green);
}

.grid-daily-value span,
.grid-daily-note {
  display: block;
  color: #77869a;
  font-size: 11px;
  font-weight: 600;
}

.grid-daily-value strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #26384e;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-daily-note {
  margin-top: 7px;
  color: #91a0b0;
  font-size: 10px;
}

.metric-sub,
.metric-soc {
  fill: #50647c;
  font-size: 16px;
  font-weight: 600;
}

.legend text {
  fill: #6b7a8e;
  font-size: 12px;
  font-weight: 600;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 12px 0;
  color: #8491a1;
  font-size: 12px;
}

.daily-energy-panel {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(173, 199, 228, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 42px rgba(55, 94, 143, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.daily-energy-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 28px;
  animation: reveal 560ms ease both;
}

.strategy-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 28px;
  animation: reveal 560ms ease both;
}

.strategy-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 10px 2px;
}

.strategy-page .strategy-panel {
  margin-top: 20px;
}

.daily-energy-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 10px 2px;
}

.daily-energy-page .daily-energy-panel {
  margin-top: 20px;
}

.daily-energy-window {
  flex: 0 0 auto;
  min-width: 148px;
  padding: 12px 14px;
  border: 1px solid rgba(171, 197, 226, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #536981;
  font-size: 12px;
}

.daily-energy-window span,
.daily-energy-window strong {
  display: block;
}

.daily-energy-window span {
  color: #8594a6;
  font-size: 11px;
}

.daily-energy-window strong {
  margin-top: 3px;
  color: #2b445f;
  font-size: 15px;
}

.daily-energy-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.daily-energy-eyebrow {
  margin: 0 0 6px;
  color: #388671;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.daily-energy-panel h2 {
  margin: 0;
  color: #1d2e45;
  font-size: 22px;
  letter-spacing: 0;
}

.daily-energy-panel-copy {
  margin: 7px 0 0;
  color: #718198;
  font-size: 13px;
  line-height: 1.65;
}

.daily-energy-query-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 20px;
}

.daily-energy-date-field {
  display: grid;
  gap: 7px;
  min-width: 170px;
  color: #526780;
  font-size: 12px;
  font-weight: 700;
}

.daily-energy-date-field input {
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid #b9cbe0;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #23364e;
  font: inherit;
}

.daily-energy-date-field input:focus {
  border-color: #3b87df;
  box-shadow: 0 0 0 3px rgba(47, 130, 243, 0.16);
}

.daily-energy-query-button {
  min-width: 86px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #2776c9;
  border-radius: 6px;
  background: #2f82f3;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.daily-energy-query-button:hover:not(:disabled) {
  background: #206fda;
}

.daily-energy-recent-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #b9cbe0;
  border-radius: 6px;
  background: #fff;
  color: #3d668e;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.daily-energy-recent-button:hover:not(:disabled) {
  border-color: #82addb;
  background: #f4f9ff;
}

.daily-energy-query-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.daily-energy-query-state,
.daily-energy-empty-state {
  min-height: 18px;
  margin: 14px 0 0;
  color: #718198;
  font-size: 12px;
  line-height: 1.5;
}

.daily-energy-query-state.is-loading {
  color: #467ba5;
}

.daily-energy-query-state.is-error,
.daily-energy-empty-state.is-error {
  color: #a04734;
}

.daily-energy-empty-state {
  padding: 10px 12px;
  border: 1px dashed #c5d4e6;
  border-radius: 6px;
  background: #f8fbff;
}

.daily-energy-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid #d5e1ef;
  border-radius: 6px;
  background: #fff;
}

.daily-energy-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  color: #31455e;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.daily-energy-table th,
.daily-energy-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e1eaf4;
  text-align: right;
  white-space: nowrap;
}

.daily-energy-table th {
  color: #60748b;
  background: #f7faff;
  font-size: 11px;
  font-weight: 750;
}

.daily-energy-table th:first-child,
.daily-energy-table td:first-child,
.daily-energy-table th:last-child,
.daily-energy-table td:last-child {
  text-align: left;
}

.daily-energy-table tbody tr:last-child td {
  border-bottom: 0;
}

.daily-energy-table tbody tr:hover {
  background: #f9fcff;
}

.daily-energy-total-row td {
  border-top: 2px solid #b9cfe6;
  border-bottom: 0;
  background: #f1f7fd;
  color: #203b59;
  font-weight: 750;
}

.daily-energy-total-row:hover td {
  background: #f1f7fd;
}

.daily-energy-total-label {
  color: #173a60;
}

.daily-energy-date-cell {
  color: #243b55;
  font-weight: 700;
}

.daily-energy-accounting-column {
  color: #718198;
}

.daily-energy-status {
  display: inline-flex;
  align-items: center;
  min-width: 54px;
  min-height: 24px;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid #c5d4e6;
  border-radius: 999px;
  background: #f5f8fb;
  color: #60748b;
  font-size: 11px;
  font-weight: 700;
}

.daily-energy-status.is-complete {
  border-color: #8bd0b2;
  background: #effaf4;
  color: #187550;
}

.daily-energy-status.is-in-progress {
  border-color: #9cc7ed;
  background: #eef7ff;
  color: #246da8;
}

.daily-energy-status.is-awaiting {
  border-color: #e5c378;
  background: #fff9e9;
  color: #8b6822;
}

.daily-energy-status.is-verification,
.daily-energy-status.is-incomplete {
  border-color: #e6b09c;
  background: #fff2ed;
  color: #a04734;
}

.strategy-panel {
  margin-top: 22px;
  padding: 25px;
  border: 1px solid rgba(173, 199, 228, 0.9);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 198, 255, 0.18), transparent 24rem),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 15px 46px rgba(55, 94, 143, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.strategy-panel-header,
.strategy-toolbar,
.strategy-meta-row,
.strategy-dialog-heading,
.strategy-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.strategy-panel-header {
  align-items: flex-start;
}

.strategy-eyebrow {
  margin: 0 0 6px;
  color: #5793d7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.strategy-panel h2,
.strategy-dialog h2 {
  margin: 0;
  color: #1d2e45;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.strategy-panel-copy,
.strategy-dialog-copy {
  margin: 7px 0 0;
  color: #718198;
  font-size: 13px;
  line-height: 1.65;
}

.strategy-availability {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 29px;
  padding: 4px 10px;
  border: 1px solid #b7c6d8;
  border-radius: 999px;
  background: #f5f8fb;
  color: #61738b;
  font-size: 12px;
  font-weight: 700;
}

.strategy-availability.is-ready {
  border-color: rgba(58, 173, 118, 0.38);
  background: rgba(72, 201, 139, 0.12);
  color: #257b55;
}

.strategy-availability.is-disabled,
.strategy-availability.is-error {
  border-color: rgba(220, 138, 99, 0.42);
  background: rgba(255, 242, 235, 0.9);
  color: #a5532a;
}

.strategy-availability.is-loading {
  border-color: rgba(104, 148, 197, 0.34);
  background: rgba(237, 246, 255, 0.9);
  color: #527da9;
}

.strategy-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-top: 21px;
}

.strategy-status-item {
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(190, 210, 233, 0.8);
  border-radius: 14px;
  background: rgba(250, 253, 255, 0.75);
}

.strategy-status-item dt,
.strategy-preview-grid dt {
  color: #8190a3;
  font-size: 11px;
  font-weight: 650;
}

.strategy-status-item dd,
.strategy-preview-grid dd {
  min-width: 0;
  margin: 5px 0 0;
  overflow: hidden;
  color: #2d4059;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-demand-verification {
  margin-top: 11px;
  padding: 14px;
  border: 1px solid rgba(190, 210, 233, 0.8);
  border-radius: 14px;
  background: rgba(250, 253, 255, 0.75);
}

.strategy-demand-verification.has-error {
  border-color: rgba(208, 110, 88, 0.52);
  background: rgba(255, 246, 243, 0.9);
}

.strategy-demand-verification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.strategy-demand-verification-heading .strategy-eyebrow {
  margin-bottom: 3px;
}

.strategy-demand-verification h3 {
  margin: 0;
  color: #334861;
  font-size: 14px;
}

.strategy-verification-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #b7c6d8;
  border-radius: 999px;
  background: #f5f8fb;
  color: #61738b;
  font-size: 11px;
  font-weight: 700;
}

.strategy-verification-status.is-success {
  border-color: rgba(58, 173, 118, 0.38);
  background: rgba(72, 201, 139, 0.12);
  color: #257b55;
}

.strategy-verification-status.is-error {
  border-color: rgba(220, 110, 88, 0.48);
  background: rgba(255, 232, 224, 0.95);
  color: #a44328;
}

.strategy-verification-status.is-pending {
  border-color: rgba(104, 148, 197, 0.34);
  background: rgba(237, 246, 255, 0.9);
  color: #527da9;
}

.strategy-verification-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.strategy-verification-grid > div {
  min-width: 0;
}

.strategy-verification-grid dt {
  color: #8190a3;
  font-size: 11px;
  font-weight: 650;
}

.strategy-verification-grid dd {
  min-width: 0;
  margin: 4px 0 0;
  overflow: hidden;
  color: #2d4059;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-verification-message {
  margin: 10px 0 0;
  color: #718198;
  font-size: 12px;
  line-height: 1.55;
}

.strategy-demand-verification.has-error .strategy-verification-message {
  color: #a44328;
}

.strategy-meta-row {
  align-items: flex-start;
  margin-top: 10px;
}

.strategy-meta,
.strategy-auth-state,
.strategy-notice {
  margin: 0;
  color: #78889a;
  font-size: 12px;
  line-height: 1.55;
}

.strategy-meta + .strategy-meta {
  text-align: right;
}

.strategy-toolbar {
  flex-wrap: wrap;
  margin-top: 19px;
  padding-top: 18px;
  border-top: 1px solid rgba(201, 218, 236, 0.8);
}

.strategy-auth-actions,
.strategy-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.strategy-auth-state {
  max-width: 420px;
  text-align: right;
}

.strategy-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.strategy-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.strategy-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.strategy-button-primary {
  border-color: #2779d7;
  background: linear-gradient(145deg, #398df2, #2c73d1);
  box-shadow: 0 7px 16px rgba(47, 130, 243, 0.22);
  color: #fff;
}

.strategy-button-primary:hover:not(:disabled) {
  box-shadow: 0 10px 20px rgba(47, 130, 243, 0.3);
}

.strategy-button-secondary {
  border-color: #becde0;
  background: rgba(255, 255, 255, 0.82);
  color: #53677e;
}

.strategy-button-secondary:hover:not(:disabled) {
  border-color: #8eafd4;
  background: #f7fbff;
}

.strategy-button-danger {
  border-color: #c35752;
  background: linear-gradient(145deg, #d96560, #b84d4a);
  box-shadow: 0 7px 16px rgba(193, 77, 74, 0.2);
  color: #fff;
}

.strategy-button-danger:hover:not(:disabled) {
  box-shadow: 0 10px 21px rgba(193, 77, 74, 0.28);
}

.strategy-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.strategy-option-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(189, 210, 234, 0.86);
  border-radius: 15px;
  background: rgba(250, 253, 255, 0.76);
}

.strategy-option-card.sunny {
  border-color: rgba(233, 180, 80, 0.42);
  background: linear-gradient(145deg, rgba(255, 250, 235, 0.88), rgba(255, 255, 255, 0.84));
}

.strategy-option-card.cloudy {
  border-color: rgba(101, 149, 206, 0.4);
  background: linear-gradient(145deg, rgba(239, 247, 255, 0.88), rgba(255, 255, 255, 0.84));
}

.strategy-option-card h3,
.strategy-plan-preview h3 {
  margin: 0;
  color: #334861;
  font-size: 15px;
}

.strategy-option-card p {
  margin: 5px 0 0;
  color: #748499;
  font-size: 12px;
  line-height: 1.55;
}

.strategy-preview-button {
  flex: 0 0 auto;
  border-color: #b5c9df;
  background: rgba(255, 255, 255, 0.88);
  color: #3f617f;
}

.strategy-preview-button:hover:not(:disabled) {
  border-color: #4386c9;
  background: #fff;
  box-shadow: 0 7px 15px rgba(79, 125, 177, 0.13);
}

.strategy-notice {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(236, 245, 255, 0.72);
  color: #52708d;
}

.strategy-notice.is-error {
  background: rgba(255, 239, 235, 0.9);
  color: #a04d32;
}

.strategy-notice.is-success {
  background: rgba(231, 250, 241, 0.88);
  color: #237350;
}

.strategy-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  margin: auto;
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(168, 194, 224, 0.95);
  border-radius: 19px;
  background: #fbfdff;
  box-shadow: 0 24px 76px rgba(22, 46, 78, 0.32);
  color: var(--ink);
}

.strategy-dialog::backdrop {
  background: rgba(22, 42, 68, 0.45);
  backdrop-filter: blur(2px);
}

.strategy-dialog-form {
  padding: 23px;
}

.strategy-dialog-heading {
  align-items: flex-start;
}

.strategy-dialog-dismiss {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid #c6d5e6;
  border-radius: 8px;
  background: #fff;
  color: #60748b;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.strategy-dialog-dismiss:hover {
  border-color: #91b2d7;
  background: #f5faff;
}

.strategy-password-field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  color: #526780;
  font-size: 13px;
  font-weight: 700;
}

.strategy-password-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #b9cbe0;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #23364e;
  font: inherit;
}

.strategy-password-field input:focus {
  border-color: #3b87df;
  box-shadow: 0 0 0 3px rgba(47, 130, 243, 0.16);
}

.strategy-form-error {
  margin: 13px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fff0ec;
  color: #a04734;
  font-size: 12px;
  line-height: 1.5;
}

.strategy-dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.strategy-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0 0;
}

.strategy-preview-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(194, 212, 233, 0.9);
  border-radius: 11px;
  background: #f7fbff;
}

.strategy-preview-grid dd {
  font-size: 14px;
}

.strategy-plan-preview {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid rgba(190, 210, 233, 0.92);
  border-radius: 12px;
  background: rgba(247, 251, 255, 0.86);
}

.strategy-plan-preview ol {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.strategy-plan-preview li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(205, 219, 235, 0.74);
  color: #526780;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-plan-preview li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.strategy-plan-preview li span:last-child {
  flex: 0 0 auto;
  color: #2d4059;
  font-weight: 750;
  text-align: right;
}

.strategy-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  color: #485e78;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.strategy-confirm-check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #2f82f3;
}

.strategy-button:focus-visible,
.strategy-dialog-dismiss:focus-visible,
.strategy-confirm-check input:focus-visible {
  outline: 3px solid rgba(47, 130, 243, 0.35);
  outline-offset: 2px;
}

/* ===== 临时充放电（管理员手动充放电 + 自动恢复） ===== */
.strategy-temp-panel {
  border-color: rgba(163, 197, 232, 0.9);
}

.strategy-temp-head .strategy-verification-status {
  flex: 0 0 auto;
}

.strategy-temp-active {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(58, 173, 118, 0.34);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(240, 252, 246, 0.9), rgba(250, 255, 252, 0.86));
}

/* 预约执行等待中：用蓝色系与「进行中」的绿色区分，避免误认为已经在跑。 */
.strategy-temp-scheduled {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(47, 130, 243, 0.32);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(240, 247, 255, 0.92), rgba(250, 252, 255, 0.88));
}

.strategy-temp-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.strategy-temp-progress > div {
  min-width: 0;
}

.strategy-temp-progress dt {
  color: #8190a3;
  font-size: 11px;
  font-weight: 650;
}

.strategy-temp-progress dd {
  min-width: 0;
  margin: 4px 0 0;
  overflow: hidden;
  color: #2d4059;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-temp-message {
  margin: 11px 0 0;
  color: #4d6a58;
  font-size: 12px;
  line-height: 1.55;
}

.strategy-temp-message.is-error {
  color: #a44328;
}

.strategy-temp-form {
  margin-top: 18px;
}

.strategy-temp-form[hidden] {
  display: none;
}

.strategy-temp-kind {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(181, 201, 223, 0.9);
  border-radius: 11px;
  background: rgba(238, 246, 255, 0.9);
}

.strategy-temp-kind-option {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.strategy-temp-kind-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.strategy-temp-kind-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 92px;
  padding: 7px 18px;
  border-radius: 8px;
  color: #53677e;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.strategy-temp-kind-option input:checked + span {
  background: linear-gradient(145deg, #398df2, #2c73d1);
  box-shadow: 0 6px 14px rgba(47, 130, 243, 0.22);
  color: #fff;
}

.strategy-temp-kind-option input:focus-visible + span {
  outline: 3px solid rgba(47, 130, 243, 0.35);
  outline-offset: 2px;
}

.strategy-temp-kind-option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.5;
}

.strategy-temp-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.strategy-temp-field {
  display: grid;
  gap: 6px;
  color: #526780;
  font-size: 12px;
  font-weight: 700;
}

.strategy-temp-field[hidden] {
  display: none;
}

.strategy-temp-field input,
.strategy-temp-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #b9cbe0;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #23364e;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.strategy-temp-field input:focus,
.strategy-temp-field select:focus {
  border-color: #3b87df;
  box-shadow: 0 0 0 3px rgba(47, 130, 243, 0.16);
}

.strategy-temp-field input:disabled,
.strategy-temp-field select:disabled {
  background: #f2f6fa;
  color: #97a5b7;
}

/* 「最长持续」勾选项：与临时表单的字段间距保持一致。 */
.strategy-temp-limit {
  margin-top: 14px;
}

.strategy-temp-limit input:disabled + span {
  color: #97a5b7;
}

.strategy-temp-hint {
  margin: 12px 0 0;
  color: #7b8a9c;
  font-size: 12px;
  line-height: 1.6;
}

.strategy-temp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

.mobile-scene-panel {
  display: none;
  width: min(100%, 480px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(194, 215, 239, 0.86);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(55, 94, 143, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.mobile-energy-scene {
  display: block;
  width: 100%;
  height: auto;
}

.mobile-scene-background {
  fill: #fafdff;
}

.mobile-isometric-grid {
  opacity: 0.86;
}

.mobile-center-halo {
  fill: rgba(131, 191, 255, 0.12);
  stroke: rgba(93, 161, 235, 0.17);
  stroke-width: 1.2;
}

.mobile-scene-node-title,
.mobile-scene-hub-title,
.mobile-scene-hub-subtitle,
.mobile-scene-metric-label,
.mobile-scene-metric-value,
.mobile-scene-metric-sub,
.mobile-scene-metric-soc,
.mobile-load-daily-label,
.mobile-load-daily-value,
.mobile-storage-yesterday-label,
.mobile-storage-yesterday-value,
.mobile-storage-today-label,
.mobile-storage-today-value {
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.mobile-scene-node-title {
  fill: #566477;
  font-size: 10px;
  font-weight: 700;
}

.mobile-scene-hub-title {
  fill: #33455d;
  font-size: 12px;
  font-weight: 750;
}

.mobile-scene-hub-subtitle {
  fill: #7d8ca0;
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.mobile-scene-metric-card rect {
  fill: rgba(255, 255, 255, 0.84);
  stroke: rgba(179, 202, 229, 0.94);
  stroke-width: 1;
}

.mobile-scene-metric-label {
  fill: #77869a;
  font-size: 7px;
  font-weight: 600;
}

.mobile-scene-metric-value {
  fill: #26384e;
  font-size: 12px;
  font-weight: 750;
}

.mobile-scene-metric-sub,
.mobile-scene-metric-soc {
  fill: #50647c;
  font-size: 7px;
  font-weight: 650;
}

.mobile-scene-pv-details-object {
  overflow: visible;
}

.mobile-scene-pv-details {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 12px 8px;
  overflow: hidden;
  border: 1px solid rgba(130, 190, 158, 0.52);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(247, 255, 251, 0.96), rgba(255, 255, 255, 0.9));
  color: #26384e;
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.mobile-scene-daily-label,
.mobile-scene-inverter-heading {
  color: #77869a;
  font-size: 10px;
  font-weight: 650;
}

.mobile-scene-daily-energy {
  margin-top: 1px;
  color: #26384e;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
}

.mobile-scene-inverter-heading {
  margin-top: 5px;
}

.mobile-scene-inverter-list {
  max-height: 74px;
  margin-top: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.mobile-scene-grid-daily-object {
  overflow: visible;
}

.mobile-scene-grid-daily {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 12px 8px;
  overflow: hidden;
  border: 1px solid rgba(177, 199, 229, 0.92);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(250, 253, 255, 0.96), rgba(255, 255, 255, 0.9));
  color: #26384e;
  font-family: "Aptos Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.mobile-grid-daily-heading {
  color: #62748b;
  font-size: 10px;
  font-weight: 700;
}

.mobile-grid-daily-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.mobile-grid-daily-value {
  min-width: 0;
  padding-left: 7px;
  border-left: 2px solid #a9b8ca;
}

.mobile-grid-daily-value.import {
  border-left-color: var(--red);
}

.mobile-grid-daily-value.export {
  border-left-color: var(--green);
}

.mobile-grid-daily-value span,
.mobile-grid-daily-note {
  display: block;
  color: #77869a;
  font-size: 8px;
  font-weight: 650;
}

.mobile-grid-daily-value strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #26384e;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-grid-daily-note {
  margin-top: 6px;
  color: #91a0b0;
  font-size: 7.5px;
}

.mobile-load-daily-divider {
  stroke: rgba(218, 194, 176, 0.88);
  stroke-width: 0.7;
}

.mobile-load-daily-label {
  fill: #8c7565;
  font-size: 7px;
  font-weight: 700;
}

.mobile-load-daily-value {
  fill: #26384e;
  font-size: 12px;
  font-weight: 750;
}

.mobile-storage-yesterday-label {
  fill: #8c7565;
  font-size: 6.5px;
  font-weight: 700;
}

.mobile-storage-yesterday-value {
  fill: #26384e;
  font-size: 8px;
  font-weight: 750;
}

.mobile-storage-today-label {
  fill: #62748b;
  font-size: 6.5px;
  font-weight: 700;
}

.mobile-storage-today-value {
  fill: #26384e;
  font-size: 8px;
  font-weight: 750;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stream-forward {
  to {
    stroke-dashoffset: -88;
  }
}

@keyframes stream-reverse {
  to {
    stroke-dashoffset: 88;
  }
}

@keyframes pulse {
  50% {
    transform: scale(0.78);
  }
}

@media (max-width: 1024px) {
  .dashboard-shell {
    width: min(100% - 24px, 1510px);
    padding-top: 24px;
  }

  .dashboard-header {
    align-items: flex-end;
    padding-bottom: 15px;
  }

  .subtitle {
    display: none;
  }

  .live-status {
    min-width: 168px;
    padding: 10px 12px;
  }

  .scene-panel {
    display: none;
  }

  .mobile-scene-panel {
    display: block;
  }

  .dashboard-footer {
    font-size: 11px;
  }

  .strategy-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-temp-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-energy-panel {
    margin-top: 16px;
    padding: 18px;
  }

  .daily-energy-page {
    width: min(100% - 24px, 1280px);
    padding-top: 24px;
  }

  .strategy-page {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }
}

@media (max-width: 560px) {
  .page-tabs {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .page-tab {
    flex: 1 0 auto;
    text-align: center;
  }

  .dashboard-header {
    display: block;
  }

  .live-status {
    width: fit-content;
    margin-top: 15px;
  }

  .mobile-scene-panel {
    border-radius: 19px;
  }

  .dashboard-footer {
    display: block;
  }

  .dashboard-footer span {
    display: block;
    margin-top: 5px;
  }

  .strategy-panel {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
  }

  .daily-energy-page-header,
  .strategy-page-header {
    display: block;
  }

  .daily-energy-window {
    width: fit-content;
    margin-top: 15px;
  }

  .daily-energy-query-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .daily-energy-date-field {
    min-width: 0;
  }

  .daily-energy-query-button {
    grid-column: span 1;
    width: 100%;
  }

  .daily-energy-recent-button {
    width: 100%;
  }

  .strategy-panel-header,
  .strategy-toolbar,
  .strategy-meta-row {
    display: block;
  }

  .strategy-availability {
    margin-top: 12px;
  }

  .strategy-status-grid,
  .strategy-option-grid,
  .strategy-preview-grid,
  .strategy-verification-grid {
    grid-template-columns: 1fr;
  }

  .strategy-temp-head {
    display: block;
  }

  .strategy-temp-head .strategy-verification-status {
    margin-top: 10px;
  }

  .strategy-temp-progress,
  .strategy-temp-fields {
    grid-template-columns: 1fr;
  }

  .strategy-temp-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .strategy-temp-kind-option span {
    width: 100%;
    min-width: 0;
  }

  .strategy-temp-actions .strategy-button {
    width: 100%;
  }

  .strategy-demand-verification-heading {
    display: block;
  }

  .strategy-demand-verification-heading .strategy-verification-status {
    margin-top: 9px;
  }

  .strategy-meta + .strategy-meta,
  .strategy-auth-state {
    margin-top: 7px;
    text-align: left;
  }

  .strategy-auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .strategy-auth-actions .strategy-button:last-child {
    grid-column: span 2;
  }

  .strategy-option-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-preview-button {
    width: 100%;
  }

  .strategy-dialog-form {
    padding: 18px;
  }

  .strategy-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .strategy-dialog-actions .strategy-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
