:root {
  --bg: #eeeeee;
  --surface: rgba(255, 255, 255, 0.94);
  --text: #1f2a44;
  --muted: #7c889e;
  --line: #dbe6f6;
  --border: #d6deed;
  --primary: #9f8bea;
  --primary-hover: #b7a7f2;
  --primary-active: #8570d8;
  --primary-bg: #efefff;
  --success: #18a058;
  --danger: #ff7fa3;
  --warning: #f0a020;
  --moe-blue: #5d8ff8;
  --moe-cyan: #a8cff4;
  --moe-card: #ffffff;
  --moe-soft: #f8fbff;
  --shadow-card: none;
  --shadow-pop: 0 16px 38px rgba(69, 86, 128, 0.16);
  font-family: v-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 32%, #eeeeee 100%);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  border-color: var(--border);
  border-radius: 9px;
  color: #27324a;
  background: #fff;
  box-shadow: none;
  font-weight: 650;
}

button:hover {
  border-color: #b7c7ff;
  color: #335cff;
  background: #f8fbff;
}

button:active {
  border-color: var(--primary-active);
  color: var(--primary-active);
}

.primary {
  border-color: rgba(255, 255, 255, 0.58);
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #7fa7f7 100%);
  box-shadow: 0 10px 22px rgba(159, 139, 234, 0.22);
}

.primary:hover {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  background: linear-gradient(135deg, var(--primary-hover) 0%, #8db4ff 100%);
}

.danger {
  border-color: #ffd1dd;
  color: #ef5f86;
  background: #fff7fa;
}

input,
select,
textarea {
  border-color: var(--border);
  border-radius: 9px;
  background: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b7a7f2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(159, 139, 234, 0.16);
}

.login-page {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 56%, #fffdf7 100%);
}

.login-shell {
  width: 920px;
  min-height: 560px;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid rgba(159, 139, 234, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(69, 86, 128, 0.12);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  justify-content: flex-start;
  padding: 56px 48px;
  color: #27324a;
  background:
    linear-gradient(145deg, rgba(248, 251, 255, 0.96), rgba(239, 239, 255, 0.72));
}

.brand-panel::after {
  position: absolute;
  right: -26px;
  bottom: -44px;
  width: 300px;
  height: 300px;
  background: url("/static/brand/stickers/mengka-login-meme-head-cropped.png") center / contain no-repeat;
  content: "";
  opacity: 0.92;
  pointer-events: none;
}

.brand-logo {
  width: 86px;
  height: 86px;
  margin-bottom: 18px;
}

.brand-panel h1 {
  color: #27324a;
  font-size: 36px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-panel p {
  color: #687282;
  font-size: 15px;
}

.brand-panel span {
  border: 1px solid #dbe6f6;
  border-radius: 999px;
  color: #405777;
  background: #f8fbff;
  font-weight: 650;
}

.login-form {
  padding: 54px 48px 42px;
}

.login-form h2 {
  color: #27324a;
  font-size: 26px;
}

.auth-tab {
  height: 42px;
  border-radius: 999px;
}

.auth-tab.active {
  border-color: #b7c7ff;
  color: #335cff;
  background: var(--primary-bg);
}

.auth-form input {
  height: 42px;
  border-color: var(--border);
  border-radius: 10px;
}

.auth-form .primary {
  height: 42px;
  border-radius: 10px;
}

.admin-layout {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 56px, #eeeeee 56px, #eeeeee 100%);
}

.header {
  height: 56px;
  flex-basis: 56px;
  border-bottom: 1px solid rgba(159, 139, 234, 0.12);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.header-left {
  gap: 12px;
}

.app-logo {
  width: 34px;
  height: 34px;
}

.header-left strong {
  color: #202a3d;
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.user-btn {
  min-width: 0;
  border-radius: 999px;
  padding: 0 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  background: #f1f5fb;
  color: #335cff;
  box-shadow: inset 0 0 0 1px #d7e1ef;
}

.user-dropdown {
  min-width: 148px;
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  padding: 8px;
}

.main-body {
  background: #eeeeee;
}

.sider {
  width: 232px;
  flex-basis: 232px;
  border-right: 1px solid #dbe6f6;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.menu-block {
  padding: 4px 8px;
}

.menu-group-title,
.menu-item {
  width: 100%;
  height: 40px;
  margin: 1px 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #27324a;
  font-weight: 500;
  line-height: 40px;
}

.menu-group-title:hover,
.menu-item:hover {
  color: #335cff;
  background: #f8fbff;
}

.menu-item.active,
.menu-item.child.active {
  color: #335cff;
  background: #efefff;
}

.menu-children {
  padding: 2px 0 6px;
  background: transparent;
}

.menu-item.child {
  width: calc(100% - 12px);
  margin-inline: 6px;
  padding-left: 42px;
  font-weight: 400;
}

.menu-icon {
  margin-inline-end: 12px;
  color: #6f737a;
}

.menu-item.active .menu-icon,
.menu-group-title:hover .menu-icon {
  color: #335cff;
}

.content {
  margin: 0;
  padding: 20px;
}

.page-title-card,
.stat-card,
.panel,
.config-card,
.log-card,
dialog,
.theme-detail-box {
  border: 1px solid rgba(214, 222, 237, 0.9);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

.page-title-card {
  padding: 20px 24px;
}

.page-head h1,
.content-card-head h2,
.panel-head h2 {
  color: #2b3345;
  font-weight: 750;
}

.page-head p,
.content-card-head p,
.panel-head p,
.sub-line,
label span,
.secret-line span {
  color: #7c889e;
}

.stat-card {
  min-height: 132px;
  padding: 22px 24px;
}

.stat-card:hover {
  border-color: #b7c7ff;
  box-shadow: none;
}

.stat-card span {
  color: #7a8495;
}

.stat-card strong {
  color: #111827;
  font-weight: 750;
}

.stat-icon {
  border-radius: 12px;
}

.stat-icon.users,
.stat-icon.accounts {
  color: #335cff;
  background: #efefff;
}

.stat-icon.push {
  color: #18a058;
  background: #edfff5;
}

.panel-head,
.content-card-head {
  min-height: 62px;
  border-bottom-color: #dbe6f6;
}

.card-toolbar {
  border-bottom: 1px solid #eef3fb;
}

table {
  color: #27324a;
}

th {
  border-bottom-color: #dbe6f6;
  color: #687282;
  background: #f8fbff;
  font-weight: 750;
}

td {
  border-bottom-color: #edf2fa;
}

tbody tr:hover {
  background: #fbfdff;
}

.tag {
  border-radius: 999px;
  font-weight: 700;
}

.tag.running {
  border-color: #b7ebc6;
  color: #14804a;
  background: #edfff5;
}

.tag.stopped {
  border-color: #d6deed;
  color: #687282;
  background: #f8fbff;
}

.tag.warning {
  border-color: #ffe2a9;
  color: #b87500;
  background: #fff9ec;
}

.logs {
  background: #fff;
}

.log-item {
  border-bottom-color: #edf2fa;
}

.log-level {
  border-radius: 999px;
}

.search-field input {
  border-radius: 999px;
}

.batch-menu,
.sms-country-menu,
.user-dropdown {
  border: 1px solid #dbe6f6;
  background: #fff;
  box-shadow: var(--shadow-pop);
}

.modal-actions,
.inline-actions,
.push-actions,
.account-action-bar {
  border-top-color: #edf2fa;
}

.dialog-head {
  border-bottom-color: #edf2fa;
}

.bili-login-dialog {
  border-radius: 12px;
}

.bili-login-shell {
  background:
    linear-gradient(90deg, #fff 0%, #fff 50%, #fbfdff 100%);
}

.bili-login-tabs button.active {
  color: #335cff;
}

.bili-input-group,
.bili-input-row {
  border-color: #dbe6f6;
}

.bili-login-actions .primary,
.bili-login-actions.single .primary {
  background: linear-gradient(135deg, #15aeea 0%, #7fa7f7 100%);
  box-shadow: 0 10px 24px rgba(21, 174, 234, 0.18);
}

.theme-presale-panel,
.table-panel {
  scrollbar-color: #b7c7ff transparent;
}

.theme-presale-item img,
.theme-presale-cover,
.avatar,
.avatar-fallback {
  border-radius: 10px;
}

.hardcore-category,
.theme-rush-form .checkbox-line,
.time-picker-selects,
.theme-detail-box,
.hardcore-ai-box {
  border-color: #dbe6f6;
  background: #f8fbff;
}

.toast {
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(69, 86, 128, 0.16);
}

@media (max-width: 720px) {
  .header-left strong {
    display: block;
    max-width: min(46vw, 180px);
    overflow: visible;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  button,
  #userAccountsView .card-toolbar button,
  .button-row button,
  .row-actions button,
  .card-toolbar button,
  .panel-head button,
  .modal-actions button,
  .inline-actions button,
  .push-actions button,
  .dialog-head-actions button,
  .theme-presale-actions button,
  .records-controls button {
    height: 32px;
    min-height: 32px;
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .page-head h1,
  .page-head p,
  .panel-head h2,
  .panel-head p,
  .content-card-head h2,
  .content-card-head p,
  .stat-card span,
  .stat-card strong,
  .stat-card p,
  .name-line,
  .sub-line,
  .tag,
  label > span,
  .checkbox-line span,
  .checkbox-line small,
  .common-upgrade-coin-switch strong,
  .pager-text {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
  }

  .stat-card > div:first-child,
  .theme-presale-item > div,
  .user-cell > div,
  .secret-line > div {
    min-width: 0;
  }

  .mobile-card-panel,
  .theme-presale-panel,
  #themeRushRankSection {
    overflow: hidden;
  }

  .mobile-card-table {
    width: 100%;
    min-width: 0;
    display: block;
    border: 0;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .mobile-card-table tbody tr {
    min-width: 0;
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
  }

  .mobile-card-table td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 0;
    padding: 0;
  }

  .mobile-card-table td::before {
    color: var(--muted);
    font-size: 12px;
    line-height: 22px;
    white-space: nowrap;
    content: attr(data-label);
  }

  .mobile-card-table .mobile-primary-cell {
    display: block;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }

  .mobile-card-table .mobile-primary-cell::before,
  .mobile-card-table .mobile-action-cell::before,
  .mobile-card-table .mobile-empty-cell::before {
    display: none;
  }

  .mobile-card-table .mobile-action-cell {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  .mobile-card-table .mobile-action-cell .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .mobile-card-table .mobile-empty-cell {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
  }

  .mobile-cell-value,
  .mobile-cell-stack,
  .mobile-cell-stack > * {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
  }

  .mobile-cell-value,
  .mobile-cell-stack > * {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-cell-value::-webkit-scrollbar,
  .mobile-cell-stack > *::-webkit-scrollbar {
    display: none;
  }

  .mobile-cell-stack {
    display: grid;
    gap: 3px;
  }

  .mobile-cell-stack .sub-line {
    margin-top: 0;
    overflow-x: auto;
    text-overflow: clip;
  }

  .mobile-cell-stack > .common-upgrade-coin-switch {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow: visible;
    margin-top: 8px;
    -webkit-overflow-scrolling: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-cell-stack > .common-upgrade-coin-switch strong {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .common-upgrade-coin-switch.is-pending {
    cursor: wait;
    opacity: 0.65;
    pointer-events: none;
  }

  .mobile-card-table .theme-presale-item {
    width: 100%;
    min-width: 0;
  }

  .mobile-card-table .theme-presale-item .name-line,
  .mobile-card-table .theme-presale-item .sub-line,
  .mobile-card-table .mobile-primary-cell > .name-line,
  .mobile-card-table .mobile-primary-cell > .sub-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #userAccountsView td::before,
  #adminUsersView td::before,
  #adminBiliAccountsView td::before {
    white-space: nowrap;
  }

  #userAccountsView td,
  #adminUsersView td,
  #adminBiliAccountsView td {
    min-width: 0;
  }

  #userAccountsView .state-cell,
  #userAccountsView .features-cell,
  #adminUsersView td:not(.admin-primary-cell):not(.admin-action-cell),
  #adminBiliAccountsView td:not(.admin-primary-cell):not(.admin-action-cell) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #adminUsersView .table-panel,
  #adminBiliAccountsView .table-panel {
    overflow: visible;
  }

  #adminUsersView table,
  #adminBiliAccountsView table {
    min-width: 0;
    display: block;
  }

  #adminUsersView thead,
  #adminBiliAccountsView thead {
    display: none;
  }

  #adminUsersView tbody,
  #adminBiliAccountsView tbody {
    display: grid;
    gap: 12px;
    padding: 0 12px 14px;
  }

  #adminUsersView tbody tr,
  #adminBiliAccountsView tbody tr {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
  }

  #adminUsersView td,
  #adminBiliAccountsView td {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 0;
    overflow-wrap: anywhere;
  }

  #adminUsersView td::before,
  #adminBiliAccountsView td::before {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    content: attr(data-label);
  }

  #adminUsersView .admin-primary-cell,
  #adminBiliAccountsView .admin-primary-cell {
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }

  #adminUsersView .admin-primary-cell::before,
  #adminBiliAccountsView .admin-primary-cell::before,
  #adminUsersView .admin-action-cell::before,
  #adminBiliAccountsView .admin-action-cell::before {
    display: none;
  }

  #adminUsersView .admin-action-cell,
  #adminBiliAccountsView .admin-action-cell {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  #adminUsersView .admin-action-cell .row-actions,
  #adminBiliAccountsView .admin-action-cell .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .header {
    height: 56px;
    flex-basis: 56px;
    justify-content: space-between;
    padding: 0 12px;
  }

  .mobile-only {
    border-radius: 10px;
  }

  .sider {
    width: min(82vw, 304px);
    max-width: calc(100vw - 24px);
    box-shadow: 12px 0 28px rgba(69, 86, 128, 0.16);
  }

  .content {
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .view,
  .stats-grid,
  .stat-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .view {
    overflow-x: hidden;
  }

  .stat-card > div:first-child {
    flex: 1 1 0;
    overflow: hidden;
  }

  .stat-card span,
  .stat-card strong,
  .stat-card p {
    width: 100%;
    min-width: 0;
  }

  .user-btn-text {
    max-width: min(48vw, 180px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-head,
  .panel-head,
  .content-card-head {
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .page-head > div:first-child,
  .panel-head > div:first-child,
  .content-card-head > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .panel-head,
  .content-card-head {
    min-height: 0;
    gap: 12px;
    padding: 16px;
  }

  .page-head > button,
  .panel-head > button,
  .content-card-head > button {
    width: max-content;
    max-width: 100%;
    align-self: flex-start;
  }

  .page-head .button-row,
  .page-head .common-upgrade-toolbar,
  .theme-presale-actions,
  .records-controls,
  .card-toolbar,
  .toolbar-left,
  .toolbar-right,
  .modal-actions,
  .inline-actions,
  .push-actions,
  .account-action-bar {
    width: 100%;
    min-width: 0;
  }

  .button-row,
  .row-actions,
  .dialog-head-actions,
  .account-action-bar {
    flex-wrap: wrap;
  }

  .button-row button,
  .row-actions button,
  .dialog-head-actions button,
  .account-action-bar button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .page-head .button-row > .plain-select,
  .page-head .button-row > input,
  .page-head .button-row > button {
    flex: 1 1 140px;
    width: auto;
    min-width: 0;
  }

  .common-upgrade-toolbar > .plain-select,
  .common-upgrade-toolbar > input,
  .common-upgrade-toolbar > button,
  .common-upgrade-toolbar .common-account-select,
  .common-upgrade-toolbar #runCommonUpgradeBtn,
  .common-upgrade-toolbar #commonUpgradeAutoBtn {
    flex: 1 1 100%;
    width: 100%;
  }

  .common-upgrade-toolbar .common-upgrade-auto-status {
    width: 100%;
    max-width: none;
  }

  .theme-presale-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .theme-presale-actions .plain-select {
    width: 100%;
    min-width: 0;
  }

  .records-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    justify-content: stretch;
  }

  .records-controls .plain-select,
  #juryRecordsPageSize {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  #prevJuryRecordsBtn,
  #nextJuryRecordsBtn {
    width: 100%;
  }

  .records-controls .pager-text,
  #juryRecordsPageText {
    grid-column: auto;
    width: auto;
    min-width: 0;
    order: initial;
    text-align: center;
    white-space: nowrap;
  }

  .modal-actions,
  .inline-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    align-items: center;
  }

  .modal-actions button,
  .inline-actions button {
    width: 100%;
    min-width: 0;
  }

  .hardcore-actions {
    width: calc(100% - 32px);
    margin: 0 16px 16px;
  }

  .secret-line {
    align-items: stretch;
    flex-direction: column;
  }

  .secret-line button {
    width: max-content;
    max-width: 100%;
    align-self: flex-end;
  }

  .theme-rush-time-picker select,
  select,
  input,
  textarea {
    min-width: 0;
    max-width: 100%;
  }

  .page-title-card,
  .stat-card,
  .panel,
  .config-card,
  .log-card {
    border-radius: 12px;
  }

  .login-shell {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 0;
  }

  .login-form {
    width: 100%;
    padding: 36px 24px;
  }

  .brand-panel::after {
    display: none;
  }
}

/* Bilibili official login dialog geometry */
.bili-login-policy a {
  color: #00aeec;
  text-decoration: none;
  white-space: nowrap;
}

.bili-login-policy a:hover {
  color: #00a1d6;
}

@media (min-width: 721px) {
  .bili-login-dialog {
    position: relative;
    width: 820px;
    height: 430px;
    min-height: 430px;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
  }

  .bili-login-dialog::before,
  .bili-login-dialog::after {
    position: absolute;
    bottom: 0;
    z-index: 0;
    width: 112px;
    height: 115px;
    background-image: url("https://s1.hdslb.com/bfs/static/jinkela/passport-pc/assets/2233pic.png");
    background-repeat: no-repeat;
    background-size: 386px 115px;
    content: "";
    pointer-events: none;
  }

  .bili-login-dialog::before {
    left: 0;
    background-position: left bottom;
  }

  .bili-login-dialog::after {
    right: 0;
    background-position: right bottom;
  }

  .bili-login-close {
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 28px;
    z-index: 5;
  }

  .bili-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 430px;
    display: grid;
    grid-template-columns: 173px 402px;
    gap: 90px;
    box-sizing: border-box;
    padding: 52px 63px 29px 92px;
    background: transparent;
  }

  .bili-qr-panel {
    width: 173px;
    height: 349px;
    display: block;
  }

  .bili-qr-panel::after {
    display: none;
  }

  .bili-qr-panel h2 {
    height: 16px;
    font-size: 18px;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
  }

  .bili-qr-card {
    width: 173px;
    height: 173px;
    margin-top: 26px;
    box-sizing: border-box;
  }

  .bili-qr-card > img,
  .qr-loading,
  .qr-app-download,
  .qr-app-download img {
    width: 160px;
    height: 160px;
  }

  .qr-official-scan-tip {
    left: -106px;
    top: -40px;
  }

  .qr-status {
    position: absolute;
    top: 220px;
    left: 50%;
    width: 240px;
    min-height: 18px;
    margin: 0;
    overflow: hidden;
    color: #61666d;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  .qr-tip {
    position: absolute;
    top: 246px;
    left: 0;
    width: 173px;
    margin: 0;
    font-size: 13px;
    line-height: 20px;
  }

  .bili-form-panel {
    width: 402px;
    height: 349px;
    display: block;
  }

  .bili-form-panel::before {
    left: -45px;
    top: 43px;
    height: 228px;
  }

  .bili-login-tabs {
    height: 20px;
    gap: 20px;
    margin: 0 0 24px;
  }

  .bili-login-tabs button {
    font-size: 16px;
    line-height: 20px;
  }

  .bili-login-tabs button.active {
    color: #00aeec;
  }

  .bili-input-group {
    width: 402px;
    height: 92px;
    gap: 0;
    box-sizing: border-box;
    overflow: visible;
    border: 1px solid #e3e5e7;
    border-radius: 8px;
    background: #fff;
  }

  .bili-input-row,
  .bili-input-group .bili-input-row:first-child,
  .bili-input-group .bili-input-row:last-child {
    width: 400px;
    height: 44px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 0;
    padding: 12px 20px;
  }

  .bili-input-row + .bili-input-row {
    border-top: 1px solid #e3e5e7;
  }

  .bili-input-row input {
    height: 20px;
    border: 0;
    padding: 0;
    color: #18191c;
    font-size: 14px;
    line-height: 20px;
  }

  .bili-input-row input::placeholder {
    color: #9499a0;
  }

  .bili-login-actions {
    width: 400px;
    grid-template-columns: 196px 194px;
    gap: 10px;
    margin-top: 20px;
  }

  .bili-login-actions button {
    height: 40px;
    display: block;
    border-radius: 8px;
    padding: 0;
    font-size: 14px;
    line-height: 40px;
  }

  .bili-login-actions .btn_other {
    width: 196px;
    height: 42px;
    border: 1px solid #e3e5e7;
    color: #18191c;
    background: #fff;
  }

  .bili-login-actions .primary {
    width: 194px;
    border: 0;
    background: #7bd3f7;
    box-shadow: none;
  }

  .bili-login-actions.single .primary {
    width: 400px;
    border: 0;
    background: #00aeec;
  }

  .bili-login-status {
    position: absolute;
    top: 198px;
    left: 0;
    width: 402px;
    min-height: 18px;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bili-login-status:empty {
    display: none;
  }

  .bili-third-title {
    margin-top: 24px;
    font-size: 13px;
    line-height: 18px;
  }

  .bili-third-list {
    width: 336px;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 12px auto 0;
  }

  .bili-third-item {
    justify-content: center;
  }

  .bili-account-row > span,
  .bili-password-row > span {
    width: 28px;
    flex: 0 0 28px;
    margin-right: 20px;
  }

  .bili-account-row > input {
    width: 312px;
    flex: 0 0 312px;
  }

  .bili-password-row > input {
    width: 202px;
    flex: 0 0 202px;
  }

  .bili-input-row .bili-password-eye {
    width: 20px;
    height: 20px;
    min-height: 20px;
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    margin: 0 20px 0 0;
    border: 0;
    padding: 0;
    color: #9499a0;
    background: transparent;
    box-shadow: none;
  }

  .bili-password-eye svg {
    grid-area: 1 / 1;
    width: 20px;
    height: 20px;
  }

  .bili-password-eye .eye-open,
  .bili-password-eye.is-visible .eye-closed {
    display: none;
  }

  .bili-password-eye.is-visible .eye-open {
    display: block;
  }

  .bili-password-row > a {
    width: 70px;
    flex: 0 0 70px;
    color: #00a1d6;
    font-size: 14px;
    line-height: 20px;
  }

  .sms-phone-row {
    padding: 12px 20px;
  }

  .bili-input-row .sms-country-code {
    width: 42px;
    height: 20px;
    min-height: 20px;
    display: flex;
    flex: 0 0 42px;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 20px 0 0;
    border: 0;
    padding: 0;
    color: #18191c;
    font-size: 14px;
    line-height: 20px;
  }

  .sms-caret {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
  }

  .sms-phone-row > input {
    width: 206px;
    flex: 0 0 206px;
  }

  .sms-vertical-line {
    width: 2px;
    height: 26px;
    flex: 0 0 2px;
    margin-right: 20px;
    background: #e3e5e7;
  }

  .sms-phone-row #sendBiliSmsBtn {
    width: 70px;
    height: 20px;
    min-height: 20px;
    flex: 0 0 70px;
    border: 0;
    border-left: 0;
    padding: 0;
    color: #c9ccd0;
    font-size: 14px;
    line-height: 20px;
  }

  .sms-phone-row #sendBiliSmsBtn:not(:disabled) {
    color: #00aeec;
  }

  .sms-code-row {
    padding: 12px 20px;
  }

  .sms-code-row > span {
    width: 42px;
    flex: 0 0 42px;
    justify-content: flex-start;
    margin-right: 20px;
  }

  .sms-code-row > input {
    width: 298px;
    flex: 0 0 298px;
  }

  .bili-login-actions.single {
    width: 400px;
    grid-template-columns: 400px;
  }

  .sms-country-menu {
    left: 0;
    top: 46px;
    width: 222px;
    max-height: 214px;
    border: 1px solid #e3e5e7;
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  }

  .sms-country-menu button {
    width: 220px;
    height: 32px;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 20px;
  }

  .bili-login-policy {
    position: absolute;
    left: 50%;
    top: 363px;
    z-index: 2;
    width: 420px;
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 19px;
    transform: translateX(-50%);
  }
}

@media (max-width: 720px) {
  .bili-login-dialog {
    width: calc(100% - 20px);
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .bili-login-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding: 48px 20px 20px;
  }

  .bili-qr-panel {
    min-height: 340px;
  }

  .bili-qr-panel::after {
    display: none;
  }

  .bili-form-panel::before {
    display: none;
  }

  .bili-login-status:empty {
    display: none;
  }

  .bili-password-row {
    grid-template-columns: 48px minmax(0, 1fr) 20px auto;
  }

  .bili-input-row .bili-password-eye {
    width: 20px;
    height: 20px;
    min-height: 20px;
    display: grid;
    place-items: center;
    margin-right: 12px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .bili-password-eye svg {
    grid-area: 1 / 1;
    width: 20px;
    height: 20px;
  }

  .bili-password-eye .eye-open,
  .bili-password-eye.is-visible .eye-closed {
    display: none;
  }

  .bili-password-eye.is-visible .eye-open {
    display: block;
  }

  .sms-phone-row {
    grid-template-columns: 74px minmax(0, 1fr) 1px 112px;
  }

  .sms-vertical-line {
    width: 1px;
    height: 26px;
    background: #e3e5e7;
  }

  .bili-login-policy {
    padding: 12px 24px 22px;
  }
}

/* Unified page title actions */
.page-head.page-title-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  row-gap: 8px;
}

.page-head.page-title-card > div:first-child {
  min-width: 0;
}

.page-head .page-action-button,
.page-head .page-actions > button,
.page-head .page-actions > .plain-select,
.page-head .page-actions > input {
  height: 36px;
  min-height: 36px;
  margin: 0;
  border-radius: 8px;
  line-height: 34px;
  white-space: nowrap;
}

.page-head .page-action-button {
  justify-self: end;
  min-width: 96px;
  padding-inline: 18px;
}

.page-head .page-actions {
  display: grid;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.page-head .page-actions-2 {
  grid-template-columns: 220px 104px;
}

.page-head .page-actions-3 {
  grid-template-columns: 200px repeat(2, 112px);
}

.page-head .page-actions-5 {
  grid-template-columns: 190px repeat(4, 116px);
}

.page-head .page-actions > .plain-select,
.page-head .page-actions > input,
.page-head .page-actions > button {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding-block: 0;
  flex: none;
}

.page-head .page-actions > button {
  overflow: hidden;
  padding-inline: 14px;
  text-overflow: ellipsis;
}

.page-head .common-upgrade-toolbar {
  grid-template-columns: 190px 108px 132px 160px 108px;
  grid-template-rows: 36px 20px;
  max-width: none;
}

.page-head .common-upgrade-toolbar > :not(.page-action-status) {
  grid-row: 1;
}

.page-head .page-action-status {
  grid-row: 2;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 20px;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: #77839a;
  font-size: 12px;
  line-height: 20px;
  text-align: left;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .page-head.page-title-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .page-head .page-action-button,
  .page-head .page-actions {
    justify-self: start;
  }
}

@media (max-width: 900px) {
  .page-head.page-title-card {
    width: 100%;
    min-width: 0;
  }

  .page-head .page-actions,
  .page-head .page-actions-2,
  .page-head .page-actions-3,
  .page-head .page-actions-5,
  .page-head .common-upgrade-toolbar,
  .page-head .theme-rush-account-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }

  .page-head .page-actions > select:first-child {
    grid-column: 1 / -1;
  }

  .page-head .page-actions-2 > button:last-child {
    grid-column: 1 / -1;
  }

  .page-head .common-upgrade-toolbar > :not(.page-action-status) {
    grid-row: auto;
  }

  .page-head .page-action-status {
    grid-row: auto;
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-head.page-title-card {
    gap: 14px;
  }

  .page-head .page-action-button {
    width: 100%;
    justify-self: stretch;
  }

  .page-head .page-actions > button,
  .page-head .page-actions > .plain-select,
  .page-head .page-actions > input {
    height: 36px;
    min-height: 36px;
    line-height: 34px;
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

@media (max-width: 420px) {
  .page-title-card {
    padding: 18px 16px;
  }

  .stat-card {
    min-height: 124px;
    padding: 20px;
  }

  .theme-rush-time-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bili-login-actions,
  .bili-login-actions.single {
    grid-template-columns: 1fr;
  }

  .bili-login-actions button,
  .bili-login-actions.single .primary {
    width: 100%;
  }

  .bili-third-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bili-third-item {
    min-width: 0;
    padding-inline: 4px;
  }
}

/* Theme rush workspace */
#userThemeRushView .theme-rush-page-head {
  margin-bottom: 12px;
}

.theme-rush-account-tools {
  flex-wrap: nowrap;
}

.theme-rush-account-tools .plain-select {
  min-width: 220px;
}

.theme-rush-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.theme-rush-status-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  row-gap: 3px;
  min-width: 0;
  padding: 14px 18px;
}

.theme-rush-status-item + .theme-rush-status-item {
  border-left: 1px solid #e8edf5;
}

.theme-rush-status-item span {
  color: #7c889e;
  font-size: 12px;
  white-space: nowrap;
}

.theme-rush-status-item strong {
  min-width: 0;
  color: #20293a;
  font-size: 20px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-rush-status-item small {
  grid-column: 1 / -1;
  min-width: 0;
  color: #65738a;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-rush-workbench {
  display: grid;
  grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.theme-rush-editor {
  position: static;
  align-self: start;
  border-radius: 12px;
  overflow: hidden;
}

.theme-rush-editor .push-config-form {
  padding: 16px 20px 20px;
}

.theme-rush-editor,
.theme-rush-editor .push-config-form,
.theme-rush-editor .form-grid-2,
.theme-rush-editor label {
  min-width: 0;
  max-width: 100%;
}

.theme-rush-editor .checkbox-line {
  min-width: 0;
}

#themeRushItemName[readonly] {
  color: #526178;
  background: #f5f8fc;
  cursor: text;
}

#themeRushCollectionCouponField {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
}

#themeRushCollectionCouponField.hidden {
  display: none;
}

#themeRushCollectionCouponField > span,
#themeRushCollectionCouponField > small {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#themeRushCollectionCouponField > small {
  grid-column: 2;
  margin-left: 0;
  text-align: left;
}

@media (min-width: 721px) {
  #userAccountsView .action-cell .row-actions {
    justify-content: flex-start;
  }
}

.theme-rush-editor .theme-rush-time-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-rush-reference-column {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.theme-presale-panel {
  min-width: 0;
  overflow: hidden;
}

.theme-presale-table-scroll {
  width: 100%;
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b7c7ff transparent;
}

.theme-presale-table-scroll .theme-presale-table {
  margin: 0;
}

.theme-presale-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7faff;
}

.theme-rush-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.theme-rush-detail-panel,
.theme-rush-rank-panel {
  min-width: 0;
  overflow: hidden;
}

.theme-rush-detail-panel .theme-detail-box {
  margin: 16px;
}

.theme-rush-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  margin: 8px -20px -20px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5ebf4;
  border-radius: 0 0 12px 12px;
  background: #ffffff;
}

.theme-rush-form-actions button {
  width: 100%;
  min-width: 0;
  height: 40px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .theme-rush-workbench {
    grid-template-columns: minmax(360px, 400px) minmax(0, 1fr);
  }

  .theme-rush-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .theme-rush-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-rush-editor {
    position: static;
  }

  .theme-rush-insight-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-presale-table-scroll {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }
}

@media (max-width: 720px) {
  .theme-tasks-table tbody tr {
    position: relative;
  }

  .theme-tasks-table .theme-task-selection-col {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 18px;
    min-width: 18px;
    display: flex;
    padding: 0;
  }

  .theme-tasks-table .theme-task-selection-col::before {
    display: none;
  }

  .theme-tasks-table .mobile-primary-cell {
    padding-right: 36px;
  }

  #userThemeRushView .theme-rush-page-head {
    gap: 14px;
  }

  .theme-rush-account-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .theme-rush-account-tools .plain-select {
    width: 100%;
    min-width: 0;
  }

  .theme-rush-status-strip {
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .theme-rush-status-item {
    display: flex;
    min-width: 0;
    padding: 11px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .theme-rush-status-item strong {
    width: 100%;
    font-size: 17px;
  }

  .theme-rush-status-item small {
    width: 100%;
  }

  .theme-rush-workbench,
  .theme-rush-reference-column,
  .theme-rush-insight-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .theme-rush-editor .push-config-form {
    padding: 14px 16px 16px;
  }

  .theme-rush-form-actions {
    margin: 8px -16px -16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }

  .theme-rush-form-actions button {
    min-height: 40px;
    line-height: 1;
    white-space: nowrap;
  }

  .theme-presale-table-scroll {
    overflow: visible;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }
}

/* Shared card sizing and typography */
:root {
  --card-title-font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --card-radius: 12px;
  --card-head-height: 72px;
  --stat-card-height: 132px;
}

.page-title-card,
.stat-card,
.panel,
.config-card,
.log-card {
  min-width: 0;
  border-radius: var(--card-radius);
}

.page-title-card {
  min-height: 100px;
}

.stats-grid {
  grid-auto-rows: minmax(var(--stat-card-height), auto);
  align-items: stretch;
}

.stat-card {
  width: 100%;
  height: 100%;
  min-height: var(--stat-card-height);
  padding: 22px 24px;
}

.panel-head,
.content-card-head {
  min-height: var(--card-head-height);
  padding: 16px 24px;
}

.page-head h1,
.panel-head h2,
.content-card-head h2,
.config-card-head h3,
.log-card-head h3 {
  margin: 0;
  color: #2b3345;
  font-family: var(--card-title-font);
  font-weight: 700;
  letter-spacing: 0;
}

.page-head h1 {
  font-size: 20px;
  line-height: 28px;
}

.panel-head h2,
.content-card-head h2,
.config-card-head h3,
.log-card-head h3 {
  font-size: 16px;
  line-height: 24px;
}

.panel-head p,
.content-card-head p,
.config-card-head p,
.log-card-head p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 20px;
}

.stat-card > div:first-child > span {
  font-family: var(--card-title-font);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
}

@media (max-width: 720px) {
  :root {
    --card-head-height: 68px;
    --stat-card-height: 124px;
  }

  .page-title-card {
    min-height: 88px;
    padding: 16px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    min-height: var(--stat-card-height);
    padding: 20px;
  }

  .panel-head,
  .content-card-head {
    min-height: var(--card-head-height);
    padding: 14px 16px;
  }
}
