:root {
  font-family:
    system-ui,
    -apple-system,
    "Noto Sans SC",
    "Microsoft YaHei",
    sans-serif;
  color: #252d29;
  background: #f6f7f5;
  --mdui-color-primary: 72, 94, 79;
  --mdui-shape-corner-medium: 8px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #486351;
}
header {
  background: white;
  border-bottom: 1px solid #e0e5df;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header strong {
  font-size: 20px;
}
header small {
  margin-left: 14px;
  color: #6b756e;
}
main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
h1 {
  font-size: 25px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 16px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.8;
}
mdui-card {
  display: block;
  padding: 24px;
  margin-bottom: 20px;
  background: white;
}
mdui-text-field,
mdui-select {
  display: block;
  width: 100%;
  min-width: 0;
}
form {
  display: grid;
  gap: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid > * {
  min-width: 0;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.hint {
  font-size: 13px;
  color: #6b756e;
  line-height: 1.8;
}
.error {
  color: #b3261e;
  font-size: 14px;
  white-space: pre-wrap;
}
.notice {
  padding: 16px;
  border-left: 3px solid #486351;
  background: #edf2ee;
  margin: 12px 0;
  line-height: 1.8;
}
.warning {
  border-color: #b35e00;
  background: #fff4e5;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  background: #edf2ee;
  color: #486351;
  border-radius: 4px;
  font-size: 13px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e5df;
  vertical-align: top;
  white-space: nowrap;
}
th {
  background: #f7f8f6;
  font-weight: 500;
  color: #5d6861;
}
.wrap {
  min-width: 180px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
  align-items: end;
}
.filter mdui-text-field,
.filter mdui-select {
  width: 190px;
}
.pager {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}
.pager mdui-select {
  width: 100px;
}
.pager mdui-text-field {
  width: 100px;
}
.login {
  max-width: 460px;
  margin: 40px auto;
}
.setup {
  max-width: 760px;
  margin: 24px auto;
}
.site-footer {
  text-align: center;
  padding: 28px 16px;
  color: #747d76;
  font-size: 12px;
  line-height: 2;
}
.site-footer a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin: 0 8px;
  text-decoration: none;
  color: inherit;
}
.site-footer img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
mdui-dialog {
  --shape-corner: 8px;
  padding: 12px;
}
mdui-dialog::part(panel) {
  width: min(680px, calc(100vw - 24px));
  max-width: 680px;
  min-width: 0;
  max-height: calc(100dvh - 28px);
}
mdui-dialog .content {
  display: grid;
  gap: 16px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  background: #f3f5f1;
  border: 1px solid #e0e5df;
}
dl {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}
dt {
  color: #6b756e;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.danger {
  --mdui-color-primary: 179, 38, 30;
}
.qr {
  text-align: center;
}
.qr img {
  max-width: 220px;
  width: 100%;
}
input[type="file"] {
  max-width: 100%;
  padding: 10px 0;
}
.empty {
  text-align: center;
  padding: 28px;
  color: #6b756e;
}
@media (max-width: 700px) {
  header {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  header strong {
    font-size: 17px;
  }
  header small {
    display: block;
    margin: 4px 0 0;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  main {
    padding: 18px 12px;
  }
  mdui-card {
    padding: 18px;
  }
  .filter mdui-text-field,
  .filter mdui-select {
    width: calc(50% - 6px);
  }
  .login {
    margin: 20px auto;
  }
  dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  dd {
    margin-bottom: 10px;
  }
  .pager {
    gap: 8px;
  }
  .heading h1 {
    font-size: 23px;
  }
}

.mobile-table-hint {
  display: none;
}
@media (max-width: 700px) {
  .mobile-table-hint {
    display: block;
  }
  .filter mdui-text-field[type="date"] {
    width: 100%;
  }
}
.authorization-result {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.authorization-result > span {
  font-size: 64px;
  line-height: 1;
}
.authorization-result.success > span {
  color: #238344;
}
.authorization-result.failure > span {
  color: #c33333;
}
.comparison {
  font-size: 24px;
  letter-spacing: 3px;
  font-weight: 600;
}

/* 授权中心工作台。导航使用 MDUI List，手机抽屉使用 NavigationDrawer。 */
.ui-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-block;
}
mdui-button {
  --shape-corner: 6px;
}
mdui-card {
  --shape-corner: 8px;
  border-color: #e0e5df;
}
#center-shell {
  min-height: 100dvh;
}
.desktop-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: #fff;
  border-right: 1px solid #e0e5df;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 20px;
  color: #293b2e;
  text-decoration: none;
}
.sidebar-brand > .ui-icon {
  width: 30px;
  height: 30px;
}
.sidebar-brand strong {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
.sidebar-brand small {
  display: block;
  color: #6b756e;
  font-size: 12px;
  margin-top: 3px;
}
.sidebar-company {
  margin: 0 20px 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eef0ed;
  display: grid;
  gap: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: #747d76;
  overflow-wrap: anywhere;
}
.site-badge {
  color: #647168;
  background: #f0f3ee;
  border: 1px solid #e4e9e0;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  padding: 3px 8px;
  width: fit-content;
  white-space: nowrap;
}
.nav-section {
  margin: 0 12px 12px;
}
.nav-caption {
  font-size: 11px;
  letter-spacing: 1px;
  color: #929a94;
  margin: 12px 16px 5px;
}
.nav-section mdui-list {
  padding: 0;
}
.nav-section mdui-list-item {
  --shape-corner: 6px;
  margin-bottom: 3px;
  font-size: 14px;
  min-height: 44px;
  border-radius: 6px;
}
.nav-section mdui-list-item::part(container) {
  min-height: 44px;
}
.nav-section .ui-icon {
  color: #7b867d;
  width: 20px;
  height: 20px;
}
.nav-section [active] {
  background: #e8efe8;
  color: #354b3c;
}
.nav-section [active] .ui-icon {
  color: #486351;
}
.sidebar-bottom {
  margin: auto 20px 0;
  padding: 20px 0;
  border-top: 1px solid #eef0ed;
  display: flex;
  gap: 10px;
  align-items: center;
}
.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1eb;
  color: #52675b;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-bottom strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.sidebar-bottom small {
  display: block;
  font-size: 11px;
  color: #89938b;
  margin-top: 4px;
}
.content-column {
  margin-left: 244px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0 32px;
  height: 64px;
  min-height: 64px;
  flex-wrap: nowrap;
  background: #fff;
  border-bottom: 1px solid #e5e9e2;
}
.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.app-topbar strong {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.topbar-product,
.topbar-separator {
  font-size: 13px;
  color: #8b948d;
}
.topbar-account {
  font-size: 13px;
  max-width: 150px;
}
.menu-toggle {
  display: none;
}
.workspace-main {
  width: 100%;
  max-width: 1440px;
  flex: 1;
  padding: 32px;
  min-width: 0;
}
#shell-footer .site-footer {
  padding: 20px 24px;
  font-size: 11px;
}
#mobile-nav {
  --shape-corner: 0;
  --z-index: 2200;
}
#mobile-nav::part(panel) {
  width: 280px;
  max-width: calc(100vw - 40px);
  background: white;
}
.mobile-sidebar-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.drawer-close {
  position: absolute;
  right: 6px;
  top: 12px;
  z-index: 1;
}
.page-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 50px 0;
  justify-content: center;
  color: #6b756e;
}
.page-loading mdui-circular-progress {
  width: 24px;
  height: 24px;
}
.welcome {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 6px 0 26px;
}
.welcome-date {
  font-size: 12px;
  color: #8a948c;
  margin: 0 0 12px;
}
.welcome h1 {
  font-size: 28px;
  line-height: 1.5;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.welcome-subtitle {
  font-size: 13px;
  color: #747f76;
  margin: 8px 0 0;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
mdui-card.metric {
  margin: 0;
  padding: 22px;
}
.metric > span {
  font-size: 13px;
  color: #717c74;
}
.metric-value {
  font-size: 34px;
  line-height: 1.4;
  margin-top: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-value small {
  font-size: 12px;
  color: #8a948c;
  font-weight: 400;
  margin-left: 10px;
}
.stats-note {
  font-size: 11px;
  color: #939b95;
  margin: 12px 0 28px;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(285px, 1fr);
  align-items: start;
  gap: 20px;
}
.home-grid mdui-card {
  margin: 0;
  padding: 22px;
}
.home-side {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.section-heading mdui-button {
  font-size: 12px;
}
.recent-grant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #eef0ed;
}
.recent-grant:last-child {
  border-bottom: 0;
}
.recent-grant:focus-visible {
  outline: 2px solid #52675b;
  outline-offset: 3px;
}
.recent-grant:hover .recent-grant-main strong {
  color: #486351;
}
.recent-grant-main {
  flex: 1;
  min-width: 0;
}
.recent-grant-main strong {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.recent-grant-main > span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #89928b;
  line-height: 1.7;
}
.recent-grant-summary {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 8px;
  flex-shrink: 0;
}
.recent-grant-summary small {
  font-size: 11px;
  color: #89928b;
}
.recent-grant > .ui-icon {
  width: 16px;
  color: #9ca69d;
}
.state-label {
  padding: 3px 8px;
  border-radius: 4px;
  background: #eff1ed;
  font-size: 11px;
  color: #7c857e;
}
.state-active {
  color: #486351;
  background: #edf3ec;
}
.state-expired {
  color: #9c6c3d;
  background: #f8f1e8;
}
.recent-note {
  margin: 12px 0 0;
  font-size: 11px;
}
.attention-card mdui-list {
  padding: 0;
  margin: 0 -10px;
}
.attention-card mdui-list-item {
  font-size: 13px;
}
.attention-card .ui-icon {
  width: 19px;
  color: #8c968d;
}
.attention-count {
  font-size: 14px;
  font-weight: 500;
  color: #9aa29b;
}
.attention-count.has-items {
  color: #9c6c3d;
}
.mail-notice {
  display: block;
  font-size: 12px;
  line-height: 1.8;
  padding: 12px;
  margin-top: 14px;
  background: #f8f5ee;
  color: #8c744b;
  border-radius: 4px;
  text-decoration: none;
}
.quick-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quick-actions mdui-button:last-child {
  grid-column: 1/-1;
}
.home-empty {
  text-align: center;
  padding: 46px 20px;
}
.home-empty > .ui-icon {
  color: #9eafa0;
  width: 36px;
  height: 36px;
}
.home-empty h3 {
  font-size: 15px;
  font-weight: 500;
  margin-top: 18px;
}
.home-empty p {
  color: #89928b;
  font-size: 13px;
}
@media (max-width: 1199px) and (min-width: 1000px) {
  .workspace-main {
    padding: 24px;
  }
  .metric-value {
    font-size: 28px;
  }
  mdui-card.metric {
    padding: 18px;
  }
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 999px) {
  .desktop-sidebar {
    display: none;
  }
  .content-column {
    margin-left: 0;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .app-topbar {
    padding: 0 16px;
  }
  .workspace-main {
    padding: 24px;
  }
}
@media (max-width: 800px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .app-topbar {
    height: 60px;
    min-height: 60px;
    gap: 8px;
    padding: 0 10px;
  }
  .topbar-leading,
  .topbar-actions {
    gap: 6px;
  }
  .topbar-product,
  .topbar-separator,
  .topbar-account {
    display: none;
  }
  .workspace-main {
    padding: 22px 16px;
  }
  .welcome {
    gap: 8px;
    align-items: start;
    margin: 4px 0 22px;
  }
  .welcome h1 {
    font-size: 23px;
  }
  .welcome > mdui-button {
    min-width: 0;
    flex-shrink: 0;
  }
  .welcome-date {
    font-size: 11px;
  }
  .welcome-subtitle {
    font-size: 12px;
  }
  .metric-grid {
    gap: 10px;
  }
  mdui-card.metric {
    padding: 18px 16px;
  }
  .metric-value {
    font-size: 29px;
    margin-top: 10px;
  }
  .metric-value small {
    margin-left: 6px;
  }
  .metric > span {
    font-size: 12px;
  }
  .home-grid mdui-card {
    padding: 18px 16px;
  }
  .home-grid,
  .home-side {
    gap: 16px;
  }
  .stats-note {
    line-height: 1.8;
    margin-bottom: 22px;
  }
  .recent-grant {
    gap: 10px;
  }
  .recent-grant > .ui-icon {
    display: none;
  }
  .recent-grant-main strong {
    font-size: 13px;
  }
  .recent-grant-main > span {
    font-size: 11px;
  }
}
/* 保留 MDUI 色彩令牌，仅收敛主色与表面色的饱和度。 */
:root.mdui-theme-light {
  --mdui-color-primary-light: 72, 94, 79;
  --mdui-color-primary: 72, 94, 79;
  --mdui-color-on-primary: 255, 255, 255;
  --mdui-color-secondary-container: 232, 239, 232;
  --mdui-color-on-secondary-container: 53, 75, 60;
  color: #252d29;
  background-color: #f6f7f5;
}

.stats-note,
.welcome-date,
.recent-note,
.recent-grant-main > span,
.recent-grant-summary small {
  color: #707b72;
}
@media (max-width: 600px) {
  .welcome .refresh-label {
    display: none;
  }
  .welcome > div {
    min-width: 0;
  }
}
