:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --soft: #f3f6fb;
  --line: #e9eef7;
  --line-strong: #dce5f2;
  --text: #172448;
  --muted: #7180a0;
  --blue: #1f7bff;
  --green: #16bb8a;
  --orange: #ff8624;
  --purple: #8747e8;
  --red: #ff4d4f;
  --teal: #09b8c5;
  --shadow: 0 10px 26px rgba(26, 48, 86, 0.045);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
body.auth-mode {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 92, 176, .34), transparent 30%),
    radial-gradient(circle at 82% 28%, rgba(38, 135, 255, .30), transparent 34%),
    linear-gradient(135deg, #f9fbff 0%, #eef5ff 38%, #fff0fa 72%, #edf6ff 100%);
  animation: authBreathBg 8s ease-in-out infinite alternate;
  overflow-x: hidden;
}
html.auth-mode {
  overflow-x: hidden;
}
body.auth-mode::before,
body.auth-mode::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 36vw;
  height: 36vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 50%;
  filter: blur(52px);
  opacity: .62;
  pointer-events: none;
  transform: translateZ(0);
}
body.auth-mode::before {
  left: 0;
  top: 12vh;
  background: radial-gradient(circle, rgba(255, 76, 172, .58) 0%, rgba(255, 137, 207, .28) 42%, transparent 70%);
  animation: authBreathPink 6.8s ease-in-out infinite alternate;
}
body.auth-mode::after {
  right: 0;
  bottom: 4vh;
  background: radial-gradient(circle, rgba(29, 126, 255, .56) 0%, rgba(114, 168, 255, .30) 44%, transparent 72%);
  animation: authBreathBlue 7.4s ease-in-out infinite alternate;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.68); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.shell { min-height: 100vh; }
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon,
.nav-icon,
.member-nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}
body.auth-mode .topbar {
  position: relative;
  z-index: 1;
  background: transparent;
}
body.auth-mode .topbar h1 {
  color: #12224a;
}
body.auth-mode .topbar p {
  color: rgba(28, 43, 78, .62);
}

h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.topbar p, .table-toolbar span, .metric span, label span { color: var(--muted); font-size: 12px; }
.session-bar { display: flex; align-items: center; gap: 10px; }

.auth-grid {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(48, 88, 160, .16), 0 8px 24px rgba(236, 83, 174, .10);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.tabs, .source-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}

.auth-card .tabs { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.auth-panel { display: grid; gap: 12px; padding: 18px; }
.auth-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 4px;
}
.auth-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1f7bff 0%, #ec5bb0 130%);
  box-shadow: 0 12px 28px rgba(31, 123, 255, .22);
}
.auth-logo .icon {
  width: 23px;
  height: 23px;
}
.auth-heading p,
.auth-tip {
  color: #7180a0;
  font-size: 12px;
}
.auth-tip {
  margin: 0;
  text-align: center;
}
body.auth-mode .auth-card .tabs {
  background: rgba(245, 249, 255, .72);
  border-bottom-color: rgba(210, 222, 246, .8);
  padding: 6px;
}
body.auth-mode .auth-panel {
  padding: 20px;
}
body.auth-mode .tab {
  border-radius: 10px;
}
body.auth-mode .tab.is-active {
  background: rgba(255,255,255,.96);
  color: #1f7bff;
  box-shadow: 0 8px 22px rgba(31, 123, 255, .12);
}
body.auth-mode input {
  border-color: rgba(196, 211, 240, .92);
  background: rgba(255,255,255,.74);
}
body.auth-mode .primary-action {
  border-radius: 10px;
  background: linear-gradient(135deg, #1f7bff 0%, #278fff 48%, #ec5bb0 130%);
  box-shadow: 0 14px 30px rgba(31, 123, 255, .22);
}
.notice { min-height: 22px; padding: 0 18px 18px; color: var(--red); font-size: 13px; }
.tab, .source-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
}
.tab.is-active, .source-button.is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(30, 80, 160, 0.08);
}

label { display: grid; gap: 6px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fbfcff;
  min-height: 36px;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(36, 120, 255, 0.16); border-color: var(--blue); }

.primary-action, .secondary-action, .ghost-button, .icon-button, .admin-user, .table-icon, .menu-button {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 34px;
  padding: 0 14px;
  font-weight: 600;
}
.primary-action { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(36, 120, 255, 0.18); }
.secondary-action { background: #eef5ff; color: var(--blue); border-color: #d6e5ff; }
.ghost-button { background: #fff; border-color: var(--line-strong); color: var(--text); }
.with-icon,
.collapse-button,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.icon-only { width: 34px; padding: 0; }
.wide { width: 100%; }

/* Admin shell */
.admin-app {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.admin-app.is-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}
.admin-app.is-collapsed .admin-sidebar {
  padding-inline: 12px;
}
.admin-app.is-collapsed .admin-brand strong,
.admin-app.is-collapsed .brand-chip,
.admin-app.is-collapsed .admin-nav-item span,
.admin-app.is-collapsed .collapse-button span {
  display: none;
}
.admin-app.is-collapsed .admin-nav-item,
.admin-app.is-collapsed .collapse-button {
  justify-content: center;
  padding-inline: 0;
  font-size: 0;
}
.admin-app.is-collapsed .collapse-button {
  font-size: 0;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 17px 16px 18px;
  color: #fff;
  background: linear-gradient(180deg, #f25aa6 0%, #bf63db 37%, #6c83f0 66%, #2386ff 100%);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-bottom: 31px;
}
.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.95);
  border-radius: 7px;
}
.brand-mark .icon {
  width: 21px;
  height: 21px;
}
.admin-brand strong {
  font-size: 17px;
  letter-spacing: .2px;
  margin-right: auto;
}
.brand-chip {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 5px;
  color: #fff;
}
.brand-chip .icon {
  width: 14px;
  height: 14px;
}
.brand-chip-orange { background: #ff9d1f; }
.brand-chip-violet { background: #8f78ff; }

.admin-nav {
  display: grid;
  gap: 12px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 51px;
  border: 0;
  border-radius: 7px;
  padding: 0 15px;
  color: rgba(255,255,255,.92);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}
.admin-nav-item .nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.admin-nav-item.is-active {
  background: rgba(255,255,255,.9);
  color: #52648d;
  box-shadow: 0 8px 22px rgba(66, 75, 120, .1);
}
.admin-nav-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
}
.admin-nav-item.is-active:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(66, 120, 255, .18), 0 8px 22px rgba(66, 75, 120, .1);
}
.collapse-button {
  margin-top: auto;
  border: 0;
  color: #fff;
  background: transparent;
  min-height: 42px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  padding: 0 10px;
}

.admin-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr);
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 22px;
}
.menu-button {
  width: 30px;
  padding: 0;
  color: #1e3159;
  background: transparent;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.crumb i {
  color: #b0b9cc;
  font-style: normal;
}
.crumb b { color: var(--text); }
.admin-tools {
  display: flex;
  align-items: center;
  gap: 13px;
}
.topbar-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(23, 36, 72, 0.14);
  color: #172448;
}
.topbar-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: #fff;
}
.dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f7;
}
.dropdown-head h3 {
  font-size: 14px;
  color: #172448;
}
.notify-dropdown {
  width: 326px;
}
.notify-list {
  max-height: 320px;
  overflow: auto;
  padding: 8px;
}
.notify-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 9px;
  border-radius: 7px;
}
.notify-item:hover {
  background: #f7f9fd;
}
.notify-item > span {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--blue);
}
.notify-item.danger > span { background: var(--red); }
.notify-item.warning > span { background: var(--orange); }
.notify-item.info > span { background: var(--blue); }
.notify-item strong {
  display: block;
  font-size: 13px;
  color: #172448;
}
.notify-item p {
  margin-top: 3px;
  color: #52668e;
  font-size: 12px;
  line-height: 1.45;
}
.notify-item time {
  display: block;
  margin-top: 5px;
  color: #95a0b8;
  font-size: 11px;
}
.notify-empty {
  padding: 28px 12px;
  color: #8190ad;
  text-align: center;
  font-size: 13px;
}
.dropdown-footer {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-top: 1px solid #edf1f7;
  background: #fbfcff;
  color: var(--blue);
  font-weight: 700;
}
.user-dropdown {
  width: 158px;
  padding: 7px;
}
.user-dropdown button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #263a64;
  padding: 0 10px;
  font-weight: 700;
  text-align: left;
}
.user-dropdown button:hover {
  background: #f3f7ff;
  color: var(--blue);
}
.user-dropdown .icon {
  width: 15px;
  height: 15px;
}
.search-box,
.table-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #edf1f8;
  background: #f7f9fd;
  border-radius: 6px;
  padding: 0 10px;
}
.search-box .icon,
.table-search-wrap .icon {
  width: 15px;
  height: 15px;
  color: #8b96ad;
}
.admin-search {
  width: 214px;
  min-height: 30px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 13px;
}
.icon-button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  color: #172448;
  position: relative;
}
.icon-button .icon {
  width: 18px;
  height: 18px;
}
.notify-button span {
  position: absolute;
  right: -4px;
  top: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
}
.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: #172448;
  padding: 0;
  min-height: 32px;
}
.admin-user b {
  font-size: 13px;
}
.admin-user i {
  color: #7180a0;
  font-style: normal;
  font-size: 12px;
}
.avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8deea 0%, #aeb8ca 100%);
  position: relative;
}
.avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
}
.admin-content { padding: 16px; }
.admin-page { display: none; }
.admin-page.is-active { display: block; }

.stat-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  min-height: 126px;
  display: flex;
  align-items: center;
  gap: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 22px 22px;
  box-shadow: var(--shadow);
}
.stat-card p { color: #33466d; font-size: 13px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 29px; line-height: 1.05; color: #172448; }
.stat-card small { display: block; margin-top: 16px; color: var(--green); font-size: 12px; }
.stat-card small.is-down { color: var(--red); }
.stat-card small.is-up { color: var(--green); }
.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 7px;
  font-weight: 800;
}
.stat-icon .icon {
  width: 23px;
  height: 23px;
}
.stat-icon.blue { background: var(--blue); }
.stat-icon.green { background: var(--green); }
.stat-icon.orange { background: var(--orange); }
.stat-icon.purple { background: var(--purple); }
.stat-icon.teal { background: var(--teal); }

.dashboard-grid, .stats-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: start;
}
.dashboard-grid > *, .stats-layout > * { min-width: 0; }
.span-2 { grid-column: span 1; }
.span-3 { grid-column: 1 / -1; }
.stats-layout .span-2 { grid-column: span 1; }
.dashboard-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.admin-dashboard table,
#admin-dashboard table {
  min-width: 650px;
}

.admin-card, .filter-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-head, .page-head, .table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2,
.page-head h2 {
  font-size: 17px;
  color: #172448;
}
.card-head p, .page-head p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.button-row.compact { display: flex; align-items: center; }
.button-row.right { justify-content: flex-end; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #fff;
}
.table-wrap.clean { border: 0; border-radius: 0; }
table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid #edf1f7;
  padding: 14px 12px;
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
  color: #31446d;
}
th {
  color: #172448;
  font-weight: 800;
  background: #fff;
}
tbody tr:hover { background: #fbfdff; }
.empty { color: var(--muted); text-align: center; padding: 40px 12px; }
.table-search {
  width: 260px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
}
.table-icon {
  min-height: 28px;
  padding: 0 4px;
  background: transparent;
  color: #253964;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.table-actions .table-icon {
  width: 22px;
}
.table-actions .danger { color: var(--red); }
.table-actions .primary { color: var(--blue); }
.table-action .icon {
  width: 14px;
  height: 14px;
}
.text-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.link-action {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}
.link-action.danger {
  color: var(--red);
}

.mini-progress {
  display: inline-block;
  width: 98px;
  height: 4px;
  background: #e8edf6;
  border-radius: 999px;
  overflow: hidden;
  margin-right: 8px;
  vertical-align: middle;
}
.mini-progress span { display: block; height: 100%; background: var(--blue); }
.source-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}
.source-badge.fanqie { background: #fff2e7; color: #e36a16; }
.source-badge.qimao { background: #efeaff; color: #7445d8; }
.status-badge.ok { background: #e8f8f2; color: var(--green); }
.status-badge.bad { background: #fff0f0; color: var(--red); }
.status-badge.warn { background: #fff5e8; color: var(--orange); }
.status-badge.info { background: #eef5ff; color: var(--blue); }

.filter-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  gap: 12px;
  align-items: center;
}
.filter-card.flat {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  box-shadow: none;
  margin-bottom: 0;
  padding: 0 0 16px;
  border: 0;
}

.sub-tabs {
  display: flex;
  gap: 37px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-left: 20px;
}
.sub-tabs button {
  min-height: 43px;
  border: 0;
  background: transparent;
  color: #52668e;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}
.sub-tabs button.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.settings-panel { display: none; }
.settings-panel.is-active { display: block; }
.hint-bar {
  background: #e8f3ff;
  border: 1px solid #c8defa;
  color: #315f9b;
  border-radius: 6px;
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}
.api-config-list { display: grid; gap: 18px; }
.settings-admin-card {
  display: grid;
  gap: 18px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.settings-grid label {
  display: grid;
  gap: 7px;
}
.settings-grid label > span {
  color: #647596;
  font-size: 12px;
  font-weight: 700;
}
.settings-grid input,
.settings-grid select {
  width: 100%;
}
.toggle-line {
  min-height: 58px;
  display: flex !important;
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: flex-start;
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.toggle-line input {
  width: 16px;
  min-height: 16px;
}
.settings-save-admin {
  justify-self: start;
  min-width: 104px;
}
.settings-feedback,
.provider-status {
  min-height: 18px;
  color: #1d8c55;
  font-size: 12px;
  font-weight: 700;
}
.settings-feedback.is-error,
.provider-status.is-error {
  color: var(--red);
}
.api-provider {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 96px;
  gap: 17px;
  align-items: start;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.provider-logo {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}
.provider-logo b {
  position: relative;
  z-index: 1;
  font-size: 15px;
}
.provider-logo.tomato { background: linear-gradient(135deg, #ff5c22 0%, #ff9c32 100%); }
.provider-logo.tomato::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 8px;
  border-radius: 999px 999px 2px 2px;
  background: #fff3e8;
}
.provider-logo.qimao { background: #ffd629; color: #121214; }
.provider-logo.qimao::before {
  content: "";
  position: absolute;
  inset: 10px 8px 7px;
  border-radius: 50% 50% 44% 44%;
  background: #111217;
}
.provider-logo.qimao::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 16px 0 0 #fff;
}
.provider-logo.qimao b {
  opacity: 0;
}
.provider-body { display: grid; gap: 10px; }
.provider-body h3 {
  margin-bottom: 6px;
  font-size: 16px;
}
.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px 26px;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: #fbfcff;
  min-height: 36px;
  border-radius: 7px;
}
.secret-field input {
  min-height: 34px;
  border: 0;
  background: transparent;
}
.secret-field .icon {
  width: 15px;
  height: 15px;
  color: #647596;
}
.secret-tool {
  width: 26px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid transparent;
  background: transparent;
  color: #647596;
  cursor: pointer;
}
.secret-tool:hover {
  color: var(--blue);
  background: #edf5ff;
}
.secret-tool:focus-visible {
  outline: 2px solid rgba(36, 120, 255, 0.28);
  outline-offset: -2px;
}
.provider-actions {
  display: grid;
  gap: 37px;
  justify-items: stretch;
  padding-top: 39px;
}

.status-stack { display: grid; gap: 12px; }
.system-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.system-row span, .system-row small { color: var(--muted); font-size: 12px; }
.notice-list { margin: 0; padding-left: 18px; color: #344b75; line-height: 1.9; font-size: 13px; }
.more-link {
  color: #95a0b8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.notice-publish-shell {
  max-width: 1110px;
  margin: 0 auto;
}
.notice-main-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  padding: 14px 18px 8px;
}
.notice-page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  margin-bottom: 10px;
}
.notice-page-title h2 {
  font-size: 17px;
}
.notice-back {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #31446d;
  padding: 0;
}
.notice-back .icon {
  width: 17px;
  height: 17px;
}
.notice-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 16px;
  align-items: start;
}
.notice-form-panel,
.notice-side .admin-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
  background: #fff;
}
.notice-form-panel {
  padding: 14px 16px 0;
}
.notice-form-panel h3,
.notice-settings h3 {
  font-size: 14px;
  margin-bottom: 14px;
  color: #172448;
}
.notice-settings {
  margin-top: 23px;
}
.notice-field {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
}
.notice-field > span {
  color: #31446d;
  font-size: 12px;
  font-weight: 800;
}
.notice-field > span b {
  color: var(--red);
  font-weight: 800;
}
.counted-input {
  position: relative;
}
.counted-input input {
  min-height: 36px;
  padding-right: 58px;
}
.counted-input em,
.editor-box > em {
  color: #7f8ba8;
  font-size: 12px;
  font-style: normal;
}
.counted-input em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.choice-grid {
  display: grid;
  gap: 12px;
}
.notice-type-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.notice-scope-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.priority-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.schedule-grid {
  grid-template-columns: repeat(2, minmax(0, 150px));
}
.choice-card {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 11px 9px 30px;
  position: relative;
  gap: 2px;
  cursor: pointer;
}
.choice-card input {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 13px;
  height: 13px;
  min-height: 0;
  accent-color: var(--blue);
  padding: 0;
}
.choice-card strong {
  display: block;
  color: #31446d;
  font-size: 12px;
  line-height: 1.25;
}
.choice-card small {
  display: block;
  color: #7f8ba8;
  font-size: 10px;
  line-height: 1.45;
}
.choice-card.is-selected,
.choice-card:has(input:checked) {
  border-color: #2f82ff;
  background: #f5f9ff;
  box-shadow: inset 0 0 0 1px rgba(47, 130, 255, .1);
}
.editor-box {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 37px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}
.editor-toolbar button {
  width: 27px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #253964;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}
.editor-toolbar button:hover {
  background: #eef5ff;
  color: var(--blue);
}
.editor-toolbar .icon {
  width: 14px;
  height: 14px;
}
.editor-box textarea {
  height: 112px;
  min-height: 112px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 13px 13px 28px;
}
.editor-box textarea:focus {
  outline: none;
  border-color: transparent;
}
.editor-box > em {
  position: absolute;
  right: 10px;
  bottom: 8px;
}
.notice-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0 12px;
}
.notice-side {
  display: grid;
  gap: 16px;
}
.notice-side .admin-card {
  margin: 0;
  padding: 16px;
}
.notice-preview-card {
  min-height: 242px;
}
.notice-preview {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 162px;
  padding: 14px;
}
.notice-preview span {
  display: inline-block;
  background: #eaf4ff;
  color: var(--blue);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 15px;
}
.notice-preview h3 {
  font-size: 15px;
  margin-bottom: 12px;
}
.preview-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #647596;
  font-size: 11px;
  margin: 0 0 12px;
}
.preview-meta i {
  width: 12px;
  height: 12px;
  border: 2px solid #a6b1c6;
  border-radius: 50%;
  font-style: normal;
}
.preview-meta b {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border-radius: 4px;
  background: #fff0f0;
  color: var(--red);
  font-size: 11px;
}
.notice-preview p:last-child {
  color: #52668e;
  line-height: 1.7;
  margin-top: 0;
  font-size: 12px;
}
.notice-guide-card {
  min-height: 174px;
}
.notice-guide-card .notice-list {
  font-size: 12px;
  line-height: 2.05;
  padding-left: 18px;
}

.line-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  align-items: stretch;
  gap: 14px;
  padding: 18px 14px 0;
  border-bottom: 1px solid #e7edf6;
  background: repeating-linear-gradient(to top, transparent 0 43px, #edf2f8 44px), #fff;
}
.trend-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 18px 1fr 25px;
  align-items: end;
  justify-items: stretch;
  text-align: center;
  cursor: default;
}
.trend-column i {
  width: min(68px, 78%);
  min-height: 2px;
  justify-self: center;
  display: block;
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 1px rgba(255,255,255,.3);
  transition: filter .15s ease, transform .15s ease;
}
.trend-column:hover i { filter: brightness(1.04); transform: scaleX(1.04); }
.trend-column span { align-self: center; color: #74819b; font-size: 11px; }
.trend-value { align-self: center; color: #53627d; font-size: 11px; font-weight: 800; }
.line-chart + .chart-legend { padding-top: 14px; }
.mini-chart {
  height: 138px;
  display: grid;
  grid-template-columns: repeat(7, minmax(20px, 1fr));
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 6px;
  border-bottom: 1px solid #eef2f8;
}
.mini-chart-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 15px 1fr 19px;
  align-items: end;
  justify-items: stretch;
  text-align: center;
  cursor: default;
}
.mini-bar-group {
  width: min(48px, 94%);
  height: 100%;
  justify-self: center;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
}
.mini-bar-group i {
  width: 30%;
  min-width: 2px;
  min-height: 2px;
  display: block;
  border-radius: 5px 5px 0 0;
  transition: filter .15s ease, transform .15s ease;
}
.mini-bar-group .is-total { background: var(--blue); }
.mini-bar-group .is-done { background: var(--green); }
.mini-bar-group .is-failed { background: var(--red); }
.mini-chart-column:hover i { filter: brightness(1.04); transform: scaleX(1.08); }
.mini-chart-column b { align-self: center; color: #53627d; font-size: 10px; }
.mini-chart-column span { align-self: center; color: #7b88a1; font-size: 9px; }
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 12px;
  color: #657491;
  font-size: 11px;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.chart-legend .green-dot::before { background: var(--green); }
.chart-legend .red-dot::before { background: var(--red); }
.chart-legend .blue-dot::before { background: var(--blue); }
.donut {
  width: 190px;
  height: 190px;
  margin: 18px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7edf6;
  color: var(--text);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  background: #fff;
  border-radius: 50%;
}
.donut-center { position: relative; z-index: 1; display: grid; place-items: center; gap: 3px; }
.donut-center b { font-size: 24px; }
.donut-center span { color: var(--muted); font-size: 12px; }
.donut.second { background: #e7edf6; }
.distribution-legend { display: grid; gap: 8px; margin: 0 auto 4px; max-width: 260px; }
.distribution-legend > div { display: grid; grid-template-columns: minmax(80px, 1fr) auto 42px; align-items: center; gap: 8px; color: #52617c; font-size: 11px; }
.distribution-legend span { display: inline-flex; align-items: center; gap: 7px; }
.distribution-legend i { width: 8px; height: 8px; border-radius: 2px; }
.distribution-legend b { color: #253658; }
.distribution-legend em { color: #8190aa; font-style: normal; text-align: right; }

.inline-form, .key-form {
  display: grid;
  grid-template-columns: 1.2fr 110px 110px 1.4fr auto;
  gap: 10px;
  margin-bottom: 14px;
}
code {
  color: #315b93;
  background: #eef5ff;
  border-radius: 5px;
  padding: 3px 6px;
}

/* Member area */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px;
  margin: 0 18px 14px;
}
.metric, .panel, .workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.metric {
  min-height: 58px;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.metric strong { font-size: 16px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
  padding: 0 18px 18px;
}
.workspace { border-radius: 8px; min-height: 640px; overflow: hidden; }
.workspace .tabs { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; justify-content: flex-start; padding: 8px; }
.tab-panel { display: none; padding: 14px; }
.tab-panel.is-active { display: block; }
.side-panel, .logs, .tasks { display: grid; gap: 10px; }
.panel { border-radius: 8px; padding: 12px; display: grid; gap: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.logs-panel { min-height: 160px; }
.log-line { color: #344b75; font-size: 12px; line-height: 1.45; border-bottom: 1px solid #edf1f7; padding-bottom: 6px; }
.task { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fbfcff; display: grid; gap: 8px; }
.task-head { display: flex; justify-content: space-between; gap: 12px; }
.task-title { font-weight: 700; }
.badge { min-width: 64px; text-align: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #eef5ff; color: var(--blue); }
.badge.done { background: #e8f8f2; color: var(--green); }
.badge.failed { background: #fff0f0; color: var(--red); }
.progress { height: 7px; border-radius: 999px; background: #e8edf6; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--blue); }
.file-link { color: var(--blue); text-decoration: none; font-size: 12px; }

@keyframes authBreathBg {
  0% { background-position: 0% 50%; filter: saturate(1); }
  100% { background-position: 100% 50%; filter: saturate(1.08); }
}

@keyframes authBreathPink {
  0% { transform: translate3d(0, 0, 0) scale(.92); opacity: .46; }
  100% { transform: translate3d(2vw, 3vh, 0) scale(1.12); opacity: .72; }
}

@keyframes authBreathBlue {
  0% { transform: translate3d(0, 0, 0) scale(.94); opacity: .44; }
  100% { transform: translate3d(-2vw, -4vh, 0) scale(1.14); opacity: .70; }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-mode,
  body.auth-mode::before,
  body.auth-mode::after {
    animation: none;
  }
}

/* Member console */
.member-app {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.member-app.is-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}
.member-app.is-collapsed .member-sidebar {
  padding-inline: 12px;
}
.member-app.is-collapsed .member-brand strong,
.member-app.is-collapsed .member-brand-chip,
.member-app.is-collapsed .member-nav-item span,
.member-app.is-collapsed .member-collapse-button span {
  display: none;
}
.member-app.is-collapsed .member-nav-item,
.member-app.is-collapsed .member-collapse-button {
  justify-content: center;
  padding-inline: 0;
  font-size: 0;
}
.member-app.is-collapsed .member-collapse-button {
  font-size: 0;
}
.member-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 17px 16px 18px;
  color: #fff;
  background: linear-gradient(180deg, #f25aa6 0%, #bf63db 37%, #6c83f0 66%, #2386ff 100%);
}
.member-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-bottom: 31px;
}
.member-brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.95);
  border-radius: 9px;
}
.member-brand-mark .icon {
  width: 21px;
  height: 21px;
}
.member-brand strong {
  font-size: 17px;
  letter-spacing: .2px;
  margin-right: auto;
}
.member-brand-chip {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 6px;
  color: #fff;
}
.member-brand-chip .icon {
  width: 14px;
  height: 14px;
}
.member-brand-chip-orange { background: #ff9d1f; }
.member-brand-chip-violet { background: #8f78ff; }
.member-nav {
  display: grid;
  gap: 13px;
}
.member-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 51px;
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  color: rgba(255,255,255,.92);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}
.member-nav-item .member-nav-icon {
  width: 20px;
  height: 20px;
}
.member-nav-item.is-active {
  background: rgba(255,255,255,.92);
  color: #52648d;
  box-shadow: 0 10px 24px rgba(66, 75, 120, .12);
}
.member-nav-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
}
.member-nav-item.is-active:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(66, 120, 255, .18), 0 10px 24px rgba(66, 75, 120, .12);
}
.member-collapse-button {
  margin-top: auto;
  border: 0;
  color: #fff;
  background: transparent;
  min-height: 42px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
}
.member-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr);
}
.member-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
}
.member-topbar-left {
  display: flex;
  align-items: center;
  gap: 22px;
}
.member-menu-button {
  width: 30px;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #1e3159;
  background: transparent;
  font-weight: 600;
}
.member-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.member-crumb i {
  color: #b0b9cc;
  font-style: normal;
}
.member-crumb b {
  color: var(--text);
}
.member-tools {
  display: flex;
  align-items: center;
  gap: 13px;
}
.member-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #edf1f8;
  background: #f7f9fd;
  border-radius: 8px;
  padding: 0 10px;
}
.member-search-box .icon {
  width: 15px;
  height: 15px;
  color: #8b96ad;
}
.member-search {
  width: 214px;
  min-height: 30px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 13px;
}
.member-icon-button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #172448;
  position: relative;
}
.member-icon-button .icon {
  width: 18px;
  height: 18px;
}
.member-notify-button span {
  position: absolute;
  right: -4px;
  top: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
}
.member-user-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #172448;
  padding: 0;
  font-weight: 700;
}
.member-user-button b {
  font-size: 13px;
}
.member-user-button i {
  color: #7180a0;
  font-style: normal;
  font-size: 12px;
}
.member-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8deea 0%, #aeb8ca 100%);
  position: relative;
}
.member-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
}
.member-content {
  padding: 16px;
  min-width: 0;
}
.member-page { display: none; }
.member-page.is-active { display: block; }

.ranking-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ranking-platform-tabs {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.ranking-platform-tab {
  flex: 0 1 240px;
  width: min(240px, 100%);
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.ranking-platform-tab > span:last-child {
  display: grid;
  gap: 3px;
}
.ranking-platform-tab b { font-size: 14px; }
.ranking-platform-tab small { color: var(--muted); font-size: 11px; }
.ranking-platform-tab:hover { border-color: #aabcf0; transform: translateY(-1px); }
.ranking-platform-tab.is-active {
  border-color: #7fa8f8;
  background: linear-gradient(135deg, rgba(255, 241, 249, .96), rgba(239, 246, 255, .98));
  box-shadow: 0 10px 26px rgba(63, 92, 190, .12);
}
.ranking-platform-tab .member-source-logo { flex: 0 0 30px; width: 30px; height: 30px; }
.ranking-platform-tab .member-source-logo .icon { width: 18px; height: 18px; }
.ranking-pull-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.ranking-pull {
  min-width: 118px;
  white-space: nowrap;
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .2);
}
.ranking-pull:hover {
  border-color: #d97706;
  background: #d97706;
}
.ranking-help-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: #60708c;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
}
.ranking-help-button:hover {
  border-color: #7fa8f8;
  color: #2563eb;
  background: #f5f8ff;
}
.ranking-pull-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #f5d38b;
  border-radius: 8px;
  color: #7a5414;
  background: #fff9e9;
}
.ranking-pull-notice span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #e7a72d;
  font-weight: 800;
}
.ranking-pull-notice p { margin: 0; font-size: 13px; font-weight: 700; }
.ranking-pull-dialog { width: min(460px, calc(100vw - 32px)); }
.ranking-pull-dialog .user-edit-head { margin-bottom: 16px; }
.ranking-qimao-filter { min-width: 140px; }
.admin-ranking-qimao-filter { min-width: 140px; }
.ranking-increment { margin-left: 4px; color: #079669; font-size: 11px; white-space: nowrap; }
.ranking-table.is-qimao { width: 100%; min-width: 1412px; }
.ranking-table.is-qimao th:nth-child(1) { width: 56px; }
.ranking-table.is-qimao th:nth-child(2) { width: 190px; }
.ranking-table.is-qimao th:nth-child(3) { width: 150px; }
.ranking-table.is-qimao th:nth-child(4) { width: 76px; }
.ranking-table.is-qimao th:nth-child(5) { width: 110px; }
.ranking-table.is-qimao th:nth-child(6) { width: 100px; }
.ranking-table.is-qimao th:nth-child(7) { width: 70px; }
.ranking-table.is-qimao th:nth-child(8) { width: 100px; }
.ranking-table.is-qimao th:nth-child(9),
.ranking-table.is-qimao th:nth-child(10),
.ranking-table.is-qimao th:nth-child(11) { width: 110px; }
.ranking-table.is-qimao th:nth-child(12) { width: 150px; }
.ranking-table.is-qimao th:nth-child(13) { width: 80px; }
.ranking-table.is-qimao td:nth-child(2),
.ranking-table.is-qimao td:nth-child(3),
.ranking-table.is-qimao td:nth-child(12) { overflow: hidden; }
.ranking-panel.is-qimao .ranking-toolbar {
  grid-template-columns: auto minmax(220px, 1fr) 140px 150px auto auto;
}
.ranking-source {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.ranking-source b {
  color: #344054;
  font-size: 13px;
}
.ranking-panel { padding: 0 !important; overflow: hidden; }
.ranking-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 140px auto auto;
  gap: 10px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.ranking-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 64px);
  padding: 3px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #f7f8fb;
}
.ranking-segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: #667085;
  background: transparent;
  font-weight: 600;
}
.ranking-segmented button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ed5aa9, #547cf2);
  box-shadow: 0 4px 10px rgba(91, 94, 210, .18);
}
.ranking-search {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.ranking-search .icon { width: 17px; height: 17px; color: #98a2b3; }
.ranking-search input { min-width: 0; width: 100%; border: 0; box-shadow: none !important; padding: 0; }
.ranking-toolbar select { min-height: 40px; }
.ranking-metric-filters {
  min-height: 62px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.ranking-filter-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.ranking-number-filter {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.ranking-number-filter > span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ranking-number-filter input {
  width: 88px;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}
.ranking-number-filter select {
  min-height: 38px;
  padding: 0 28px 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}
.ranking-filter-logic {
  display: inline-grid;
  grid-template-columns: repeat(2, 42px);
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.ranking-filter-logic button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.ranking-filter-logic button.is-active {
  color: #fff;
  background: #2563eb;
}
.ranking-filter-summary {
  margin-left: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.ranking-metric-search {
  min-width: 92px;
  min-height: 40px;
  justify-content: center;
  white-space: nowrap;
}
.ranking-number-filter.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}
.ranking-category-filter {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.ranking-category-filter > span {
  padding-top: 7px;
  color: #667085;
  font-size: 13px;
  font-weight: 600;
}
.ranking-category-list {
  max-height: 76px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  transition: max-height .2s ease;
}
.ranking-category-list.is-expanded { max-height: 360px; }
.ranking-category-list button,
.ranking-category-toggle {
  min-height: 32px;
  border: 1px solid #dfe3ec;
  border-radius: 7px;
  padding: 0 13px;
  color: #5d6b86;
  background: #fff;
  font-size: 12px;
}
.ranking-category-list button:hover,
.ranking-category-toggle:hover {
  border-color: #aebbf1;
  color: #526ee6;
  background: #f8f9ff;
}
.ranking-category-list button.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #ed5aa9, #547cf2);
  box-shadow: 0 4px 10px rgba(91, 94, 210, .16);
}
.ranking-category-list small {
  margin-left: 3px;
  color: #98a2b3;
  font-size: 11px;
}
.ranking-category-list button.is-active small { color: rgba(255, 255, 255, .78); }
.ranking-category-toggle { min-width: 58px; }
.ranking-meta {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 20px;
  background: #fafbff;
  border-bottom: 1px solid var(--line);
}
.ranking-meta div { display: flex; align-items: baseline; gap: 7px; }
.ranking-meta strong { color: #405ed7; font-size: 20px; }
.ranking-meta span,
.ranking-meta p { color: var(--muted); font-size: 12px; }
.ranking-meta p { margin-left: auto; }
.ranking-table-wrap { margin: 0; border: 0; border-radius: 0; }
.ranking-table {
  width: 100%;
  min-width: 1460px;
  table-layout: fixed;
}
.ranking-table th,
.ranking-table td { white-space: nowrap; }
.ranking-table th:nth-child(1) { width: 64px; }
.ranking-table th:nth-child(2) { width: 220px; }
.ranking-table th:nth-child(3) { width: 110px; }
.ranking-table th:nth-child(4) { width: 180px; }
.ranking-table th:nth-child(5) { width: 80px; }
.ranking-table th:nth-child(6) { width: 100px; }
.ranking-table th:nth-child(7) { width: 100px; }
.ranking-table th:nth-child(8) { width: 70px; }
.ranking-table th:nth-child(9) { width: 90px; }
.ranking-table th:nth-child(10) { width: 210px; }
.ranking-table th:nth-child(11) { width: 150px; }
.ranking-table th:nth-child(12) { width: 86px; }
.ranking-table td:nth-child(2),
.ranking-table td:nth-child(4),
.ranking-table td:nth-child(11) { overflow: hidden; }
.ranking-table .book-id-cell {
  width: 100%;
  max-width: 134px;
  grid-template-columns: minmax(0, 1fr) 30px;
}
.ranking-book-title {
  display: block;
  max-width: 204px;
  overflow: hidden;
  color: #1d2939;
  text-overflow: ellipsis;
}
.ranking-author {
  display: block;
  max-width: 164px;
  overflow: hidden;
  color: #475467;
  text-overflow: ellipsis;
}
.ranking-category {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  color: #4f5f7d;
  background: #f1f4fa;
  font-size: 12px;
}
.ranking-medal,
.ranking-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
}
.ranking-number { color: #667085; background: #f2f4f7; }
.ranking-medal { color: #fff; }
.ranking-medal.rank-1 { background: #f0ad2d; }
.ranking-medal.rank-2 { background: #8d9bae; }
.ranking-medal.rank-3 { background: #bd7655; }
.ranking-score { color: #e17d18; font-weight: 700; }
.ranking-history { display: inline-flex; gap: 4px; }
.ranking-history i {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #536481;
  background: #f2f5fb;
  font-size: 11px;
  font-style: normal;
}
.ranking-download { display: inline-flex; align-items: center; gap: 5px; }
.ranking-download .icon { width: 15px; height: 15px; }
.ranking-pagination {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ranking-pagination > span { color: #667085; font-size: 13px; font-weight: 600; }
.ranking-pagination > div,
.ranking-pagination label { display: flex; align-items: center; gap: 8px; }
.ranking-pagination label { color: #667085; font-size: 12px; }
.ranking-page-size select { min-height: 36px; padding: 0 26px 0 8px; }
.ranking-pagination input { width: 68px; min-height: 36px; padding: 0 8px; text-align: center; }
.ranking-pagination button { min-width: 72px; }
.ranking-page-numbers { display: flex; align-items: center; gap: 4px; }
.ranking-page-numbers button,
.ranking-page-numbers b {
  min-width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}
.ranking-page-numbers button:hover { border-color: #93b4f7; color: #2563eb; background: #f8faff; }
.ranking-page-numbers b { border-color: #2563eb; background: #2563eb; color: #fff; }
.ranking-page-more { padding: 0 3px; color: #98a2b3; }

@media (max-width: 1100px) {
  .ranking-toolbar { grid-template-columns: auto minmax(200px, 1fr) 130px; }
  .ranking-panel.is-qimao .ranking-toolbar { grid-template-columns: auto minmax(200px, 1fr) 140px; }
  .ranking-toolbar .ghost-button,
  .ranking-toolbar .primary-action { width: 100%; }
}
@media (max-width: 760px) {
  .ranking-page-head { align-items: flex-start; }
  .ranking-pull-actions { flex-basis: 100%; margin-left: 0; }
  .ranking-toolbar { grid-template-columns: 1fr 1fr; }
  .ranking-panel.is-qimao .ranking-toolbar { grid-template-columns: 1fr 1fr; }
  .ranking-search { grid-column: 1 / -1; }
  .ranking-metric-filters { align-items: stretch; padding: 12px; }
  .ranking-filter-label { width: 100%; }
  .ranking-number-filter { flex: 1 1 240px; }
  .ranking-number-filter input { flex: 1; width: 64px; }
  .ranking-filter-summary { width: 100%; margin-left: 0; }
  .ranking-metric-search { width: 100%; }
  .ranking-category-filter { grid-template-columns: 1fr auto; }
  .ranking-category-filter > span { grid-column: 1 / -1; padding-top: 0; }
  .ranking-meta { gap: 14px; flex-wrap: wrap; }
  .ranking-meta p { width: 100%; margin-left: 0; }
  .ranking-pagination { align-items: stretch; flex-direction: column; }
  .ranking-pagination > div { flex-wrap: wrap; }
}
.member-card,
.source-task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.member-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) 1.22fr;
  gap: 12px;
  margin-bottom: 16px;
}
.member-stat {
  min-height: 142px;
  height: 142px;
  border-radius: 10px;
}
.member-stat small.is-down { color: var(--red); }
.member-profile-card {
  min-height: 142px;
  height: 142px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px 26px;
  overflow: hidden;
}
.big-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2687ff 0%, #065ee9 100%);
}
.big-avatar .icon {
  width: 28px;
  height: 28px;
}
.member-profile-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
}
.member-profile-card p {
  color: #667796;
  font-size: 12px;
  line-height: 1.8;
}
.member-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.member-table-card {
  min-height: 420px;
}
#member-dashboard .member-table {
  min-width: 620px;
}
.member-mini-tabs {
  display: flex;
  gap: 22px;
  margin-top: 14px;
}
.member-mini-tabs button {
  border: 0;
  background: transparent;
  color: #647596;
  font-weight: 700;
  font-size: 12px;
  padding: 0 0 7px;
}
.member-mini-tabs button.is-active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}
.member-table {
  min-width: 760px;
}
.member-table th,
.member-table td {
  font-size: 12px;
  padding: 13px 12px;
}
.member-table tbody tr.is-selected {
  outline: 1px solid #2f82ff;
  outline-offset: -1px;
  background: #f6f9ff;
}
.book-id-cell {
  display: inline-grid;
  grid-template-columns: minmax(44px, 1fr) 22px;
  align-items: center;
  gap: 6px;
  max-width: 112px;
}
.book-id-cell code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #27395f;
  background: transparent;
}
.book-id-cell .copy-book-id {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 6px;
  color: #6f82a3;
}
.book-id-cell .copy-book-id:hover {
  color: var(--blue);
  background: #edf5ff;
}
.book-id-cell .copy-book-id.is-copied {
  color: #fff;
  background: var(--blue);
}
.task-log-muted {
  color: #95a0b8;
}
.task-log-details {
  max-width: 260px;
  color: #52668e;
  font-size: 12px;
}
.task-log-details summary {
  cursor: pointer;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.task-log-details.is-error summary {
  color: var(--red);
}
.task-log-details pre {
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid #ffd9d9;
  border-radius: 8px;
  background: #fff7f7;
  color: #7c2222;
  white-space: pre-wrap;
  line-height: 1.55;
}
.member-side-stack {
  display: grid;
  gap: 14px;
}
.member-donut {
  width: 166px;
  height: 166px;
  margin: 8px auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#4c8df6 0 38%, #31c194 38% 86%, #ff6565 86% 100%);
  position: relative;
}
.member-donut::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
}
.member-donut b,
.member-donut span {
  position: relative;
  z-index: 1;
}
.member-donut b {
  align-self: end;
  font-size: 30px;
}
.member-donut span {
  align-self: start;
  color: #667796;
  font-size: 13px;
}
.member-stat-legend {
  display: grid;
  gap: 9px;
}
.member-stat-legend p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: #52668e;
  font-size: 12px;
}
.member-stat-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 8px;
}
.blue-dot { background: var(--blue); }
.green-dot { background: var(--green); }
.red-dot { background: var(--red); }
.recent-list {
  display: grid;
  gap: 10px;
}
.recent-list p {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  color: #52668e;
  font-size: 12px;
}
.quick-start h2 {
  font-size: 16px;
  margin-bottom: 12px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.quick-grid button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 12px;
  text-align: left;
}
.quick-grid span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #172448;
  border-radius: 50%;
  background: #eef5ff;
}
.quick-grid .stat-icon,
.quick-grid .orange,
.quick-grid .blue {
  color: #fff;
  border-radius: 9px;
}
.quick-grid .orange { background: var(--orange); }
.quick-grid .blue { background: var(--blue); }
.quick-grid b {
  color: #172448;
  font-size: 14px;
}
.quick-grid small {
  color: #7180a0;
  font-size: 12px;
}
.source-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.source-switcher button {
  min-height: 74px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px 15px;
  text-align: left;
  color: #172448;
  box-shadow: var(--shadow);
}
.source-switcher button.is-active {
  border-color: #8bbdff;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: 0 12px 28px rgba(36, 120, 255, 0.12);
}
.source-switcher .member-source-logo {
  grid-row: 1 / span 2;
}
.source-switcher b {
  font-size: 15px;
}
.source-switcher small {
  color: #7180a0;
  font-size: 12px;
}
.member-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.source-task-card {
  display: none;
  padding: 0;
  overflow: hidden;
}
.source-task-card.is-active {
  display: block;
}
.source-task-card .table-wrap {
  overflow: auto;
}
.source-head {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.member-source-logo {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 18px;
}
.member-source-logo.tomato {
  background: #fff3e8;
}
.member-source-logo.qimao {
  background: #ffd629;
  position: relative;
}
.member-source-logo.qimao::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 42% 42%;
  background: #121214;
}
.source-search-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 96px;
  gap: 0;
  padding: 18px;
}
.source-search-row select,
.source-search-row input {
  border-radius: 0;
}
.source-search-row select {
  border-radius: 7px 0 0 7px;
}
.source-search-row button {
  border-radius: 0 7px 7px 0;
}
.hidden-input {
  display: none;
}
.search-table {
  min-width: 920px;
  table-layout: fixed;
}
.source-task-card .member-table th,
.source-task-card .member-table td {
  padding: 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 0;
}
.member-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  color: #647596;
  font-size: 12px;
}
.member-pagination nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.member-pagination button,
.member-pagination b {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #52668e;
}
.member-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.member-pagination .pager-more {
  cursor: default;
  opacity: 1;
}
.member-pagination b {
  border: 1px solid var(--blue);
  color: var(--blue);
}
.member-pagination select {
  width: auto;
  min-height: 30px;
}
.task-range-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 110px 170px 120px;
  gap: 10px;
  padding: 0 18px 18px;
}
.full-download-button { min-width: 0; }
.download-confirm-dialog { width: min(620px, calc(100vw - 32px)); }
.download-confirm-content { display: grid; gap: 16px; }
.download-confirm-book { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #f8faff; }
.download-confirm-book > div { min-width: 0; display: grid; gap: 4px; }
.download-confirm-book b { overflow: hidden; color: #203356; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.download-confirm-book small { color: #71809a; font-size: 11px; }
.download-confirm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.download-confirm-grid > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.download-confirm-grid span { color: #71809a; font-size: 11px; }
.download-confirm-grid b { color: #243858; font-size: 14px; }
.download-confirm-grid .is-insufficient { color: var(--red); }
#downloadConfirmSubmit:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
  .task-range-bar { grid-template-columns: minmax(0, 1fr) 80px 100px; }
  .task-range-bar button { grid-column: span 1; }
}
.catalog-card {
  margin-top: 18px;
}
.task-filter-card {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr auto auto;
  gap: 14px;
  align-items: end;
}
.date-range {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
}
.date-range input:first-child {
  border-radius: 7px 0 0 7px;
}
.date-range input:last-child {
  border-radius: 0 7px 7px 0;
}
.date-range em {
  display: grid;
  place-items: center;
  height: 36px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  color: #647596;
  font-size: 12px;
  font-style: normal;
}
.task-overview-card h2 {
  font-size: 16px;
  margin-bottom: 14px;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.overview-grid div {
  display: grid;
  grid-template-columns: 52px auto;
  gap: 6px 12px;
  align-items: center;
}
.overview-icon {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}
.overview-icon.blue { background: #4c8df6; }
.overview-icon.green { background: #19bd88; }
.overview-icon.teal { background: #16bb8a; }
.overview-icon.red { background: #ff5d5d; }
.overview-grid p {
  margin: 0;
  color: #647596;
  font-size: 12px;
}
.overview-grid b {
  font-size: 24px;
}
.settings-card {
  padding: 22px;
}
.settings-card > p {
  color: #7180a0;
  font-size: 12px;
  margin: 8px 0 22px;
}
.settings-profile-grid {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 34px;
}
.big-avatar {
  width: 92px;
  height: 92px;
  align-self: start;
  justify-self: center;
}
.settings-form,
.password-form {
  display: grid;
  gap: 16px;
}
.settings-form label {
  display: grid;
  gap: 7px;
}
.settings-form label > span {
  color: #31446d;
  font-weight: 800;
}
.settings-form small,
.password-form small {
  color: #7180a0;
  font-size: 12px;
}
.settings-save {
  justify-self: end;
  min-width: 92px;
}
.password-form {
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
}
.password-form label {
  display: contents;
}
.password-form label > span {
  color: #31446d;
  font-weight: 800;
}
.password-form label small {
  grid-column: 2;
  margin-top: -10px;
}
.password-form .settings-save {
  grid-column: 2;
}
.key-hero-card {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.key-hero-card p {
  color: #647596;
  font-size: 13px;
  margin-top: 10px;
}
.member-activate-key-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  min-width: min(460px, 100%);
}
.member-key-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.key-code-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.key-code-wrap code {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.key-guide-card {
  display: block;
}
.app-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 2000;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 18px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  background: #f0fdf4;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .18s ease, transform .18s ease;
}
.app-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.app-toast.is-error { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.link-action.recharge-action { color: #0f9f6e; font-weight: 700; }
.select-col { width: 42px; text-align: center; }
.select-col input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.code-copy-button {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  color: var(--blue);
  background: #f7faff;
}
.code-copy-button:hover { border-color: #9fc2ff; background: #edf5ff; }
.code-copy-button .icon { width: 14px; height: 14px; }
.key-bulk-copy { min-height: 32px; padding: 0 11px; }
.key-bulk-copy:disabled { opacity: .48; cursor: not-allowed; }
.user-edit-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.user-edit-dialog::backdrop { background: rgba(20, 32, 58, .42); }
.user-edit-dialog form { padding: 22px; }
.user-edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.user-edit-head h2 { color: #172448; font-size: 19px; }
.user-edit-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #65728b;
  background: #fff;
  font-size: 21px;
}
.user-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.user-edit-grid > label { display: grid; gap: 7px; }
.user-edit-grid > label > span { color: #647596; font-size: 12px; font-weight: 700; }
.user-edit-grid input { width: 100%; }
.user-edit-wide { grid-column: 1 / -1; }
.user-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-hint { margin-top: 14px; color: #71809b; font-size: 12px; line-height: 1.7; }
.task-detail-dialog { width: min(780px, calc(100vw - 32px)); }
.task-detail-shell { padding: 22px; }
.task-detail-content { display: grid; gap: 18px; }
.task-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-detail-grid > div { min-width: 0; display: grid; gap: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcff; }
.task-detail-grid span { color: #72809a; font-size: 11px; }
.task-detail-grid b { overflow: hidden; color: #263858; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.task-detail-logs h3 { margin-bottom: 8px; color: #172448; font-size: 14px; }
.task-detail-logs pre { max-height: 250px; overflow: auto; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 6px; color: #405272; background: #f7f9fc; font: 12px/1.75 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .user-edit-grid { grid-template-columns: 1fr; }
  .user-edit-wide { grid-column: auto; }
  .task-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .admin-app, .member-app { grid-template-columns: 86px minmax(0, 1fr); }
  .admin-brand strong, .brand-chip, .admin-nav-item { font-size: 0; }
  .admin-nav-item { justify-content: center; padding: 0; }
  .admin-nav-item .nav-icon { width: 21px; height: 21px; }
  .collapse-button { display: none; }
  .member-brand strong, .member-brand-chip, .member-nav-item { font-size: 0; }
  .member-nav-item { justify-content: center; padding: 0; }
  .member-nav-item .member-nav-icon { width: 21px; height: 21px; }
  .member-collapse-button { display: none; }
  .stat-grid.four, .stat-grid.five, .dashboard-grid, .stats-layout, .notice-form-grid, .notice-type-grid, .notice-scope-grid, .priority-grid, .schedule-grid, .filter-card, .inline-form { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-app, .member-app, .layout, .status-grid { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .member-sidebar { position: relative; height: auto; }
  .admin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-topbar, .member-topbar, .topbar { align-items: stretch; flex-direction: column; height: auto; padding: 14px; }
  .admin-tools { flex-wrap: wrap; }
  .member-tools { flex-wrap: wrap; }
  .admin-search { width: 100%; }
  .member-search { width: 100%; }
}

/* UI refresh: content operations design system */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --soft: #f8fafc;
  --line: #e4e9f2;
  --line-strong: #d4dce8;
  --text: #182230;
  --muted: #667085;
  --blue: #2563eb;
  --green: #079669;
  --orange: #d97706;
  --purple: #7c3aed;
  --red: #dc2626;
  --teal: #0891b2;
  --sidebar: #111827;
  --sidebar-muted: #98a2b3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .035);
  font-family: "Microsoft YaHei UI", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html { color-scheme: light; }
body {
  min-width: 320px;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button,
input,
textarea,
select {
  letter-spacing: 0;
  touch-action: manipulation;
}
button {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus { outline: none; }
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }

input,
textarea,
select {
  min-height: 40px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input::placeholder,
textarea::placeholder { color: #98a2b3; }
input:hover,
textarea:hover,
select:hover { border-color: #b8c2d1; }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.primary-action,
.secondary-action,
.ghost-button,
.icon-button,
.admin-user,
.table-icon,
.menu-button,
.member-menu-button,
.member-icon-button,
.member-user-button {
  min-height: 40px;
  border-radius: 8px;
}
.primary-action {
  background: var(--blue);
  box-shadow: none;
}
.primary-action:hover:not(:disabled) { background: #1d4ed8; }
.secondary-action {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.secondary-action:hover:not(:disabled) { background: #dbeafe; }
.ghost-button {
  border-color: var(--line-strong);
  background: #fff;
  color: #344054;
}
.ghost-button:hover:not(:disabled) {
  border-color: #b8c2d1;
  background: var(--soft);
  color: #101828;
}
.icon-only { width: 40px; }

/* Shared application shell */
.admin-app,
.member-app {
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns .2s ease;
}
.admin-app.is-collapsed,
.member-app.is-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.admin-sidebar,
.member-sidebar {
  z-index: 8;
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(180deg, #f25aa6 0%, #c35fd7 36%, #7780ed 67%, #2587fb 100%);
}
.admin-brand,
.member-brand {
  height: 42px;
  margin: 0 8px 26px;
  gap: 10px;
}
.brand-mark,
.member-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .15);
  box-shadow: 0 8px 20px rgba(83, 54, 155, .16);
}
.admin-brand strong,
.member-brand strong {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.brand-chip,
.member-brand-chip { display: none; }
.admin-nav,
.member-nav { gap: 5px; }
.admin-nav-item,
.member-nav-item {
  position: relative;
  min-height: 44px;
  gap: 12px;
  border-radius: 8px;
  padding: 0 13px;
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  font-weight: 600;
}
.admin-nav-item:hover,
.member-nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .13);
}
.admin-nav-item.is-active,
.member-nav-item.is-active {
  color: #3c4f78;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(58, 45, 123, .15);
}
.admin-nav-item.is-active:focus-visible,
.member-nav-item.is-active:focus-visible,
.admin-nav-item:focus-visible,
.member-nav-item:focus-visible {
  outline: 2px solid rgba(147, 197, 253, .78);
  outline-offset: 2px;
  box-shadow: none;
}
.collapse-button,
.member-collapse-button {
  min-height: 42px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
}
.collapse-button:hover,
.member-collapse-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .13);
}
.admin-main,
.member-main { grid-template-rows: 64px minmax(0, 1fr); }
.admin-topbar,
.member-topbar {
  min-width: 0;
  padding: 0 24px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
}
.menu-button,
.member-menu-button {
  width: 40px;
  color: #475467;
}
.menu-button:hover,
.member-menu-button:hover,
.icon-button:hover,
.member-icon-button:hover { background: #f2f4f7; color: var(--blue); }
.crumb,
.member-crumb { font-size: 13px; }
.crumb b,
.member-crumb b { color: #344054; }
.search-box,
.member-search-box,
.table-search-wrap {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.search-box:focus-within,
.member-search-box:focus-within,
.table-search-wrap:focus-within {
  border-color: #93b4f7;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.admin-search,
.member-search,
.table-search {
  min-height: 36px;
  box-shadow: none !important;
}
.admin-user,
.member-user-button { padding: 0 6px; }
.admin-user:hover,
.member-user-button:hover { background: #f2f4f7; }
.avatar,
.member-avatar {
  width: 30px;
  height: 30px;
  background: #e4e7ec;
}
.admin-content,
.member-content {
  width: 100%;
  max-width: 1600px;
  padding: 24px;
  margin: 0 auto;
}
.admin-page.is-active,
.member-page.is-active { animation: pageEnter .18s ease-out; }

/* Cards and information hierarchy */
.admin-card,
.member-card,
.source-task-card,
.filter-card,
.member-profile-card,
.notice-main-card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.admin-card,
.member-card,
.filter-card { padding: 20px; }
.admin-card,
.filter-card { margin-bottom: 16px; }
.member-card,
.source-task-card { margin-bottom: 16px; }
.card-head,
.page-head,
.table-toolbar { margin-bottom: 16px; }
.page-head { min-height: 40px; }
.card-head h2,
.page-head h2 { color: #101828; font-size: 17px; }
.card-head p,
.page-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.stat-grid { gap: 16px; margin-bottom: 16px; }
.stat-card {
  min-height: 120px;
  gap: 16px;
  border-color: var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card p { color: #475467; font-size: 13px; font-weight: 600; }
.stat-card strong {
  margin-top: 5px;
  color: #101828;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.stat-card small { margin-top: 10px; color: var(--muted); }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf3; color: #079669; }
.stat-icon.orange { background: #fff7ed; color: #d97706; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.teal { background: #ecfeff; color: #0891b2; }
.dashboard-grid,
.stats-layout,
.dashboard-side,
.member-dashboard-grid,
.member-side-stack { gap: 16px; }

/* Data tables and filters */
.table-wrap {
  border-color: var(--line);
  border-radius: 8px;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.table-wrap.clean {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
th,
td {
  padding: 13px 14px;
  border-bottom-color: #edf0f5;
  color: #475467;
  font-size: 12px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #344054;
  font-weight: 700;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbff; }
.empty { padding: 48px 16px; color: #98a2b3; }
.table-actions { gap: 6px; }
.table-actions .table-icon,
.code-copy-button,
.book-id-cell .copy-book-id {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 7px;
}
.table-icon:hover,
.code-copy-button:hover,
.book-id-cell .copy-book-id:hover { background: #eff6ff; }
.source-badge,
.status-badge,
.badge {
  min-height: 24px;
  border-radius: 999px;
  padding-inline: 9px;
}
.source-badge.fanqie { background: #fff4ed; color: #c2410c; }
.source-badge.qimao { background: #fffbea; color: #8a6100; }
.status-badge.ok,
.badge.done { background: #ecfdf3; color: #027a48; }
.status-badge.bad,
.badge.failed { background: #fef3f2; color: #b42318; }
.status-badge.warn { background: #fffaeb; color: #b54708; }
.status-badge.info,
.badge { background: #eff6ff; color: #1d4ed8; }
.ranking-table .status-badge.ranking-ongoing { background: #ecfdf3; color: #027a48; }
.ranking-table .status-badge.ranking-completed { background: #eff6ff; color: #1d4ed8; }
.filter-card {
  gap: 12px;
  background: #fff;
}
.filter-card.flat { padding-bottom: 18px; }
.sub-tabs {
  gap: 28px;
  margin-bottom: 18px;
  padding-left: 0;
  overflow-x: auto;
}
.sub-tabs button {
  min-height: 44px;
  flex: 0 0 auto;
  color: #667085;
  font-weight: 600;
}
.hint-bar {
  border-color: #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e4f91;
}
.toggle-line { border-radius: 8px; background: #f9fafb; }
.api-provider {
  border-radius: 8px;
  background: #fff;
}
.provider-logo { border-radius: 8px; }
.secret-field { min-height: 40px; border-radius: 8px; background: #fff; }
.secret-field input { min-height: 38px; }
.secret-tool { height: 38px; }

/* Member workflows */
.member-stat-grid { gap: 16px; }
.member-stat,
.member-profile-card { min-height: 132px; height: 132px; }
.member-profile-card { padding: 20px 24px; }
.big-avatar { background: var(--blue); }
.quick-grid { gap: 12px; }
.quick-grid button {
  min-height: 80px;
  border-radius: 8px;
  background: #fff;
}
.quick-grid button:hover {
  border-color: #93b4f7;
  background: #f9fbff;
  transform: translateY(-1px);
}
.quick-grid span { border-radius: 8px; }
.source-switcher { gap: 12px; margin-bottom: 16px; }
.source-switcher button {
  min-height: 72px;
  border-radius: 8px;
  box-shadow: none;
}
.source-switcher button:hover { border-color: #b8c2d1; background: #f9fafb; }
.source-switcher button.is-active {
  border-color: #93b4f7;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}
.source-task-card { box-shadow: var(--shadow); }
.source-head {
  height: 56px;
  gap: 10px;
  background: #fbfcfe;
}
.source-head strong { color: #344054; font-size: 14px; }
.member-source-logo.tomato {
  color: #c2410c;
  background: #fff4ed;
}
.member-source-logo.tomato .icon { width: 17px; height: 17px; }
.source-search-row { gap: 8px; }
.source-search-row select,
.source-search-row input,
.source-search-row button { border-radius: 8px; }
.task-range-bar { gap: 8px; }
.task-filter-card { gap: 12px; }
.overview-icon { border-radius: 8px; }
.key-hero-card { min-height: 112px; }
.member-key-stats { gap: 16px; }
.member-donut { background: conic-gradient(#2563eb 0 38%, #079669 38% 86%, #dc2626 86% 100%); }

/* Dialogs, dropdowns and feedback */
.topbar-dropdown {
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, .16);
}
.notify-item { border-radius: 8px; }
.user-edit-dialog {
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
}
.user-edit-dialog::backdrop {
  background: rgba(16, 24, 40, .48);
  backdrop-filter: blur(2px);
}
.dialog-close {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 8px;
}
.dialog-close:hover { border-color: #b8c2d1; background: #f2f4f7; color: #101828; }
.download-confirm-book,
.download-confirm-grid > div,
.task-detail-grid > div,
.task-detail-logs pre { border-radius: 8px; }
.app-toast {
  top: 20px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}

/* Login remains expressive while the workspace stays operational */
body.auth-mode {
  background:
    radial-gradient(circle at 18% 24%, rgba(244, 114, 182, .26), transparent 30%),
    radial-gradient(circle at 82% 28%, rgba(59, 130, 246, .24), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 44%, #fff1f7 100%);
}
body.auth-mode .topbar { padding: 20px 24px; }
.auth-grid { min-height: calc(100vh - 78px); padding: 24px; }
.auth-card {
  width: min(440px, 100%);
  border-radius: 8px;
  border-color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 24px 70px rgba(38, 70, 130, .14);
}
.auth-heading { padding: 28px 28px 8px; }
.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}
body.auth-mode .auth-panel { gap: 14px; padding: 22px 28px 16px; }
body.auth-mode input { min-height: 44px; background: rgba(255, 255, 255, .92); }
body.auth-mode .primary-action {
  min-height: 44px;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: none;
}
body.auth-mode .primary-action:hover { background: #1d4ed8; }
.auth-tip { line-height: 1.7; }

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1240px) {
  .member-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-profile-card { grid-column: 1 / -1; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .admin-app,
  .member-app { grid-template-columns: 76px minmax(0, 1fr); }
  .admin-sidebar,
  .member-sidebar { padding-inline: 10px; }
  .admin-brand,
  .member-brand { justify-content: center; margin-inline: 0; }
  .admin-brand strong,
  .member-brand strong { display: none; }
  .admin-nav-item,
  .member-nav-item { justify-content: center; padding: 0; font-size: 0; }
  .stat-grid.four,
  .stat-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .stats-layout { grid-template-columns: minmax(0, 1fr); }
  .notice-form-grid { grid-template-columns: minmax(0, 1fr); }
  .notice-type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-card .primary-action,
  .filter-card .ghost-button { align-self: end; }
  .inline-form,
  .key-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form .primary-action,
  .key-form .primary-action { min-height: 40px; }
  .task-filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-app,
  .member-app { display: block; }
  .admin-sidebar,
  .member-sidebar {
    position: relative;
    height: auto;
    padding: 12px;
  }
  .admin-brand,
  .member-brand {
    justify-content: flex-start;
    margin: 0 0 10px;
  }
  .admin-brand strong,
  .member-brand strong { display: block; }
  .admin-nav,
  .member-nav {
    display: flex;
    gap: 6px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar,
  .member-nav::-webkit-scrollbar { display: none; }
  .admin-nav-item,
  .member-nav-item {
    flex: 0 0 auto;
    justify-content: flex-start;
    min-height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }
  .collapse-button,
  .member-collapse-button { display: none; }
  .admin-main,
  .member-main { display: block; }
  .admin-topbar,
  .member-topbar {
    position: relative;
    gap: 12px;
    padding: 12px 16px;
  }
  .topbar-left,
  .member-topbar-left { min-height: 40px; }
  .admin-tools,
  .member-tools { gap: 8px; }
  .search-box,
  .member-search-box {
    order: 4;
    width: 100%;
  }
  .admin-search,
  .member-search { width: 100%; }
  .admin-content,
  .member-content { padding: 16px; }
  .stat-grid.four,
  .stat-grid.five,
  .member-stat-grid { grid-template-columns: minmax(0, 1fr); }
  .member-profile-card { grid-column: auto; }
  .stat-card { min-height: 108px; }
  .member-stat,
  .member-profile-card { height: auto; min-height: 112px; }
  .page-head,
  .card-head,
  .table-toolbar,
  .key-hero-card {
    align-items: stretch;
    flex-direction: column;
  }
  .button-row.compact { flex-wrap: wrap; }
  .button-row.compact > button { flex: 1 1 auto; }
  .filter-card,
  .filter-card.flat,
  .inline-form,
  .key-form,
  .settings-grid,
  .task-filter-card,
  .source-search-row,
  .task-range-bar,
  .member-activate-key-form,
  .member-key-stats { grid-template-columns: minmax(0, 1fr); }
  .member-activate-key-form { width: 100%; min-width: 0; }
  .quick-grid,
  .source-switcher { grid-template-columns: minmax(0, 1fr); }
  .notice-type-grid,
  .notice-scope-grid,
  .priority-grid,
  .schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-profile-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .password-form { grid-template-columns: minmax(0, 1fr); }
  .password-form label { display: grid; }
  .password-form label small,
  .password-form .settings-save { grid-column: auto; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-grid { min-height: calc(100dvh - 72px); padding: 18px; }
  .auth-heading { padding: 24px 22px 6px; }
  body.auth-mode .auth-panel { padding: 20px 22px 14px; }
}

@media (max-width: 480px) {
  body.auth-mode .topbar { padding: 16px 18px; }
  body.auth-mode .topbar h1 { font-size: 19px; }
  .admin-user b,
  .member-user-button b,
  .admin-user i,
  .member-user-button i { display: none; }
  .notice-type-grid,
  .notice-scope-grid,
  .priority-grid,
  .schedule-grid,
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .download-confirm-grid,
  .user-edit-grid,
  .task-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-card,
  .member-card,
  .filter-card { padding: 16px; }
}

/* Light and dark appearance */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.theme-toggle .icon { width: 18px; height: 18px; }
.auth-theme-toggle {
  width: 38px;
  min-height: 38px;
  margin-left: auto;
  border-color: rgba(178, 194, 224, .72);
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(10px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101217;
  --surface: #181b22;
  --soft: #20242d;
  --line: #2a303b;
  --line-strong: #3a4351;
  --text: #eef2f8;
  --muted: #9aa5b5;
  --shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"] .admin-app,
html[data-theme="dark"] .member-app,
html[data-theme="dark"] .admin-main,
html[data-theme="dark"] .member-main { background: var(--bg); }
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .member-sidebar {
  background: linear-gradient(180deg, #b8478f 0%, #84449f 38%, #4b66c7 70%, #2c75d7 100%);
}
html[data-theme="dark"] .admin-topbar,
html[data-theme="dark"] .member-topbar {
  border-bottom-color: var(--line);
  background: rgba(24, 27, 34, .94);
}
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .source-task-card,
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .member-profile-card,
html[data-theme="dark"] .notice-main-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .key-hero-card,
html[data-theme="dark"] .key-guide-card,
html[data-theme="dark"] .api-provider,
html[data-theme="dark"] .topbar-dropdown,
html[data-theme="dark"] .user-edit-dialog {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .page-head h2,
html[data-theme="dark"] .card-head h2,
html[data-theme="dark"] .notice-page-title h2,
html[data-theme="dark"] .member-profile-card h2,
html[data-theme="dark"] .quick-grid b,
html[data-theme="dark"] .source-switcher b,
html[data-theme="dark"] .settings-form label > span,
html[data-theme="dark"] .password-form label > span,
html[data-theme="dark"] .crumb b,
html[data-theme="dark"] .member-crumb b,
html[data-theme="dark"] .ranking-source b,
html[data-theme="dark"] .ranking-book-title,
html[data-theme="dark"] .download-confirm-book b,
html[data-theme="dark"] .download-confirm-grid b,
html[data-theme="dark"] .book-id-cell code { color: var(--text); }
html[data-theme="dark"] .page-head p,
html[data-theme="dark"] .card-head p,
html[data-theme="dark"] .member-profile-card p,
html[data-theme="dark"] .quick-grid small,
html[data-theme="dark"] .source-switcher small,
html[data-theme="dark"] .settings-card > p,
html[data-theme="dark"] .settings-form small,
html[data-theme="dark"] .password-form small,
html[data-theme="dark"] .key-hero-card p,
html[data-theme="dark"] .overview-grid p,
html[data-theme="dark"] .member-stat-legend p,
html[data-theme="dark"] .recent-list p { color: var(--muted); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .member-search-box,
html[data-theme="dark"] .table-search-wrap,
html[data-theme="dark"] .ranking-search,
html[data-theme="dark"] .secret-field {
  border-color: var(--line-strong);
  background: #20242c;
  color: var(--text);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #737f91; }
html[data-theme="dark"] .admin-search,
html[data-theme="dark"] .member-search,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .ranking-search input,
html[data-theme="dark"] .secret-field input {
  border-color: transparent;
  background: transparent;
}
html[data-theme="dark"] .search-box:focus-within,
html[data-theme="dark"] .member-search-box:focus-within,
html[data-theme="dark"] .table-search-wrap:focus-within {
  border-color: #5e8ce8;
  background: #242a34;
}
html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .secondary-action,
html[data-theme="dark"] .quick-grid button,
html[data-theme="dark"] .source-switcher button,
html[data-theme="dark"] .ranking-category-list button,
html[data-theme="dark"] .ranking-category-toggle,
html[data-theme="dark"] .ranking-page-numbers button,
html[data-theme="dark"] .member-pagination button,
html[data-theme="dark"] .member-pagination b,
html[data-theme="dark"] .toggle-line {
  border-color: var(--line-strong);
  background: #20242c;
  color: var(--text);
}
html[data-theme="dark"] .ghost-button:hover,
html[data-theme="dark"] .quick-grid button:hover,
html[data-theme="dark"] .source-switcher button:hover,
html[data-theme="dark"] .ranking-page-numbers button:hover {
  border-color: #5e8ce8;
  background: #272e39;
  color: #8db5ff;
}
html[data-theme="dark"] .source-switcher button.is-active {
  border-color: #4d7bd2;
  background: #1c2940;
  box-shadow: inset 0 0 0 1px rgba(96, 142, 224, .14);
}
html[data-theme="dark"] .ranking-category-filter {
  background: var(--surface);
}
html[data-theme="dark"] .ranking-platform-tab {
  border-color: var(--line);
  background: var(--surface);
}
html[data-theme="dark"] .ranking-platform-tab.is-active {
  border-color: #5c8df5;
  background: linear-gradient(135deg, #38283c, #1d304d);
}
html[data-theme="dark"] .ranking-help-button {
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}
html[data-theme="dark"] .ranking-help-button:hover {
  border-color: #5e8ce8;
  color: #8db5ff;
  background: #272e39;
}
html[data-theme="dark"] .ranking-pull {
  border-color: #f59e0b;
  background: #d97706;
}
html[data-theme="dark"] .ranking-pull:hover {
  border-color: #fbbf24;
  background: #f59e0b;
}
html[data-theme="dark"] .ranking-pull-notice {
  border-color: #725a2b;
  color: #f4d48b;
  background: #332b1c;
}
button.primary-action.ranking-pull {
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .2);
}
button.primary-action.ranking-pull:hover:not(:disabled) {
  border-color: #d97706;
  background: #d97706;
}
html[data-theme="dark"] .ranking-segmented {
  border-color: var(--line-strong);
  background: #20242c;
}
html[data-theme="dark"] .ranking-segmented button { color: var(--muted); }
html[data-theme="dark"] .ranking-metric-filters {
  border-color: var(--line);
  background: #15181e;
}
html[data-theme="dark"] .ranking-number-filter,
html[data-theme="dark"] .ranking-filter-logic {
  border-color: var(--line-strong);
  background: #20242c;
}
html[data-theme="dark"] .ranking-number-filter input,
html[data-theme="dark"] .ranking-number-filter select {
  border-color: var(--line-strong);
  background: transparent;
}
html[data-theme="dark"] .ranking-filter-summary { color: #f3f4f6; }
html[data-theme="dark"] .ranking-segmented button.is-active,
html[data-theme="dark"] .ranking-category-list button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #e052a4, #4775df);
}
html[data-theme="dark"] .ranking-toolbar,
html[data-theme="dark"] .ranking-category-filter,
html[data-theme="dark"] .ranking-pagination,
html[data-theme="dark"] .source-head,
html[data-theme="dark"] .member-pagination { border-color: var(--line); }
html[data-theme="dark"] .ranking-meta,
html[data-theme="dark"] .source-head,
html[data-theme="dark"] th {
  border-color: var(--line);
  background: #20242c;
  color: #d8deea;
}
html[data-theme="dark"] td {
  border-bottom-color: var(--line);
  color: #b7c0ce;
}
html[data-theme="dark"] tbody tr:hover { background: #20252e; }
html[data-theme="dark"] .member-table tbody tr.is-selected { background: #1b2940; }
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .table-wrap.clean { border-color: var(--line); }
html[data-theme="dark"] .table-wrap { background: var(--surface); }
html[data-theme="dark"] .ranking-pagination { background: var(--surface); }
html[data-theme="dark"] .ranking-page-numbers b {
  border-color: #4f82ed;
  background: #356bd9;
  color: #fff;
}
html[data-theme="dark"] .ranking-category,
html[data-theme="dark"] .ranking-history i,
html[data-theme="dark"] .ranking-number {
  color: #b8c5d8;
  background: #252b35;
}
html[data-theme="dark"] .ranking-author { color: #aebbd0; }
html[data-theme="dark"] .ranking-table .status-badge.ranking-ongoing {
  background: #12382d;
  color: #61d6a2;
}
html[data-theme="dark"] .ranking-table .status-badge.ranking-completed {
  background: #172e52;
  color: #8db5ff;
}
html[data-theme="dark"] .member-donut::after { background: var(--surface); }
html[data-theme="dark"] .task-log-details pre {
  border-color: #713f46;
  background: #2b1d21;
  color: #f4b4ba;
}
html[data-theme="dark"] .download-confirm-book,
html[data-theme="dark"] .download-confirm-grid > div,
html[data-theme="dark"] .task-detail-grid > div,
html[data-theme="dark"] .task-detail-logs pre {
  border-color: var(--line);
  background: #20242c;
}
html[data-theme="dark"] .topbar-dropdown::before { background: var(--surface); }
html[data-theme="dark"] .notify-item,
html[data-theme="dark"] .dropdown-footer { border-color: var(--line); }
html[data-theme="dark"] .notify-item:hover,
html[data-theme="dark"] .dropdown-footer:hover { background: #20252e; }
html[data-theme="dark"] .menu-button,
html[data-theme="dark"] .member-menu-button,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .member-icon-button,
html[data-theme="dark"] .admin-user,
html[data-theme="dark"] .member-user-button { color: var(--text); }
html[data-theme="dark"] .menu-button:hover,
html[data-theme="dark"] .member-menu-button:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .member-icon-button:hover,
html[data-theme="dark"] .admin-user:hover,
html[data-theme="dark"] .member-user-button:hover { background: #252a33; }
html[data-theme="dark"] .admin-nav-item.is-active,
html[data-theme="dark"] .member-nav-item.is-active {
  color: #fff;
  background: rgba(20, 24, 33, .72);
}
html[data-theme="dark"] .date-range em {
  border-color: var(--line-strong);
  color: var(--muted);
  background: #20242c;
}
html[data-theme="dark"] .code-copy-button,
html[data-theme="dark"] .table-icon,
html[data-theme="dark"] .book-id-cell .copy-book-id {
  border-color: var(--line-strong);
  background: #20242c;
}

html[data-theme="dark"] body.auth-mode {
  background:
    radial-gradient(circle at 18% 24%, rgba(225, 63, 151, .23), transparent 31%),
    radial-gradient(circle at 82% 28%, rgba(43, 107, 222, .26), transparent 35%),
    linear-gradient(135deg, #111318 0%, #151b27 48%, #211522 100%);
}
html[data-theme="dark"] body.auth-mode .topbar h1 { color: var(--text); }
html[data-theme="dark"] body.auth-mode .auth-card {
  border-color: rgba(116, 128, 151, .34);
  background: rgba(24, 27, 34, .88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
}
html[data-theme="dark"] body.auth-mode .auth-heading h2 { color: var(--text); }
html[data-theme="dark"] body.auth-mode .auth-heading p,
html[data-theme="dark"] body.auth-mode .auth-tip,
html[data-theme="dark"] body.auth-mode label span { color: var(--muted); }
html[data-theme="dark"] body.auth-mode input {
  border-color: var(--line-strong);
  background: rgba(31, 35, 44, .86);
  color: var(--text);
}
html[data-theme="dark"] .auth-theme-toggle {
  border-color: var(--line-strong);
  background: rgba(24, 27, 34, .7);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
