/* 云网关控制台：橙色主操作、清楚的层级和宽松阅读间距。 */
:root {
  --color-brand: #ff6a00;
  --color-brand-hover: #d94f00;
  --color-brand-soft: #fff3e8;
  --color-accent-cool: #f0f5ff;
  --color-bg-page: #f5f6f8;
  --color-bg-panel: #fff;
  --color-bg-panel-solid: #fff;
  --color-text-primary: #20242b;
  --color-text-secondary: #46505e;
  --color-text-muted: #626d7a;
  --color-border: #e5e8ed;
  --color-border-weak: #eef0f3;
  --color-border-strong: #cbd1da;
  --color-border-focus: #ff6a00;
  --color-success: #16804a;
  --color-warning: #a86300;
  --color-danger: #c92834;
  --shadow-card: none;
  --shadow-elevated: 0 12px 40px rgba(25, 35, 50, .12);
  --focus-ring: 0 0 0 3px rgba(255, 106, 0, .18);
  --font-ui: 'Microsoft YaHei', 'PingFang SC', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
html { font-size: 16px; }
body { line-height: 1.65; background: var(--color-bg-page); }
button, input, select, textarea { font-size: 16px; line-height: 1.5; border-radius: 4px; }
button { min-height: 44px; padding: 10px 18px; background: var(--color-brand); font-weight: 500; }
button:not(:disabled):hover { background: var(--color-brand-hover); box-shadow: none; }
button.ghost, .topbar__link { background: #fff; color: #394553; border: 1px solid var(--color-border-strong); }
button.ghost:not(:disabled):hover, .topbar__link:hover { color: var(--color-brand-hover); border-color: var(--color-brand); background: #fff7f0; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--color-brand-hover); outline-offset: 3px; }
input, select { min-height: 46px; padding: 10px 12px; }
input[type='checkbox'], input[type='radio'] { min-height: 0; }
textarea { padding: 14px; }
.muted, .error, .success, .form label > span, .filters label > span { font-size: 15px; line-height: 1.7; }
.productbar { position: sticky; top: 0; z-index: 40; min-height: 80px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--color-border); }
.productbar__brand { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.productbar__brand strong { font-size: 24px; letter-spacing: 1px; }
.productbar__brand > span:last-child { color: var(--color-text-secondary); font-size: 17px; }
.productbar__mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--color-brand); color: #fff; border-radius: 4px; font-size: 24px; font-weight: 700; }
.productbar__divider { width: 1px; height: 24px; background: var(--color-border-strong); }
.productbar__version { margin: 0; font-size: 14px; color: var(--color-text-muted); text-align: right; }
.shell { min-height: calc(100vh - 80px); overflow-x: clip; }
.dashboard-shell { grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 80px); overflow: visible; }
.dashboard-shell.is-nav-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.side-nav, .side-nav.is-collapsed { position: sticky; align-self: start; top: 80px; height: calc(100vh - 80px); padding: 22px 14px; background: #fff; }
.side-nav__brand { padding: 4px 12px 16px; justify-content: flex-start; }
.side-nav__brand-mark { background: #fff3e8; color: var(--color-brand-hover); border-radius: 4px; box-shadow: none; }
.side-nav__brand-copy strong { font-size: 18px; }
.side-nav__brand-copy span { font-family: var(--font-ui); font-size: 14px; }
.side-nav__controls { display: flex; align-items: center; gap: 6px; min-height: 38px; justify-content: flex-end; padding: 0 8px 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.side-nav__workspace { color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; }
.side-nav.is-collapsed .side-nav__workspace { display: none; }
.side-nav .side-nav__toggle--inline { display: grid; place-items: center; flex: none; width: 28px; height: 28px; min-height: 0; margin: 0 0 0 auto; padding: 0; border: 1px solid transparent; background: transparent; color: var(--color-text-secondary); border-radius: 3px; box-shadow: none; }
.side-nav .side-nav__toggle--inline:hover { background: #fff; color: var(--color-brand); border-color: var(--color-border); }
.side-nav__toggle-icon { width: 17px; height: 17px; }
.side-nav.is-collapsed .side-nav__controls { justify-content: center; padding: 0 0 8px; }
.side-nav.is-collapsed .side-nav__toggle--inline { margin: 0; }
.side-nav.is-collapsed .side-nav__toggle-icon { transform: rotate(180deg); }
.side-nav__menu { gap: 6px; }
.nav-group-label { padding: 16px 14px 6px; font-size: 14px; color: #707b89; }
.side-nav.is-collapsed .nav-group-label { display: none; }
.side-nav__item { min-height: 48px; padding: 12px 14px; gap: 12px; font-size: 16px; border-radius: 4px; color: #46505e; }
.side-nav__icon { font-size: 19px; width: 22px; flex-shrink: 0; }
.side-nav .side-nav__item:hover { background: #e9e9e9; color: #262626; box-shadow: none; }
.side-nav .side-nav__item.is-active:hover { background: #e9e9e9; color: #a94000; }
.side-nav .side-nav__item:hover .side-nav__icon, .side-nav .side-nav__item:hover .side-nav__label { color: inherit; }
.side-nav__item.is-active { background: #fff3e8; color: #b94300; font-weight: 600; }
.side-nav__item.is-active::before { left: 0; top: 10px; bottom: 10px; border-radius: 0; background: #ff6a00; }
.topbar { position: relative; top: auto; min-height: 112px; padding: 26px 32px; background: #fff; backdrop-filter: none; align-items: center; gap: 24px; }
.topbar h1 { font-size: 28px; line-height: 1.4; }
.topbar .muted { font-size: 15px; margin: 8px 0 0; }
.topbar__actions { gap: 12px; }
.topbar__link { min-height: 44px; border-radius: 4px; padding: 10px 16px; font-size: 15px; }
.dashboard-content { max-width: 1680px; padding: 32px 32px 110px; }
.dashboard-page { gap: 28px; animation: none; }
.card { padding: 28px; border-radius: 6px; border-color: var(--color-border); box-shadow: none; }
.section-header { margin-bottom: 24px; gap: 20px; flex-wrap: wrap; align-items: center; }
.section-header h2, .modal-card__header h2 { font-size: 21px; line-height: 1.5; }
.section-header .muted { font-size: 15px; }
.overview-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.metric { padding: 22px 20px; min-height: 126px; background: #f8f9fb; border-radius: 4px; border: 1px solid #eef0f3; }
.metric:hover { background: #fff8f2; border-color: #ffcfaa; box-shadow: none; }
.metric .muted { font-size: 15px; }
.metric strong { font-size: 32px; line-height: 1.4; margin-top: 10px; display: block; }
.overview-grid--compact .metric strong { font-size: 28px; }
:is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
:is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) .metric { padding: 22px 20px; border-radius: 4px; }
:is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) .metric .muted { font-size: 15px; }
:is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) .metric strong { font-size: 30px; margin-top: 10px; font-family: var(--font-ui); }
#ota-overview-cards .metric:last-child strong { font-size: 17px; font-family: var(--font-ui); }
.filters { gap: 14px; }
.filters--users input, .filters--users select { min-width: 0; }
.form, .subscription-form, [data-page='sensor-catalog'] .form { gap: 22px; }
.form label, .subscription-form label { gap: 8px; }
.subscription-form__grid { gap: 20px; }
.table-wrap { margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: 4px; }
table { font-size: 15px; line-height: 1.7; }
.table-wrap table { min-width: 760px; font-size: 15px; }
.table-wrap .ota-devices-table { min-width: 1100px; }
.ota-devices-table th, .ota-devices-table td { padding: 18px 16px; line-height: 1.7; }
.ota-devices-table button { font-size: 15px; min-height: 38px; padding: 7px 12px; }
.ota-status-cell, .ota-status-cell .status-pill.ota-status { font-size: 14px; line-height: 1.5; }
th { background: #f6f7f9; padding: 16px; font-size: 15px; letter-spacing: 0; color: #46505e; }
td { padding: 18px 16px; color: #394553; }
tbody tr:hover { background: #fff8f2; }
.table-actions { gap: 10px; }
.table-actions button { min-height: 38px; padding: 7px 12px; font-size: 15px; }
.pager { margin-top: 22px; font-family: var(--font-ui); font-size: 15px; gap: 14px; }
.status-pill { padding: 5px 10px; font-size: 14px; line-height: 1.5; }
.detail-grid { gap: 18px; }
.detail-item { padding: 18px; background: #f8f9fb; border-radius: 4px; }
.detail-item span { font-size: 15px; }
.detail-item strong { font-size: 16px; line-height: 1.7; margin-top: 8px; }
.detail-empty { background: #f8f9fb; padding: 24px; }
.chart-label, .chart-bar span { font-size: 14px; }
.shell:has(#login-view:not(.hidden)) { min-height: calc(100vh - 80px); padding: 48px 24px 100px; background: linear-gradient(135deg, #f5f6f8, #fff7f0); }
.login-card { width: min(100%, 480px); padding: 44px; border-radius: 6px; border-top: 4px solid var(--color-brand); box-shadow: 0 12px 40px rgba(25,35,50,.07); }
.login-eyebrow { margin: 0 0 12px; font-size: 14px; letter-spacing: 2px; color: #b94300; font-weight: 600; }
.login-card > h1 { margin: 0; font-size: 30px; line-height: 1.4; }
.login-description { margin: 14px 0 32px; color: var(--color-text-muted); font-size: 16px; }
#login-submit-btn { min-height: 48px; font-size: 17px; margin-top: 6px; }
.verify-panel { background: #f5f7fb; border-color: #dce3ed; padding: 18px; }
.modal-card { border-radius: 6px; width: min(100%, 560px); }
.modal-card__header, .modal-card__body, .modal-card__actions { padding: 24px; }
.toast-container { top: 96px; max-width: min(460px, calc(100vw - 32px)); }
.toast { font-size: 16px; line-height: 1.7; border-radius: 4px; }
.log-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 70; box-shadow: 0 4px 16px rgba(25,35,50,.15); border-radius: 4px; display: flex; align-items: center; gap: 12px; }
.log-launcher span { display: inline-grid; place-items: center; min-width: 26px; padding: 2px 7px; border-radius: 4px; background: #fff; color: #b94300; font-size: 14px; }
.log-launcher.has-errors { background: #b42330; }
.diagnostics-panel { position: fixed; right: 24px; bottom: 88px; z-index: 65; width: min(720px, calc(100vw - 48px)); max-height: calc(100dvh - 190px); overflow-y: auto; margin: 0; padding: 24px; background: #fff; border-color: var(--color-border-strong); border-radius: 6px; box-shadow: var(--shadow-elevated); }
.diagnostics-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.diagnostics-heading h2 { margin: 0; font-size: 22px; }
.diagnostics-panel summary { font-size: 16px; }
.diagnostics-panel .muted { font-size: 14px; }
.diagnostics-panel textarea { font-size: 14px; line-height: 1.8; min-height: 220px; color: #20242b; background: #f8f9fb; }
.diagnostics-actions { gap: 12px; }
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .dashboard-content { padding: 24px 20px 110px; }
  .card { padding: 24px; }
  .subscription-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .productbar { height: auto; min-height: 108px; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .productbar__brand { gap: 10px; }
  .productbar__brand strong { font-size: 21px; }
  .productbar__version { width: 100%; text-align: left; font-size: 14px; }
  .dashboard-shell, .dashboard-shell.is-nav-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
  .side-nav, .side-nav.is-collapsed { top: 108px; height: calc(100vh - 108px); padding: 16px 6px; }
  .side-nav__controls { justify-content: center; padding: 0 0 8px; }
  .side-nav__workspace { display: none; }
  .side-nav .side-nav__toggle--inline { margin: 0; }
  .side-nav__label, .side-nav__brand-copy, .nav-group-label { display: none; }
  .side-nav__brand { padding: 0 0 16px; justify-content: center; }
  .side-nav__item, .side-nav.is-collapsed .side-nav__item { justify-content: center; padding: 12px 6px; }
  .topbar { padding: 20px 16px; }
  .topbar h1 { font-size: 25px; white-space: normal; }
  .topbar__actions { width: 100%; gap: 8px; }
  .topbar__link, .topbar__actions button { font-size: 14px; padding: 10px; }
  .dashboard-content { padding: 16px 12px 110px; }
  .dashboard-page { gap: 20px; }
  .card { padding: 20px 16px; }
  .section-header h2 { font-size: 20px; }
  .overview-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  :is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  :is(#overview-cards, #device-overview-cards, #ota-overview-cards, #analytics-overview-cards) .metric { padding: 18px 14px; }
  .metric { padding: 18px 14px; }
  .subscription-form__grid, .filters--subscription-query { grid-template-columns: 1fr; }
  .shell:has(#login-view:not(.hidden)) { min-height: calc(100vh - 108px); padding: 32px 16px 110px; }
  .login-card { padding: 32px 24px; }
  .diagnostics-panel { right: 12px; bottom: 84px; width: calc(100vw - 24px); padding: 18px; max-height: calc(100dvh - 210px); }
  .log-launcher { bottom: 16px; right: 16px; }
}
