:root { color-scheme: light; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: #172033; background: #f3f5f8; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: #f3f5f8; }
button, input, select { font: inherit; letter-spacing: 0; }
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: #fff; border-bottom: 1px solid #dfe4ea; }
.topbar strong { font-size: 17px; margin-right: 16px; }
.topbar span, .muted { color: #70798a; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.admin-tabs { height: 48px; display: flex; align-items: flex-end; gap: 24px; padding: 0 28px; background: #fff; border-bottom: 1px solid #dfe4ea; }
.admin-tabs a { height: 48px; display: inline-flex; align-items: center; padding: 0 2px; color: #596274; text-decoration: none; border-bottom: 3px solid transparent; }
.admin-tabs a:hover { color: #14796f; }
.admin-tabs a.active { color: #14796f; font-weight: 700; border-bottom-color: #14796f; }
.workspace { padding: 20px 28px 36px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); background: #fff; border: 1px solid #dfe4ea; }
.stats div { min-height: 92px; padding: 18px 22px; border-right: 1px solid #e7ebf0; }
.stats div:last-child { border: 0; }
.stats span { display: block; color: #70798a; font-size: 13px; }
.stats strong { display: block; margin-top: 8px; font-size: 26px; }
.toolbar { margin-top: 14px; padding: 12px; background: #fff; border: 1px solid #dfe4ea; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
input, select { height: 36px; border: 1px solid #cbd2dc; background: #fff; padding: 0 10px; outline: none; }
input:focus, select:focus { border-color: #168276; box-shadow: 0 0 0 2px rgba(22,130,118,.12); }
.filters input { width: 260px; }
.button, .icon-command { height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd2dc; background: #fff; color: #253047; padding: 0 16px; cursor: pointer; text-decoration: none; border-radius: 4px; }
.button.primary { background: #14796f; border-color: #14796f; color: #fff; }
.button.ghost { background: #f7f8fa; }
.table-section, .log-section, .product-section, .release-section { margin-top: 14px; background: #fff; border: 1px solid #dfe4ea; }
.section-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #e7ebf0; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: 16px; }
.section-heading span { color: #70798a; font-size: 13px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 42px; text-align: left; color: #596274; background: #f7f8fa; font-weight: 600; }
th, td { padding: 8px 12px; border-bottom: 1px solid #edf0f3; white-space: nowrap; }
tr:hover td { background: #fafcfd; }
.name-cell { font-weight: 600; }
.permission-cell { max-width: 280px; white-space: normal; }
.company-cell { width: 160px; min-width: 140px; white-space: normal; }
.inline-company-select { width: 100%; min-width: 130px; transition: border-color .2s, background .2s; }
.inline-company-select.saved { border-color: #44a487; background: #edf9f4; }
.select-column { width: 42px; min-width: 42px; padding-left: 14px; padding-right: 6px; text-align: center; }
.select-column input { width: 16px; height: 16px; padding: 0; vertical-align: middle; }
.permission-tag { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 7px; color: #086a61; background: #e8f6f0; border-radius: 3px; }
.permission-tag.muted-tag { color: #6c7482; background: #eef1f4; text-decoration: line-through; }
.login-info span, .login-info small { display: block; }
.login-info small { margin-top: 3px; color: #70798a; }
.status { display: inline-block; min-width: 54px; text-align: center; padding: 3px 8px; border-radius: 3px; background: #eef1f4; color: #526070; }
.status.active { background: #e8f6f0; color: #087552; }
.status.pending { background: #fff3da; color: #955b00; }
.status.disabled, .status.deleted { background: #fcebea; color: #b42318; }
.status.expired { background: #f1ecfb; color: #6941c6; }
.actions, .more-actions { display: flex; gap: 6px; align-items: center; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.block-muted { display: block; margin-top: 3px; color: #70798a; font-weight: 400; }
.checksum { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.actions form, .more-actions form { margin: 0; }
.link-button { border: 0; background: transparent; color: #40506a; padding: 3px 4px; cursor: pointer; }
.primary-text { color: #08796d; }
.danger-text { color: #b42318; }
.more-actions { display: none; position: absolute; z-index: 5; margin-top: 5px; padding: 8px; background: #fff; border: 1px solid #d5dae1; box-shadow: 0 8px 22px rgba(19,31,51,.14); }
.more-actions.open { display: flex; }
.batch-toolbar { min-height: 54px; display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-bottom: 1px solid #e7ebf0; background: #fafbfc; }
.batch-toolbar > span { font-weight: 600; }
.batch-toolbar select { min-width: 180px; }
.batch-toolbar small { color: #70798a; }
.batch-divider { width: 1px; height: 26px; margin: 0 3px; background: #d9dfe7; }
.hidden-form { display: none; }
.notice { margin-bottom: 14px; padding: 10px 14px; border: 1px solid; border-radius: 4px; }
.notice.success { color: #087552; background: #eaf7f1; border-color: #a8dfca; }
.notice.error { color: #a51d14; background: #fff0ef; border-color: #f1b9b5; }
.log-list { max-height: 240px; overflow: auto; }
.log-list div { display: grid; grid-template-columns: 120px minmax(130px, 180px) minmax(0, 1fr); gap: 10px; padding: 9px 16px; border-bottom: 1px solid #edf0f3; font-size: 13px; }
.log-list strong, .log-list span { min-width: 0; overflow-wrap: anywhere; }
.log-list time, .log-list span { color: #70798a; }
.empty { padding: 28px; text-align: center; color: #818a99; }
.product-list { display: grid; }
.product-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: #fff; border: 1px solid #dfe4ea; }
.product-toolbar h1 { margin: 0; font-size: 18px; }
.product-toolbar span { display: block; margin-top: 5px; color: #70798a; font-size: 13px; }
.product-row { min-height: 58px; display: grid; grid-template-columns: minmax(280px, 1fr) 90px 90px 70px; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid #edf0f3; }
.product-row:last-child { border-bottom: 0; }
.product-row div { display: flex; align-items: baseline; gap: 12px; }
.product-row code { color: #70798a; font-size: 12px; }
dialog { width: 420px; padding: 0; border: 1px solid #cfd5de; border-radius: 6px; box-shadow: 0 18px 50px rgba(18,28,45,.22); }
dialog.wide-dialog { width: 560px; }
dialog::backdrop { background: rgba(23,32,51,.34); }
.dialog-form { padding: 20px; }
.dialog-form h2 { margin: 0 0 18px; font-size: 18px; }
.dialog-form label, .form-stack label { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.dialog-form input:not([type="checkbox"]), .dialog-form select, .form-stack input { width: 100%; }
.dialog-form textarea { width: 100%; resize: vertical; min-height: 90px; border: 1px solid #cbd2dc; padding: 9px 10px; font: inherit; letter-spacing: 0; }
.dialog-form textarea:focus { border-color: #168276; outline: none; box-shadow: 0 0 0 2px rgba(22,130,118,.12); }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-options { display: flex; gap: 22px; margin-top: 16px; }
.check-options label { display: flex; align-items: center; gap: 7px; margin: 0; }
.check-options input { width: 16px; height: 16px; }
.dialog-form small { color: #70798a; }
.dialog-note { margin: 14px 0 0; padding: 10px 12px; color: #596274; background: #f4f7f9; font-size: 13px; line-height: 1.6; }
.permission-options { max-height: 320px; overflow: auto; border: 1px solid #e1e5ea; }
.permission-option { display: grid !important; grid-template-columns: 22px 1fr; align-items: center; gap: 8px !important; min-height: 58px; margin: 0 !important; padding: 8px 10px; border-bottom: 1px solid #edf0f3; cursor: pointer; }
.permission-option:last-child { border-bottom: 0; }
.permission-option input { width: 16px; height: 16px; padding: 0; }
.permission-option strong, .permission-option small { display: block; }
.permission-option small { margin-top: 3px; }
.company-create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 14px; }
.company-create-row input { width: 100%; }
.company-list { max-height: 300px; overflow: auto; border: 1px solid #e1e5ea; }
.company-list > div { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-bottom: 1px solid #edf0f3; }
.company-list > div:last-child { border-bottom: 0; }
.company-list + small { display: block; margin-top: 10px; }
.error-text { color: #b42318 !important; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; background: #edf1f5; }
.login-panel { width: 390px; padding: 30px; background: #fff; border: 1px solid #d9dfe7; box-shadow: 0 10px 30px rgba(22,33,52,.08); border-radius: 6px; }
.login-panel h1 { margin: 14px 0 4px; font-size: 22px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; background: #14796f; color: #fff; font-weight: 700; border-radius: 6px; }
.form-stack .button { width: 100%; margin-top: 20px; }
.source-index-summary { min-height: 76px; display: flex; align-items: center; gap: 24px; padding: 14px 18px; background: #fff; border: 1px solid #dfe4ea; }
.source-index-summary div { display: flex; align-items: baseline; gap: 12px; }
.source-index-summary span, .source-index-summary p { color: #70798a; }
.source-index-summary strong { font-size: 26px; }
.source-index-summary p { margin: 0; font-size: 13px; }
.source-index-toolbar { justify-content: flex-start; }
.source-index-filters { width: 100%; }
.source-index-filters input { flex: 1 1 250px; min-width: 210px; }
.source-index-filters select { flex: 0 1 190px; min-width: 140px; }
.source-index-heading > div { display: flex; align-items: center; gap: 12px; }
.source-index-heading form { margin: 0; }
.source-index-table th, .source-index-table td { padding-left: 10px; padding-right: 10px; }
.danger-button { color: #b42318; border-color: #e1aaa5; background: #fff8f7; }
.pagination { min-height: 60px; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 10px 16px; }
.pagination > span:not(.button) { color: #596274; font-size: 13px; }
.button.disabled { color: #9aa2af; pointer-events: none; background: #f1f3f5; }
.diagnostic-stats { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.diagnostic-toolbar { align-items: flex-start; }
.diagnostic-filters { flex: 1 1 760px; }
.diagnostic-filters input[name="keyword"] { flex: 1 1 260px; }
.diagnostic-filters input[type="date"] { width: 150px; }
.diagnostic-detail-table { min-width: 1180px; }
.diagnostic-detail-table td:nth-child(4) { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.diagnostic-failure-table { min-width: 1040px; }
.diagnostic-endpoint-summary { max-width: 460px; white-space: normal; overflow-wrap: anywhere; color: #596274; }
.dedup-overview { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; background: #fff; border: 1px solid #dfe4ea; }
.dedup-overview h1 { margin: 0 0 4px; font-size: 18px; }
.dedup-overview p { margin: 0; color: #70798a; font-size: 13px; }
.dedup-overview code { margin-left: 8px; color: #596274; }
.dedup-stats { margin-top: 14px; grid-template-columns: repeat(7, minmax(110px, 1fr)); }
.dedup-table { min-width: 860px; }
.dedup-digest { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.dedup-note { margin-top: 14px; padding: 12px 16px; color: #596274; background: #fff; border: 1px solid #dfe4ea; font-size: 13px; line-height: 1.7; }
@media (max-width: 1200px) {
  .workspace { padding-left: 16px; padding-right: 16px; }
  th, td { padding-left: 8px; padding-right: 8px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .admin-tabs { padding-left: 16px; padding-right: 16px; }
  .topbar > div:first-child span { display: none; }
  .account-table { min-width: 980px; }
  .source-index-table { min-width: 940px; }
  .dedup-stats { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { height: auto; min-height: 58px; padding-top: 8px; padding-bottom: 8px; gap: 10px; }
  .workspace { padding: 12px 8px 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { min-height: 76px; padding: 14px; border-bottom: 1px solid #e7ebf0; }
  .toolbar-actions, .filters { width: 100%; }
  .toolbar-actions .button, .filters .button { flex: 1 1 auto; }
  .filters input, .filters select { width: 100%; flex-basis: 100%; }
  .batch-toolbar { flex-wrap: wrap; }
  .batch-toolbar select { flex: 1 1 180px; }
  .batch-divider { display: none; }
  .product-toolbar { align-items: flex-start; flex-direction: column; }
  .product-toolbar .toolbar-actions { width: 100%; }
  .source-index-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .dedup-overview { align-items: flex-start; flex-direction: column; }
  .dedup-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-index-heading { align-items: flex-start; flex-direction: column; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .log-list div { grid-template-columns: 94px minmax(105px, 145px) minmax(0, 1fr); gap: 7px; padding-left: 10px; padding-right: 10px; }
  dialog, dialog.wide-dialog { width: calc(100vw - 24px); max-width: 560px; }
}
