:root{font-family:"PingFang SC","Microsoft YaHei UI",system-ui,sans-serif;color:#1f2d42;background:#eef4fa;--blue:#2563eb;--line:#d8e3ef;--muted:#718096}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:radial-gradient(circle at 85% 0,#d9edff,transparent 35%),radial-gradient(circle at 0 70%,#e0f6f3,transparent 38%),#eef4fa}
.shell{width:100%;min-height:100vh;margin:0;padding:0}
.brand{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.brand span,.card>span,.records header span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
.brand h1{margin:5px 0 3px;font-size:25px}
.brand p,.card p{margin:0;color:var(--muted);font-size:13px}
.card{border:1px solid rgba(255,255,255,.95);border-radius:18px;background:rgba(255,255,255,.86);box-shadow:0 18px 48px rgba(54,83,117,.11);backdrop-filter:blur(18px)}
button{min-height:42px;border:1px solid #ccd9e7;border-radius:10px;padding:0 16px;color:#37506b;background:#fff;font:inherit;font-weight:800;cursor:pointer}
button:hover{border-color:#82a8d8}
.login{display:grid;grid-template-columns:1fr 1fr;gap:36px;width:min(780px,100%);margin:80px auto;padding:34px}
.login h2,.issue h2,.records h2{margin:7px 0 6px}
.login form,.issue form{display:grid;gap:14px}
label{display:grid;gap:7px;color:#52647a;font-size:12px;font-weight:800}
input{width:100%;min-height:44px;border:1px solid #cfdae6;border-radius:10px;padding:0 12px;color:#263a51;background:#fff;font:inherit;outline:none}
input:focus{border-color:#4d87e7;box-shadow:0 0 0 3px rgba(59,130,246,.12)}
form button[type=submit]{border-color:var(--blue);color:#fff;background:var(--blue)}
.admin-layout{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh;align-items:stretch}
.sidebar{position:sticky;top:0;display:flex;height:100vh;flex-direction:column;padding:28px 16px;border-top:0;border-bottom:0;border-left:0;border-radius:0;background:rgba(255,255,255,.9)}
.sidebar-title{padding:6px 8px 16px;border-bottom:1px solid var(--line)}
.sidebar-title span{display:block;color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
.sidebar-title strong{display:block;margin-top:5px;font-size:18px}
.sidebar nav{display:grid;gap:8px;padding-top:14px}
.sidebar nav button{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center;width:100%;min-height:64px;padding:9px;text-align:left;border-color:transparent;background:transparent}
.sidebar nav button:hover{border-color:#cdddf0;background:#f7faff}
.sidebar nav button.active{border-color:#8eb5f2;color:#1d4ed8;background:#edf5ff;box-shadow:0 8px 22px rgba(37,99,235,.11)}
.sidebar nav button>span:last-child{min-width:0}
.sidebar nav strong,.sidebar nav small{display:block}
.sidebar nav small{margin-top:3px;color:#7b899b;font-size:10px;font-weight:500;white-space:nowrap}
.nav-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid #cbd9e8;border-radius:9px;color:#48627f;background:#fff;font-size:12px;font-weight:900}
.sidebar nav button.active .nav-mark{border-color:#6e9fec;color:#fff;background:#3978dd}
.sidebar-logout{width:100%;margin-top:auto;color:#66788d;background:#f8fbfe}
.module-content{width:100%;min-width:0;max-width:1640px;padding:30px 28px 60px}
.module-heading{margin:0 0 14px 2px}
.module-heading h2{margin:0;font-size:20px}
.module-heading p{margin:4px 0 0;color:var(--muted);font-size:12px}
.activation-layout{display:grid;grid-template-columns:150px minmax(0,1fr);gap:14px;align-items:start}
.subnav{position:sticky;top:24px;display:grid;align-content:start;gap:6px;padding:10px}
.subnav button{width:100%;min-height:40px;padding:0 12px;border-color:transparent;text-align:left;background:transparent;font-size:13px}
.subnav button:hover{border-color:#ceddec;background:#f7faff}
.subnav button.active{border-color:#4c87eb;color:#fff;background:#3477e8;box-shadow:0 10px 24px rgba(37,99,235,.18)}
.activation-content{min-width:0}
.issue-page{width:min(720px,100%);min-height:0;padding:26px}
.issue-workspace{display:grid;grid-template-columns:minmax(520px,720px) minmax(300px,380px);gap:14px;align-items:stretch}.issue-workspace .issue-page{width:100%}.activation-code-card{display:grid;min-height:540px;padding:26px}.activation-code-empty{align-self:center;text-align:center}.activation-code-empty strong{font-size:17px}.activation-code-empty p{max-width:270px;margin:9px auto 0;line-height:1.7}.activation-code-card>div[hidden]{display:none}.activation-code-card>div>span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}.activation-code-card h2{margin:7px 0 6px}.activation-code-card code{display:block;margin:24px 0 12px;border:1px dashed #adc4dc;border-radius:11px;padding:17px 10px;background:#f5f9fd;color:#1f4f85;font-size:20px;font-weight:900;letter-spacing:.08em;text-align:center}.activation-code-card button{width:100%;border-color:var(--blue);color:#fff;background:var(--blue)}.activation-code-card dl{margin:21px 0 14px}.activation-code-card dl div{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid #e5ebf2;font-size:12px}.activation-code-card dt{color:var(--muted)}.activation-code-card dd{margin:0;font-weight:800}.activation-code-card small{display:block;border-radius:9px;padding:12px;background:#edf8f7;color:#276b70;line-height:1.6}
.issue-page form{max-width:none;gap:12px}
.today-stats,.management-stats{grid-template-columns:repeat(3,1fr)}
.data-view-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.data-view-tabs button{min-height:82px;padding:16px 18px;text-align:left;color:inherit}
.data-view-tabs button span,.data-view-tabs button small{display:block}
.data-view-tabs button span{font-size:15px;font-weight:900}
.data-view-tabs button small{margin-top:5px;color:#8190a3;font-size:11px;font-weight:500}
.data-view-tabs button:hover,.data-view-tabs button.active{border-color:#73a2ef;box-shadow:0 10px 28px rgba(37,99,235,.14)}
.data-view-tabs button.active span{color:#1d5fce}
.daily-date-control{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:18px}
.daily-date-control label{width:min(260px,100%)}
.daily-date-control strong{padding-bottom:11px;color:#53677e;font-size:13px}
.referrer-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;margin-bottom:20px}
.referrer-card{min-height:116px;padding:16px;text-align:left;color:#334a64;background:#f8fbfe}
.referrer-card span,.referrer-card strong,.referrer-card small{display:block}
.referrer-card span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.referrer-card strong{margin-top:10px;color:#245dd7;font-size:28px}
.referrer-card small{margin-top:2px;color:#8492a3;font-size:11px;font-weight:500}
.referrer-card:hover,.referrer-card.active{border-color:#5f94eb;background:#eff6ff;box-shadow:0 9px 24px rgba(37,99,235,.12)}
.referrer-prompt{padding:40px;border:1px dashed #c8d8e8;border-radius:12px;color:#7b8a9d;text-align:center;background:#f9fbfd}
.referrer-detail h3{margin:0 0 12px;font-size:15px}
.subpage-empty{min-height:calc(100vh - 108px);margin-top:0}
.migration-page{overflow:hidden}
.migration-page>header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px 24px;border-bottom:1px solid var(--line)}
.migration-page>header span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
.migration-page>header h2{margin:5px 0 4px}.migration-page>header p{margin:0;color:var(--muted);font-size:12px}
.migration-form{display:grid;grid-template-columns:minmax(240px,1fr) minmax(240px,1fr) auto;align-items:end;gap:12px;padding:20px 22px 10px}
.migration-form button{min-height:44px;border-color:var(--blue);color:#fff;background:var(--blue)}
.migration-note{margin:0;padding:0 22px;color:#7b899b;font-size:11px;line-height:1.7}
.migration-page>#migrationMessage{padding:0 22px}
#migrationTableBody{padding:4px 22px 22px}
.migration-status{display:inline-block;border-radius:999px;padding:5px 9px;font-style:normal;font-weight:800}
.migration-status.pending{color:#9a6700;background:#fff5d9}.migration-status.approved{color:#16805c;background:#e7f8f1}.migration-status.rejected{color:#b23b3b;background:#fff0f0}
.migration-actions{display:flex;gap:7px}.migration-actions button{min-height:32px;padding:0 10px}.migration-actions .danger{color:#fff}
.signature-page{min-height:480px;padding:28px}
.signature-page>span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
.signature-page h2{margin:7px 0 6px}
.signature-page>p{color:var(--muted)}
.empty-module{display:grid;place-items:center;align-content:center;min-height:320px;margin-top:24px;border:1px dashed #bdd0e3;border-radius:14px;color:#53677e;background:#f8fbfe;text-align:center}
.empty-module strong{font-size:18px}
.empty-module small{max-width:460px;margin-top:8px;color:#8593a4;line-height:1.7}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.stats article,.stats>button{padding:18px}
.stats>button{min-height:0;text-align:left;color:inherit}
.stats>button:hover,.stats>button.active{border-color:#76a4ee;box-shadow:0 12px 34px rgba(37,99,235,.16)}
.stats span,.stats strong,.stats small{display:block}
.stats span{color:var(--muted);font-size:12px}
.stats strong{margin-top:8px;color:#1d4ed8;font-size:26px}
.stats small{margin-top:4px;color:#8291a4;font-size:11px;font-weight:500}
.stat-detail{margin-bottom:16px;overflow:hidden}
.stat-detail>header{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;border-bottom:1px solid var(--line)}
.stat-detail>header span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
.stat-detail h2{margin:5px 0 0}
#statDetailBody{padding:20px 22px}
.stat-filter{display:grid;grid-template-columns:180px 180px minmax(220px,1fr);gap:12px;margin-bottom:18px}
.stat-filter select{width:100%;min-height:44px;border:1px solid #cfdae6;border-radius:10px;padding:0 10px;color:#263a51;background:#fff;font:inherit}
.stat-table-wrap{overflow:auto;border:1px solid #e2eaf2;border-radius:12px}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;color:#738296;font-size:12px}
.pagination>div{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.pagination button{min-width:36px;min-height:36px;padding:0 10px}
.pagination button.active{border-color:#3978dd;color:#fff;background:#3978dd}
.pagination button:disabled{cursor:not-allowed;opacity:.45}
.stat-summary{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:18px}
.stat-summary section{min-width:0}
.stat-summary h3{margin:0 0 10px;font-size:15px}
.stat-empty{padding:28px!important;text-align:center}
.grid{display:grid;grid-template-columns:340px minmax(0,1fr);gap:16px}
.issue{padding:24px}
.issue>p{margin-bottom:22px}
.records{overflow:hidden}
.records header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 22px;border-bottom:1px solid var(--line)}
.records header input{width:min(360px,45%)}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;white-space:nowrap}
th,td{padding:13px 15px;border-bottom:1px solid #e5ebf2;text-align:left;font-size:12px}
th{color:#718096;background:#f7faff}
td strong,td small{display:block}
td small{margin-top:4px;color:#8a98aa}
code{color:#34506e;font-size:11px}
td i{display:inline-block;border-radius:999px;padding:5px 9px;color:#16805c;background:#e7f8f1;font-style:normal}
.reset{min-height:32px;padding:0 10px;color:#c2413b}
.license-actions{display:flex;align-items:center;gap:7px}.license-actions .migrate{min-height:32px;padding:0 10px;border-color:#77a1e8;color:#1d5fce;background:#f2f7ff}
.activation-records table{table-layout:fixed;min-width:680px;white-space:normal}
.activation-records th:nth-child(1){width:18%}
.activation-records th:nth-child(2),.activation-records th:nth-child(3){width:23%}
.activation-records th:nth-child(4){width:36%}
.activation-records td{overflow-wrap:anywhere;line-height:1.7}
.activation-records .license-actions{flex-wrap:wrap}
.empty{padding:40px;text-align:center;color:var(--muted)}
.message{min-height:18px;margin-top:12px!important}
.message.error{color:#c2413b}
.message.ok{color:#16805c}
dialog{width:min(520px,calc(100% - 32px));border:0;border-radius:18px;padding:0;box-shadow:0 30px 90px rgba(15,23,42,.3)}
dialog::backdrop{background:rgba(30,41,59,.38);backdrop-filter:blur(8px)}
dialog form{display:grid;gap:15px;padding:26px}
dialog h2,dialog p{margin:0}
dialog form>span{color:#3973cc;font-size:10px;font-weight:900;letter-spacing:.16em}
dialog form>div{display:flex;justify-content:flex-end;gap:10px}
#licenseDetailDialog{width:min(740px,calc(100% - 32px))}
#licenseDetailDialog .license-detail-form{max-height:calc(100dvh - 48px);overflow-y:auto}
.license-detail-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:4px 0}
.license-detail-fields>div{min-width:0;padding:13px 15px;border:1px solid #e0e9f2;border-radius:10px;background:#f7faff}
.license-detail-fields dt{margin-bottom:6px;color:#718096;font-size:12px}
.license-detail-fields dd{margin:0;color:#263a51;font-size:14px;font-weight:700;line-height:1.6;overflow-wrap:anywhere}
@media(max-width:550px){.license-detail-fields{grid-template-columns:1fr}}
.danger{border-color:#dc4c4c!important;background:#dc4c4c!important}
@media(max-width:1200px){.data-view-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:950px){.stats{grid-template-columns:1fr 1fr}
.issue-workspace{grid-template-columns:1fr}.activation-code-card{min-height:320px}
.admin-layout{grid-template-columns:1fr}
.sidebar{position:static;display:block;height:auto;margin:14px 18px 0;padding:12px;border:1px solid rgba(255,255,255,.95);border-radius:18px}
.sidebar-title{display:none}
.sidebar nav{grid-template-columns:1fr 1fr;padding-top:0}
.sidebar-logout{margin-top:10px}
.module-content{padding:22px 18px 50px}
.activation-layout{grid-template-columns:1fr}
.subnav{position:static;grid-template-columns:repeat(4,1fr);min-height:0}
.grid{grid-template-columns:1fr}
.stat-summary{grid-template-columns:1fr}
.login{grid-template-columns:1fr;margin-top:25px}
}
.duration-picker{min-width:0;margin:4px 0 2px;padding:17px 0 0;border:0;border-top:1px solid #e0e9f2}
.duration-picker legend{float:left;width:100%;margin:0 0 10px;padding:0;color:#52647a;font-size:12px;font-weight:800}
.duration-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;clear:both}
.duration-option{position:relative;display:flex;align-items:center;justify-content:center;gap:5px;min-height:52px;border:1px solid #d5e1ef;border-radius:10px;color:#53677e;background:#fff;cursor:pointer}
.duration-option input{position:absolute;width:1px;height:1px;min-height:0;padding:0;opacity:0}
.duration-option span{font-size:15px}.duration-option small{border-radius:4px;padding:2px 4px;color:#8293a8;background:#eff4f9;font-size:9px;font-weight:500}
.duration-option:has(input:checked){border-color:#4b8ce9;color:#1f62cc;background:#edf5ff;box-shadow:0 0 0 1px #4b8ce9}
.duration-option:has(input:focus-visible){outline:3px solid #8cbafa;outline-offset:3px}.duration-option:hover{border-color:#87b3ec}
.duration-summary{margin:12px 0 3px!important;border-radius:8px;padding:11px 13px;color:#2e5d8f!important;background:#f0f6fc;font-size:12px!important;font-weight:700;line-height:1.6!important}
.calendar-note{display:block;margin-top:6px;color:#8694a5;font-size:10px;font-weight:400}
@media(max-width:550px){.duration-options{gap:7px}.duration-option{min-height:46px}.duration-option span{font-size:13px}}
@media(max-width:700px){.stat-filter{grid-template-columns:1fr}
.subnav{grid-template-columns:1fr 1fr}
.data-view-tabs{grid-template-columns:1fr}
.daily-date-control{align-items:stretch;flex-direction:column}
.daily-date-control strong{padding-bottom:0}
.pagination{align-items:stretch;flex-direction:column}
.pagination>div{justify-content:flex-start}
.migration-form{grid-template-columns:1fr}
}
@media(max-width:620px){.shell{width:100%;padding:0}
.sidebar{margin:12px 12px 0}
.module-content{padding:18px 12px 40px}
.sidebar nav{grid-template-columns:1fr}
.stats{grid-template-columns:1fr 1fr}
.records header{align-items:stretch;flex-direction:column}
.records header input{width:100%}
.login{padding:24px}
}

#resetDialog .duration-preserve{grid-column:1 / -1}

/* 激活操作沿用 themes.css 病历打印按钮的完整白色主题样式。 */
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 108px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, .34) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .34)) !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, .10),
    0 8px 20px rgba(71, 85, 105, .08),
    inset 1px 1px 1px rgba(255, 255, 255, .96),
    inset -1px -1px 1px rgba(15, 23, 42, .16),
    inset 0 0 7px rgba(15, 23, 42, .06) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  font-weight: 850;
  transform: translateY(0) scale(1);
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease, background-color .22s ease !important;
}
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view])::before {
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .95), transparent 42%),
    linear-gradient(100deg, rgba(255, 255, 255, .42), transparent 48%, rgba(255, 255, 255, .24));
  content: "";
  pointer-events: none;
}
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view])::after {
  position: absolute;
  inset: 1px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  content: "";
  pointer-events: none;
}
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]):hover {
  border-color: rgba(15, 23, 42, .46) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(241, 245, 249, .48)) !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  box-shadow:
    0 4px 10px rgba(15, 23, 42, .12),
    0 12px 24px rgba(71, 85, 105, .11),
    inset 1px 1px 1px rgba(255, 255, 255, 1),
    inset -1px -1px 1px rgba(15, 23, 42, .18),
    inset 0 0 8px rgba(15, 23, 42, .07) !important;
  transform: translateY(-1px) scale(1.03);
}
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]):active {
  box-shadow:
    0 1px 3px rgba(15, 23, 42, .14),
    inset 2px 2px 4px rgba(15, 23, 42, .15),
    inset -1px -1px 1px rgba(255, 255, 255, .9) !important;
  transform: translateY(1px) scale(.98) !important;
}
html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28) !important;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]) { transition: none !important; }
  html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]):hover,
  html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]):active { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-app-theme="light"] body .license-actions > :is([data-license-revoke], [data-machine], [data-license-migrate], [data-license-view]) { background: #fff !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.wecom-management {
  display: grid;
  gap: 16px;
}
.wecom-heading,
.wecom-records > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wecom-heading h2,
.wecom-records h3 {
  margin: 0;
}
.wecom-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.wecom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wecom-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin: 0;
}
.wecom-stats > button {
  display: grid;
  gap: 7px;
  padding: 15px;
  text-align: left;
}
.wecom-stats > button[aria-pressed="true"] {
  border-color: #82a8d8;
  background: #edf5ff;
}
.wecom-stats > button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.wecom-stats > button > span {
  color: #52647a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: normal;
}
.wecom-stats [data-wecom-stat] {
  color: #1d4ed8;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.wecom-records {
  min-width: 0;
}
.wecom-records > header {
  flex-wrap: wrap;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.wecom-records h3 {
  font-size: 16px;
}
#wecomSearch {
  display: flex;
  gap: 7px;
}
#wecomSearch input {
  width: min(245px, 55vw);
  font-size: 13px;
}
#wecomSearch button {
  flex-shrink: 0;
}
#wecomBindingMessage {
  margin: 0 !important;
  min-height: 0;
}
.wecom-empty {
  padding: 40px 20px;
  text-align: center;
}
.wecom-table-scroll {
  overflow-x: auto;
}
.wecom-table {
  min-width: 760px;
  width: 100%;
  border-collapse: collapse;
}
.wecom-table th,
.wecom-table td {
  padding: 12px 17px;
  text-align: left;
  vertical-align: top;
}
.wecom-table thead th {
  border-bottom: 1px solid var(--line);
  background: #f7faff;
}
.wecom-table tbody tr + tr {
  border-top: 1px solid var(--line);
}
.wecom-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.wecom-table td:first-child {
  max-width: 235px;
  overflow-wrap: anywhere;
}
.wecom-table td:last-child {
  white-space: nowrap;
}
.wecom-table td code {
  font-size: 11px;
}
.wecom-table button,
.wecom-action-menu summary {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}
.wecom-action-menu summary {
  display: grid;
  place-items: center;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #37506b;
  cursor: pointer;
  list-style: none;
}
.wecom-action-menu summary::-webkit-details-marker {
  display: none;
}
.wecom-action-menu > div {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}
.wecom-table .wecom-renew-action {
  border-color: #b8d0f3;
  color: #225bad;
  background: #eaf2ff;
}
.wecom-table .wecom-renew-action:hover:not(:disabled) {
  border-color: #8eb2e7;
  background: #dcebff;
}
.wecom-disabled-action {
  display: inline-grid;
}
.wecom-management button:disabled,
#wecomLinkDialog button:disabled,
#wecomActionDialog button:disabled {
  cursor: default;
  opacity: .52;
}
.wecom-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eaf0f5;
  color: #495d72;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.wecom-badge.authorized {
  background: #e1f5eb;
  color: #156449;
}
.wecom-badge.pending {
  background: #fff1cc;
  color: #795000;
}
.wecom-badge.failed {
  background: #fce8e8;
  color: #a43737;
}
.wecom-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
#wecomDetailDialog {
  width: min(690px, calc(100% - 32px));
}
.wecom-detail-form {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}
.wecom-timeline-heading {
  margin: 17px 0 7px;
}
.wecom-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wecom-timeline li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.wecom-timeline li > p {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.wecom-timeline li > span,
.wecom-timeline-empty {
  font-size: 12px;
  color: var(--muted);
}
#wecomBackupConfirmation {
  display: flex;
  align-items: center;
  gap: 8px;
}
#wecomBackupConfirmation input {
  width: auto;
  min-height: auto;
}
.wecom-qr {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.wecom-qr canvas {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
}
@media (max-width: 650px) {
  .wecom-heading {
    flex-wrap: wrap;
  }
  .wecom-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 激活记录保留外围导航，筛选、表格和操作放入同一个工作区。 */
#activationManagement:has(.activation-management-panel:not([hidden])) .module-heading {
  margin-bottom: 20px;
}
#activationManagement:has(.activation-management-panel:not([hidden])) .module-heading h2 {
  font-size: 24px;
}
.activation-management-panel {
  --activation-blue: #235db8;
  --activation-line: #dce6ef;
  min-width: 0;
}
.activation-management-panel .management-records {
  background: #fff;
  border: 1px solid var(--activation-line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(49, 80, 112, .09);
  backdrop-filter: none;
}
.activation-management-panel .data-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0;
  padding: 6px 16px;
  border-bottom: 1px solid var(--activation-line);
  background: #f7faff;
}
.activation-management-panel .data-view-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border-color: transparent;
  border-radius: 8px;
  color: #4b6078;
  background: transparent;
  box-shadow: none;
}
.activation-management-panel .data-view-tabs button span {
  font-size: 13px;
  font-weight: 700;
}
.activation-management-panel .data-view-tabs button:hover {
  color: var(--activation-blue);
  background: #edf4ff;
}
.activation-management-panel .data-view-tabs button.active {
  border-color: #cbdcf4;
  color: var(--activation-blue);
  background: #eaf2ff;
}
.activation-management-panel .data-view-tabs button.active span {
  color: inherit;
}
.activation-management-panel .management-records > header {
  padding: 18px 21px 14px;
  border: 0;
}
.activation-management-panel .management-records h2 {
  margin: 0;
  color: #1b2b3d;
  font-size: 20px;
}
.activation-management-panel #managementDetailBody {
  padding: 0 21px 18px;
}
.activation-management-panel .stat-filter {
  grid-template-columns: minmax(120px, .65fr) minmax(130px, .7fr) minmax(210px, 1.55fr);
  gap: 10px;
  margin-bottom: 13px;
}
.activation-management-panel .stat-filter input,
.activation-management-panel .stat-filter select {
  min-height: 39px;
  border-radius: 8px;
  background: #fbfdff;
  font-size: 13px;
}
.activation-management-panel .stat-table-wrap {
  border-color: var(--activation-line);
  border-radius: 10px;
}
.activation-management-panel .activation-records table {
  min-width: 710px;
}
.activation-management-panel .activation-records th,
.activation-management-panel .activation-records td {
  padding: 12px;
}
.activation-management-panel .activation-records th {
  color: #4e627a;
  background: #f6f9fc;
}
.activation-management-panel .activation-records th:nth-child(1) {
  width: 19%;
}
.activation-management-panel .activation-records th:nth-child(2),
.activation-management-panel .activation-records th:nth-child(3) {
  width: 19.5%;
}
.activation-management-panel .activation-records th:nth-child(4) {
  width: 42%;
}
.activation-management-panel .activation-records-managed table {
  min-width: 890px;
}
.activation-management-panel .activation-records-managed th:nth-child(1) {
  width: 14%;
}
.activation-management-panel .activation-records-managed th:nth-child(2),
.activation-management-panel .activation-records-managed th:nth-child(3) {
  width: 15%;
}
.activation-management-panel .activation-records-managed th:nth-child(4) {
  width: 18%;
}
.activation-management-panel .activation-records-managed th:nth-child(5) {
  width: 38%;
}
.activation-records-managed .license-wecom-term {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.activation-records-managed .license-wecom-state {
  color: #526982;
}
.activation-management-panel .activation-records tbody tr:nth-child(even) {
  background: #fbfcfe;
}
.activation-management-panel .activation-records tbody tr:hover,
.activation-management-panel .activation-records tbody tr:focus-within {
  background: #f4f8ff;
}
.activation-management-panel .activation-records tbody tr:last-child td {
  border-bottom: 0;
}
#activationManagement .activation-management-panel .license-actions {
  gap: 5px;
}
#activationManagement .activation-management-panel .license-actions > button {
  min-width: 0;
  min-height: 34px;
  height: auto;
  padding: 0 9px;
  border: 1px solid #d8e3f0 !important;
  border-radius: 7px !important;
  color: #405770 !important;
  -webkit-text-fill-color: currentColor !important;
  background: #fff !important;
  box-shadow: none !important;
  backdrop-filter: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transform: none !important;
  transition: border-color .15s, background-color .15s !important;
}
#activationManagement .activation-management-panel .license-actions > button::before,
#activationManagement .activation-management-panel .license-actions > button::after {
  content: none;
}
#activationManagement .activation-management-panel .license-actions > button:hover {
  border-color: #a6bbd5 !important;
  background: #f2f7ff !important;
}
#activationManagement .activation-management-panel .license-actions > [data-license-revoke] {
  color: #a23c35 !important;
}
#activationManagement .activation-management-panel .license-actions > :is(.license-wecom-activate, [data-license-wecom]) {
  border-color: #b8d0f3 !important;
  color: #225bad !important;
  background: #eaf2ff !important;
}
#activationManagement .activation-management-panel .license-actions > :is(.license-wecom-activate, [data-license-wecom]):hover {
  border-color: #8eb2e7 !important;
  background: #dcebff !important;
}
.activation-management-panel .data-view-tabs button:focus-visible,
#activationManagement .activation-management-panel .license-actions > button:focus-visible {
  outline: 2px solid #4c86dc !important;
  outline-offset: 2px;
}
#activationManagement .activation-management-panel .license-actions > button:disabled {
  cursor: default;
  opacity: .55;
}
.activation-management-panel .pagination {
  margin-top: 13px;
}
.activation-management-panel .pagination button {
  min-height: 32px;
  min-width: 32px;
  border-radius: 7px;
}

#migrationDialog form {
  gap: 12px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
#migrationDialog .license-detail-fields > :first-child {
  grid-column: 1 / -1;
}
#migrationDestinationHint {
  color: #526982;
  font-size: 12px;
  line-height: 1.5;
}
#migrationDialog button:disabled {
  opacity: .55;
  cursor: default;
}
#migrationDialogMessage:empty {
  display: none;
}

:is(#wecomLinkDialog, #wecomRenewDialog) {
  width: min(650px, calc(100% - 28px));
  border-radius: 15px;
  color: #203347;
}
:is(#wecomLinkDialog, #wecomRenewDialog) form {
  gap: 16px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-link-heading h2 {
  font-size: 22px;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 6px;
  color: #536882;
  font-size: 12px;
  overflow-wrap: anywhere;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-link-meta:not(:has(> :not([hidden]))) {
  display: none;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-link-meta:has(> :not([hidden])) {
  padding-bottom: 12px;
  border-bottom: 1px solid #e1ebf5;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-picker legend {
  margin-bottom: 10px;
  padding: 0;
  color: #203347;
  font-size: 14px;
  font-weight: 800;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 7px;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-options label {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #f8faff;
  cursor: pointer;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-options label:has(input:checked) {
  border-color: #84ace9;
  color: #174b9b;
  background: #eaf3ff;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-options label:has(input:focus-visible) {
  outline: 2px solid #4c86dc;
  outline-offset: 2px;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-term-options input {
  flex: none;
  width: 15px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}
#wecomLinkDialog #wecomTermHint,
#wecomRenewDialog #wecomRenewHint {
  margin-top: 10px;
  color: #526982;
  font-size: 12px;
  line-height: 1.65;
}
#wecomLinkDialog .wecom-link-content {
  display: grid;
  grid-template-columns: minmax(185px, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}
#wecomLinkDialog .wecom-link-qr {
  place-items: center;
  min-height: 212px;
  padding: 8px;
  border: 1px solid #e0e9f3;
  border-radius: 12px;
  background: #fff;
}
#wecomLinkDialog #wecomQrImage {
  min-width: 0;
  max-width: 100%;
}
#wecomLinkDialog .wecom-link-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}
#wecomLinkDialog #wecomQrHint {
  color: #243b55;
  font-weight: 700;
}
#wecomLinkDialog #wecomLinkValidity {
  color: #526982;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
#wecomLinkDialog #wecomLinkValue {
  min-height: 38px;
  border-radius: 7px;
  background: #f7faff;
}
#wecomLinkDialog .wecom-activation-status {
  padding: 9px 12px;
  border-radius: 8px;
  color: #24538d;
  background: #eef5ff;
  font-size: 13px;
  line-height: 1.5;
}
#wecomLinkDialog .wecom-activation-status:is(.success, .ok, [data-state="success"], [data-state="authorized"]) {
  color: #176649;
  background: #eaf7ef;
}
#wecomLinkDialog .wecom-activation-status:is(.error, [data-state="error"], [data-state="expired"]) {
  color: #a23e36;
  background: #fff1ef;
}
:is(#wecomLinkDialog, #wecomRenewDialog) .wecom-actions {
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #e1ebf5;
}
#wecomLinkDialog #generateLicenseWecomLink,
#wecomRenewDialog #confirmWecomRenew {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}
#wecomLinkDialog #generateLicenseWecomLink:disabled,
#wecomRenewDialog #confirmWecomRenew:disabled {
  opacity: .55;
  cursor: default;
}
#wecomLinkDialog form:has(#generateLicenseWecomLink:not([hidden])) #closeWecomLink {
  border-color: #ccd9e7;
  color: #37506b;
  background: #fff;
}
:is(#wecomLinkDialog, #wecomRenewDialog) [hidden] {
  display: none;
}
@media (max-width: 720px) {
  .activation-management-panel .stat-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .activation-management-panel .stat-filter label:last-child {
    grid-column: 1 / -1;
  }
  .activation-management-panel .management-records > header {
    padding-inline: 13px;
  }
  .activation-management-panel #managementDetailBody {
    padding-inline: 13px;
  }
}
@media (max-width: 520px) {
  .activation-management-panel .data-view-tabs {
    padding-inline: 8px;
  }
  .activation-management-panel .data-view-tabs button {
    padding-inline: 9px;
  }
  :is(#wecomLinkDialog, #wecomRenewDialog) form {
    padding: 18px;
  }
  #wecomLinkDialog .wecom-link-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #wecomLinkDialog .wecom-link-qr {
    min-height: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #activationManagement .activation-management-panel .license-actions > button {
    transition: none !important;
  }
}
