:root {
  --ecoco-orange: #ff5000;
  --ecoco-blue: #060e9f;
  --ecoco-yellow: #ffce00;
  --ecoco-sky: #8eb9c9;
  --ink: #172033;
  --muted: #66758a;
  --line: #dce3ee;
  --bg: #f5f7fb;
  --panel: #fff;
  --green: #168a45;
  --amber: #b77900;
  --red: #d93025;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 60px;
  background: var(--ecoco-blue);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand-title { min-width: 0; flex: 1; }
.brand-title strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}
.brand-title span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.75);
  font-size: 11px;
}
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
}
.wrap {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 88px;
}
.brand-ribbon {
  min-height: 128px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,80,0,.14), rgba(6,14,159,.10)),
    #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.ribbon-copy {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.ribbon-logo {
  width: clamp(128px, 16vw, 190px);
  height: auto;
  object-fit: contain;
}
.ribbon-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}
.ribbon-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.liangbao {
  width: 105px;
  align-self: end;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}
.section-title h2 {
  margin: 0;
  font-size: 20px;
}
.section-title span {
  color: var(--muted);
  font-size: 13px;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.home-card,
.metric-card,
.machine-card,
.queue-item,
.rank-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(6, 14, 159, .08);
}
.home-card {
  min-height: 180px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  border-top: 5px solid var(--ecoco-orange);
  transition: transform .18s ease, box-shadow .18s ease;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(6, 14, 159, .13);
}
.home-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ecoco-blue);
  background: rgba(6,14,159,.08);
  font-size: 24px;
  font-weight: 900;
}
.home-card h2 {
  margin: 0 0 8px;
  font-size: 23px;
}
.home-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.home-action {
  color: var(--ecoco-blue);
  font-weight: 900;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.metric-card {
  padding: 16px;
  min-height: 118px;
  display: grid;
  align-content: space-between;
}
.metric-card span {
  color: var(--muted);
  font-size: 13px;
}
.metric-card strong {
  font-size: 32px;
  line-height: 1.1;
}
.metric-card small {
  color: var(--muted);
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px;
  gap: 10px;
  margin: 14px 0;
}
.field,
.select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  min-height: 34px;
  padding: 0 13px;
  cursor: pointer;
}
.chip.active {
  background: var(--ecoco-blue);
  color: #fff;
  border-color: var(--ecoco-blue);
}
.machine-list,
.rank-list {
  display: grid;
  gap: 10px;
}
.machine-card {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  overflow: hidden;
}
.machine-card.online .side { background: var(--green); }
.machine-card.warning .side { background: var(--amber); }
.machine-card.offline .side { background: var(--red); }
.machine-inner {
  padding: 15px;
}
.machine-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: #f1f4f8;
  color: var(--muted);
}
.badge.online { color: var(--green); background: rgba(22,138,69,.10); }
.badge.warning { color: var(--amber); background: rgba(183,121,0,.13); }
.badge.offline { color: var(--red); background: rgba(217,48,37,.10); }
.badge.bottle { color: var(--ecoco-orange); background: rgba(255,80,0,.12); }
.badge.battery { color: var(--ecoco-blue); background: rgba(6,14,159,.10); }
.badge.grade { color: #684a00; background: rgba(255,206,0,.22); }
.machine-name {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}
.machine-meta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.collection-box {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}
.collection-box span,
.collection-box small {
  color: var(--muted);
  font-size: 12px;
}
.collection-box strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}
.fill-row { margin-top: 12px; }
.fill-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.fill-track {
  height: 8px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ecoco-orange);
}
.fill.battery { background: var(--ecoco-blue); }
.fill.warn { background: var(--amber); }
.fill.danger { background: var(--red); }
.side-panel {
  display: grid;
  gap: 12px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 8px rgba(6, 14, 159, .08);
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.queue-list {
  display: grid;
  gap: 8px;
}
.queue-item,
.rank-item {
  padding: 12px;
  box-shadow: none;
}
.queue-name,
.rank-name {
  font-weight: 850;
  line-height: 1.4;
}
.queue-meta,
.rank-meta {
  margin-top: 5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}
.rank-value {
  font-size: 24px;
  font-weight: 950;
  color: var(--ecoco-blue);
}
.data-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,206,0,.18);
  color: #684a00;
  line-height: 1.6;
}
.empty-state,
.loading-state {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: none;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(0,0,0,.08);
}
.bottom-nav a {
  flex: 1;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.bottom-nav a.active { color: var(--ecoco-blue); }
.icon { width: 20px; height: 20px; }
@media (max-width: 1080px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .top-actions { display: none; }
  .wrap { width: min(100% - 20px, 1440px); padding-top: 12px; }
  .brand-ribbon { grid-template-columns: 1fr; }
  .ribbon-copy { align-items: flex-start; }
  .ribbon-logo { width: 116px; }
  .liangbao { display: none; }
  .toolbar { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .collection-grid { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; }
}
