:root {
  --brand: #2388f5;
  --brand-hover: #1976d2;
  --ok: #35b36d;
  --ok-hover: #27995b;
  --danger: #f44336;
  --bg: #eef4fa;
  --panel: #ffffff;
  --line: #d9e4ef;
  --text: #20344a;
  --muted: #71859b;
  --soft: #f7fbff;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.45 "PingFang SC","Microsoft YaHei",sans-serif; }
button, select, input { font: inherit; }

.preview-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.preview-root {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1120px;
  height: 720px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  pointer-events: none;
}

.app-shell {
  width: 1120px;
  height: 720px;
  display: grid;
  grid-template-rows: 52px 1fr;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fbff, #edf4fa);
}
.topbar {
  background: linear-gradient(180deg, #f9fbfe, #f2f7fc); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 0 20px;
}
.topbar-left, .topbar-center { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-center { display: flex; justify-content: center; gap: 10px; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-api { color: var(--muted); font-size: 14px; font-weight: 600; }

.main { display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.sidebar {
  background: linear-gradient(180deg, #2388f5, #2e78d6);
  overflow: hidden;
}
.module-tab {
  width: 100%; height: 58px; border: none; background: transparent; color: #eef7ff; text-align: left;
  padding: 0 24px; font-size: 17px; font-weight: 700; cursor: default;
}
.module-tab[data-active="true"] { background: rgba(255,255,255,0.22); }
.content { padding: 18px; overflow: hidden; background: linear-gradient(180deg, #ffffff, #fbfdff); }
.module-page { display: none; }
.module-page[data-active="true"] { display: block; }
.module-page[data-module="monitor"][data-active="true"] .panel {
  min-height: 652px;
}
.module-page[data-module="shop"][data-active="true"] .panel,
.module-page[data-module="product"][data-active="true"] .panel,
.module-page[data-module="subscription"][data-active="true"] .panel,
.module-page[data-module="settings"][data-active="true"] .panel {
  min-height: 652px;
}
.panel { background: var(--panel); padding: 10px; border-radius: 16px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.btn-blue, .btn-green, .btn-gray, .btn-pink {
  min-width: 124px; height: 40px; border: none; border-radius: 10px; color: #fff; cursor: default; font-size: 15px; font-weight: 700;
}
.btn-blue { background: var(--brand); }
.btn-green { background: var(--ok); }
.btn-gray { background: #aebdcb; }
.btn-pink { background: #ec407a; }
.btn-orange, .btn-red {
  min-width: 114px; height: 40px; border: none; border-radius: 10px; color: #fff; font-size: 15px; cursor: default; font-weight: 700;
}
.btn-orange { background: #ff9800; }
.btn-red { background: #f44336; }

.shop-table-wrap, .data-table-wrap { border: 1px solid var(--line); background: #fff; border-radius: 12px; overflow: hidden; }
.shop-table, .data-table { width: 100%; border-collapse: collapse; }
.shop-table th, .shop-table td, .data-table th, .data-table td {
  border-right: 1px solid #e3ebf3; border-bottom: 1px solid #e3ebf3; text-align: center; padding: 9px 8px; height: 48px;
}
.shop-table th:last-child, .shop-table td:last-child, .data-table th:last-child, .data-table td:last-child { border-right: none; }
.shop-table th, .data-table th { background: #f5f9fd; font-size: 14px; font-weight: 800; color: #3a5572; }
.shop-table td, .data-table td { font-size: 15px; color: #29425d; }
.shop-table tbody tr[data-current="true"], .data-table tbody tr[data-current="true"] { background: #e8f3ff; }
#monitor-pending-body tr[data-current="true"] td { background: #d8ebff; color: #0b4176; font-weight: 700; }
.shop-action-btn { min-width: 56px; height: 24px; border: none; background: transparent; color: var(--brand); text-decoration: underline; cursor: default; font-size: 13px; }

.monitor-top-row { display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: 10px; }
.monitor-device-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.monitor-device-row span { color: #59728b; font-size: 14px; }
.monitor-select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; min-width: 168px; background: #fff; color: #2b4460; font-size: 14px; }
.monitor-recognition-row { margin-top: 10px; display: grid; grid-template-columns: 170px 266px 1fr; gap: 10px; align-items: center; }
.monitor-wave-box {
  height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; background: #f8fbff;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; width: 180px;
}
.wave-bars {
  height: 24px;
  background: repeating-linear-gradient(90deg, #1e88e5 0 4px, transparent 4px 10px);
  opacity: .8;
}
.monitor-wave-label { font-size: 13px; color: #607d8b; white-space: nowrap; }
.monitor-hotkey-btn { height: 54px; border: 1px solid #9dd0ff; background: #edf7ff; color: var(--brand); border-radius: 12px; font-size: 18px; font-weight: 800; cursor: default; }
.monitor-state-pill { min-height: 52px; border: 1px solid #cfe7d6; background: linear-gradient(180deg, #edf9f0, #e5f6ea); border-radius: 12px; padding: 8px 12px; display: grid; align-content: center; gap: 2px; }
.monitor-recognition-primary { margin: 0; color: #0d47a1; font-size: 22px; font-weight: 800; line-height: 1.15; word-break: break-all; }
.monitor-recognition-log { margin: 0; color: #546e7a; font-size: 13px; line-height: 1.35; }
.section-title-blue, .section-title-green { margin: 14px 0 10px; font-size: 22px; font-weight: 800; }
.section-title-blue { color: var(--brand); }
.section-title-green { color: var(--ok); }
.monitor-current { display: grid; grid-template-columns: 1fr 210px; gap: 14px; align-items: stretch; }
.monitor-publish-btn { border: none; border-radius: 14px; background: linear-gradient(135deg, #2388f5, #4ea4ff); color: #fff; font-size: 24px; font-weight: 800; height: 78px; cursor: default; box-shadow: 0 10px 20px rgba(35,136,245,0.18); }
#monitor-current-body td { height: 70px; padding: 12px 8px; font-size: 22px; font-weight: 800; }
.monitor-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.monitor-column { display: flex; flex-direction: column; }
.monitor-column-published { justify-content: flex-start; }
.monitor-download-btn { margin-top: 8px; width: 100%; height: 44px; border: none; border-radius: 12px; background: var(--ok); color: #fff; font-size: 16px; font-weight: 800; cursor: default; }
.published-wrap { min-height: 192px; max-height: 192px; overflow: hidden; }

#monitor-pending-body td,
.published-wrap td {
  height: 52px;
}

.product-shell { background: #f5f8fc; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.product-tab-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.mini-tab-btn { min-width: 106px; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #4b6078; font-size: 14px; font-weight: 700; }
.mini-tab-btn[data-active="true"] { border-color: #42a5f5; background: var(--brand); color: #fff; }
.product-view[data-active="false"] { display: none; }
.product-file-btn { width: 100%; height: 46px; border: 1px solid #d7e1ea; border-radius: 12px; background: #fff; color: #35506b; font-size: 17px; font-weight: 700; }
.product-file-hint { margin: 8px 0; color: #617a92; font-size: 15px; }
.product-import-btn { margin-top: 12px; width: 100%; height: 46px; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 800; }
.product-filter-row { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; margin-bottom: 12px; }
.product-filter-pill, .product-filter-search {
  height: 40px; border: 1px solid #d7e1ea; border-radius: 12px; background: #fff; color: #567089;
  display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 700;
}
.product-filter-search { justify-content: flex-start; color: #7a91a7; }
.product-summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.product-summary-card {
  min-height: 86px; border: 1px solid #d7e8fb; border-radius: 14px; background: linear-gradient(180deg, #ffffff, #f7fbff);
  display: grid; align-content: center; justify-items: center; gap: 6px;
}
.product-summary-card strong { color: #5a7188; font-size: 15px; }
.product-summary-card span { color: var(--brand); font-size: 30px; font-weight: 800; line-height: 1; }

.subscription-current-shop { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbff; font-size: 15px; color: #54708a; }
.subscription-current-shop strong { color: var(--brand); }
.subscription-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.plan-card { background: linear-gradient(180deg,#fff 0%,#f8fbff 100%); border: 1px solid #d7e8fb; border-radius: 16px; padding: 14px; box-shadow: 0 6px 18px rgba(30,136,229,0.08); display: flex; flex-direction: column; }
.plan-top { min-height: 236px; display: flex; flex-direction: column; }
.plan-head { background: #e8f4ff; border-radius: 10px; padding: 10px 12px; color: var(--brand); font-size: 16px; font-weight: 800; }
.plan-price-lines { margin-top: 10px; display: grid; gap: 6px; color: #666; font-size: 14px; }
.plan-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.plan-price-value { color: var(--brand); font-size: 34px; font-weight: 800; line-height: 1; }
.plan-price-discount, .plan-price-save { color: #ff4d4f; font-size: 14px; font-weight: 700; }
.plan-desc { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e3ebf3; color: #546e7a; font-size: 14px; min-height: 118px; line-height: 1.65; }
.plan-feature-list { margin: 0; padding-left: 18px; list-style: decimal; }
.plan-subscribe-btn { margin-top: auto; width: 100%; height: 42px; border: none; border-radius: 12px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 800; }
.subscription-status-box { margin-top: 14px; border: 1px solid #d7e8fb; border-radius: 14px; background: #f7fbff; padding: 16px; color: #1565c0; font-size: 15px; line-height: 1.7; min-height: 108px; white-space: pre-line; }

.settings-head { margin-bottom: 8px; }
.settings-title { margin: 0; color: var(--brand); font-size: 22px; font-weight: 800; }
.settings-subtitle { margin: 2px 0 0; color: #8397ab; font-size: 14px; }
.settings-divider { margin: 8px 0 12px; height: 1px; background: #e0e0e0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { background: #fafcff; border: 1px solid #e0e7ef; border-radius: 14px; padding: 14px; }
.settings-card-title { margin: 0 0 12px; color: var(--brand); font-size: 16px; font-weight: 800; }
.settings-info-line { display: flex; gap: 10px; margin-bottom: 8px; font-size: 14px; color: #5d7388; }
.settings-actions { margin-top: 10px; display: flex; gap: 10px; }
.settings-toggle-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; color: #455a64; font-size: 14px; }
.settings-field { margin-bottom: 10px; }
.settings-field-label { margin-bottom: 4px; color: #546e7a; font-size: 13px; }
.settings-input { width: 100%; height: 40px; border: 1px solid #e0e7ef; border-radius: 10px; padding: 0 10px; background: #fff; font-size: 14px; color: #334b61; }
.settings-row { display: grid; grid-template-columns: 1fr 108px; gap: 8px; }
.settings-submit { margin-top: 10px; width: 100%; height: 44px; border: none; border-radius: 12px; background: var(--brand); color: #fff; font-size: 15px; font-weight: 800; }
