:root {
  --blue: #3767b2;
  --blue-dark: #254d8c;
  --blue-soft: #eef4ff;
  --red: #e86573;
  --ink: #213756;
  --muted: #71819a;
  --line: #dce5f2;
  --panel: #ffffff;
  --background: #f4f7fc;
  --success: #238965;
  --danger: #c94f5f;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--background);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--background); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.auth-page {
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 15% 15%, rgba(232, 101, 115, .13), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(55, 103, 178, .16), transparent 34%),
    #f7f9fd;
}

.auth-shell { width: min(100%, 480px); }
.auth-card {
  padding: 34px;
  border: 1px solid rgba(190, 204, 224, .75);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(45, 75, 118, .16);
}
.auth-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 30px; }
.auth-brand img { border-radius: 18px; object-fit: cover; box-shadow: 0 10px 25px rgba(55, 103, 178, .2); }
.auth-brand span { display: grid; gap: 4px; }
.auth-brand strong { font-size: 20px; }
.auth-brand small { color: var(--muted); }
.auth-heading > span, .section-title span, .panel-head > div > span {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
.auth-heading h1 { margin: 8px 0 10px; font-size: 28px; }
.auth-heading p { margin: 0 0 24px; color: var(--muted); line-height: 1.75; }
.auth-form, .settings-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; }
label > span { font-size: 14px; font-weight: 700; }
label > small { color: var(--muted); line-height: 1.5; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdff;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(55, 103, 178, .1); }
.primary-button, .secondary-button {
  border: 0;
  border-radius: 11px;
  padding: 13px 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.primary-button { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 10px 24px rgba(55, 103, 178, .23); }
.secondary-button { color: var(--blue); background: var(--blue-soft); border: 1px solid #cddcf3; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.back-home { display: block; margin-top: 22px; color: var(--blue); text-align: center; font-size: 14px; }
.notice { margin-bottom: 20px; padding: 13px 16px; border-radius: 11px; line-height: 1.6; }
.notice-error { color: #9b3544; background: #fff0f2; border: 1px solid #f4ccd2; }
.notice-success { color: #176c50; background: #eaf8f2; border: 1px solid #bee7d7; }
.notice-warning { color: #805715; background: #fff8e7; border: 1px solid #efd89c; }

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  color: #fff;
  background: linear-gradient(110deg, #315f9f, #3c72bd);
  box-shadow: 0 8px 30px rgba(32, 61, 103, .15);
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand img { border-radius: 13px; object-fit: cover; }
.admin-brand span { display: grid; gap: 2px; }
.admin-brand strong { font-size: 17px; }
.admin-brand small { color: #dceaff; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions a, .header-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.09);
  cursor: pointer;
}
.header-actions form { margin: 0; }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.admin-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { padding: 12px 14px; border-radius: 10px; color: #63748e; font-weight: 700; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.is-active { color: var(--blue); background: var(--blue-soft); }
.sidebar-user { padding: 15px; border-radius: 12px; background: #f5f8fd; display: grid; gap: 5px; }
.sidebar-user span { color: var(--muted); font-size: 12px; }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; }
.admin-main { min-width: 0; padding: 34px clamp(22px, 4vw, 58px) 28px; }
.admin-section { max-width: 1160px; margin: 0 auto 28px; scroll-margin-top: 100px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-title h1, .panel-head h2 { margin: 7px 0 0; }
.section-title h1 { font-size: clamp(25px, 3vw, 34px); }
.section-title p, .panel-head p { margin: 0; max-width: 470px; color: var(--muted); line-height: 1.65; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: 0 12px 30px rgba(50, 77, 118, .06); }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin: 10px 0 5px; font-size: clamp(28px, 3vw, 38px); }
.stat-card small { color: #97a4b6; }
.stat-card::after { content: ""; position: absolute; right: -20px; bottom: -28px; width: 85px; height: 85px; border-radius: 50%; background: rgba(55, 103, 178, .07); }
.stat-main { color: #fff; border: 0; background: linear-gradient(145deg, #3767b2, #285493); }
.stat-main span, .stat-main small { color: #dbe9ff; }
.stat-main::after { background: rgba(255,255,255,.1); }
.panel { padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 12px 34px rgba(50, 77, 118, .06); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid #e8eef6; }
.panel-head h2 { font-size: 22px; }
.version-chip { flex: none; padding: 8px 13px; border-radius: 999px; color: #fff; background: var(--red); font-size: 13px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-field { margin-top: 2px; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding-top: 4px; }
.form-footer p { margin: 0; color: var(--muted); font-size: 13px; }
.database-state { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid #dce5f2; border-radius: 999px; color: var(--muted); background: #f7f9fc; font-size: 12px; font-weight: 800; }
.database-state i { width: 8px; height: 8px; border-radius: 50%; background: #9aa8ba; box-shadow: 0 0 0 4px rgba(154, 168, 186, .13); }
.database-state.is-ready { color: #17714f; border-color: #bfe4d5; background: #edf9f4; }
.database-state.is-ready i { background: #2a9a70; box-shadow: 0 0 0 4px rgba(42, 154, 112, .13); }
.database-state.is-error { color: #9b3544; border-color: #f0c5cc; background: #fff0f2; }
.database-state.is-error i { background: #cf5263; box-shadow: 0 0 0 4px rgba(207, 82, 99, .13); }
.database-status-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 24px; padding: 19px; border: 1px solid #dce6f2; border-radius: 14px; background: linear-gradient(135deg, #f6f9ff, #fbfdff); }
.database-status-copy { display: grid; align-content: center; gap: 7px; }
.database-status-copy strong { font-size: 16px; }
.database-status-copy span { color: var(--muted); line-height: 1.65; font-size: 13px; }
.database-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; margin: 0; }
.database-meta div { min-width: 0; padding: 9px 11px; border-radius: 9px; background: rgba(255, 255, 255, .82); }
.database-meta dt { color: var(--muted); font-size: 10px; }
.database-meta dd { overflow: hidden; margin: 5px 0 0; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.database-error { display: grid; gap: 4px; margin: 14px 0 0; }
.database-error strong { font-size: 13px; }
.database-count-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.database-count-grid article { padding: 14px 16px; border: 1px solid #e2e9f3; border-radius: 12px; background: #fbfcff; }
.database-count-grid span { display: block; color: var(--muted); font-size: 11px; }
.database-count-grid strong { display: block; margin-top: 6px; font-size: 22px; }
.database-form { display: grid; gap: 17px; margin-top: 20px; }
.database-driver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.database-driver-option { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1px solid #dce5f2; border-radius: 13px; background: #fbfcff; cursor: pointer; }
.database-driver-option:has(input:checked) { color: var(--blue-dark); border-color: #a9c1e4; background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(55, 103, 178, .08); }
.database-driver-option input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--blue); box-shadow: none; }
.database-driver-option > span { display: grid; gap: 4px; }
.database-driver-option strong { font-size: 14px; }
.database-driver-option small { color: var(--muted); line-height: 1.45; font-size: 11px; }
.database-config-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 14px; }
.database-config-card { min-width: 0; margin: 0; padding: 17px; border: 1px solid #dce6f2; border-radius: 14px; background: #f8faff; }
.database-config-card legend { padding: 0 7px; color: var(--blue-dark); font-size: 13px; font-weight: 800; }
.mysql-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.database-config-card label > span { font-size: 12px; }
.database-config-card label > small { font-size: 11px; }
.database-form-footer { padding-top: 2px; }
.api-status-card { margin-bottom: 14px; }
.api-status-card .database-meta div:first-child { grid-column: 1 / -1; }
.api-status-card .database-meta dd { font-family: Consolas, "SFMono-Regular", monospace; }
.api-token-reveal { margin-top: 16px; }
.api-token-reveal textarea, .api-example-grid textarea { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; line-height: 1.6; }
.api-security-note code { padding: 1px 5px; border-radius: 5px; color: var(--blue-dark); background: rgba(55, 103, 178, .09); font-family: Consolas, "SFMono-Regular", monospace; }
.api-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.api-action-row form { margin: 0; }
.api-example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.api-example-grid article { min-width: 0; padding: 17px; border: 1px solid #dce6f2; border-radius: 14px; background: #f8faff; }
.api-example-grid h3 { margin: 0; font-size: 14px; }
.api-example-grid p { min-height: 40px; margin: 7px 0 11px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.api-example-grid textarea { width: 100%; min-height: 132px; resize: vertical; white-space: pre; }
.api-example-grid .tiny-button { margin-top: 9px; }
.table-wrap { overflow-x: auto; border: 1px solid #e5ebf4; border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 13px 16px; border-bottom: 1px solid #edf1f6; text-align: left; }
th { color: #71819a; background: #f7f9fc; font-size: 12px; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.version-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.version-stats article { padding: 18px; border-radius: 14px; background: #f7f9fd; }
.version-stats h3 { margin: 0 0 13px; font-size: 15px; }
.version-stats article > div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #e6ecf4; color: var(--muted); }
.version-stats article > div strong { color: var(--ink); }
.empty-text { color: var(--muted); font-size: 13px; }
.card-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.card-security-note { display: flex; gap: 12px; align-items: center; margin: -4px 0 20px; padding: 13px 16px; border: 1px solid #f0d8ad; border-radius: 12px; color: #806035; background: #fff8eb; font-size: 13px; }
.card-security-note strong { flex: none; }
.card-summary-grid article { padding: 16px 18px; border: 1px solid #e2e9f3; border-radius: 13px; background: #f8faff; }
.card-summary-grid span { display: block; color: var(--muted); font-size: 12px; }
.card-summary-grid strong { display: block; margin-top: 7px; font-size: 25px; }
.generated-cards { display: grid; gap: 14px; margin-bottom: 22px; padding: 19px; border: 1px solid #bfe4d5; border-radius: 14px; background: #edf9f4; }
.generated-cards > div { display: grid; gap: 4px; }
.generated-cards > div span { color: var(--success); font-weight: 800; }
.generated-cards > div strong { font-size: 13px; }
.generated-cards textarea { font-family: Consolas, monospace; background: #fff; }
.generated-cards button { justify-self: start; }
.card-generator { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 19px; border-radius: 14px; background: #f5f8fd; }
.card-generator .primary-button { min-height: 45px; white-space: nowrap; }
.card-export-panel { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.5fr); gap: 18px; margin-top: 16px; padding: 17px 19px; border: 1px solid #dce6f2; border-radius: 14px; background: #fbfcff; }
.card-export-panel > div:first-child { display: grid; align-content: start; gap: 6px; }
.card-export-panel > div:first-child span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.card-export-files { display: grid; gap: 8px; }
.card-export-files > small { color: var(--muted); }
.card-export-files > .card-export-error { color: #9b3544; }
.card-export-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid #e2e9f3; border-radius: 10px; background: #fff; }
.card-export-file > span { display: grid; gap: 3px; min-width: 0; }
.card-export-file > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-export-file > span small { color: var(--muted); font-size: 11px; }
.card-table-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 28px 0 13px; }
.card-table-head h3 { margin: 0 0 5px; }
.card-table-head p { margin: 0; color: var(--muted); font-size: 13px; }
.card-table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.card-table-tools > span { color: var(--muted); font-size: 13px; }
.card-table-tools form { margin: 0; }
.card-list-toolbar { padding-top: 4px; border-top: 1px solid #e8eef6; }
.card-list-group { margin-top: 16px; padding: 18px; border: 1px solid #dfe7f1; border-radius: 15px; scroll-margin-top: 96px; }
.card-list-group-unused { border-color: #c9e6db; background: #f7fcfa; }
.card-list-group-used { border-color: #eadccb; background: #fffcf8; }
.card-list-group .card-table-head { margin: 0 0 13px; }
.card-list-group .table-wrap { background: #fff; }
.card-list-group-unused .card-table-head h3 { color: #247758; }
.card-list-group-used .card-table-head h3 { color: #93612f; }
.card-table { min-width: 1420px; }
.card-table td { vertical-align: top; }
.card-table td > small, .card-table td > strong + small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.masked-card { font-family: Consolas, monospace; font-size: 13px; white-space: nowrap; }
.full-card-line { display: flex; align-items: center; gap: 7px; }
.full-card { font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }
.copy-card-button { min-height: 28px; padding: 3px 8px; }
.legacy-card-note { color: #a16b35 !important; }
.card-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-active { color: #17714f; background: #e7f7f0; }
.status-disabled { color: #8b5960; background: #f3edef; }
.status-expired { color: #9a6532; background: #fff3df; }
.status-exhausted { color: #a43f4e; background: #ffedf0; }
.status-invalid { color: #842f46; background: #f8dce4; }
.card-actions { display: grid; grid-template-columns: minmax(310px, 1fr) auto auto; gap: 7px; min-width: 470px; }
.card-actions form { margin: 0; }
.card-limit-form { display: grid; grid-template-columns: 76px 130px auto; align-items: end; gap: 6px; }
.card-limit-form label { gap: 4px; }
.card-limit-form label > span { font-size: 10px; color: var(--muted); }
.card-limit-form input { min-height: 34px; padding: 6px 8px; border-radius: 8px; font-size: 12px; }
.tiny-button { min-height: 34px; padding: 6px 10px; border: 1px solid #cbd9ed; border-radius: 8px; color: var(--blue); background: #f2f6fc; font-weight: 800; font-size: 12px; cursor: pointer; white-space: nowrap; }
.warning-button { color: #9a6532; border-color: #eed6ab; background: #fff6e7; }
.danger-button { color: #ae4252; border-color: #f0c5cc; background: #fff0f2; }
.empty-cell { padding: 28px; color: var(--muted); text-align: center; }
.table-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.account-confirm { display: flex; justify-content: flex-end; align-items: end; gap: 14px; }
.account-confirm label { width: min(100%, 360px); }
.account-confirm button { min-height: 44px; }
.admin-footer { max-width: 1160px; margin: 8px auto 0; color: #8a98aa; text-align: center; font-size: 12px; }

.smtp-status-card { margin-top: 14px; margin-bottom: 14px; }
.smtp-status-card .database-meta div:first-child { grid-column: 1 / -1; }
.smtp-status-card .database-meta dd { font-family: Consolas, "SFMono-Regular", monospace; }
.smtp-rule-grid, .smtp-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.smtp-rule-grid { margin: 16px 0 20px; }
.smtp-rule-grid article, .smtp-summary-grid article { padding: 15px 16px; border: 1px solid #dfe8f4; border-radius: 13px; background: linear-gradient(145deg, #f8faff, #fff); }
.smtp-rule-grid span, .smtp-summary-grid span { display: block; color: var(--muted); font-size: 11px; }
.smtp-rule-grid strong, .smtp-summary-grid strong { display: block; margin-top: 6px; font-size: 21px; }
.smtp-rule-grid small { display: block; margin-top: 5px; color: #8b98aa; line-height: 1.45; }
.smtp-settings-form { gap: 0; }
.smtp-form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.smtp-form-row { grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 7px 16px; }
.smtp-form-row > span { color: #35455d; font-size: 13px; text-align: right; }
.smtp-form-row > input, .smtp-form-row > select, .smtp-form-row > textarea { grid-column: 2; min-height: 38px; padding: 9px 12px; border-radius: 7px; background: #fff; }
.smtp-form-row > small { grid-column: 2; color: #8491a4; font-size: 11px; }
.smtp-textarea-row { align-items: start; }
.smtp-textarea-row > span { padding-top: 10px; }
.smtp-textarea-row > textarea { min-height: 134px; }
.smtp-advanced-settings { margin: 18px 0 0 108px; padding-top: 14px; border-top: 1px dashed #dce5f2; }
.smtp-advanced-settings summary { color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 800; list-style-position: outside; }
.smtp-advanced-settings summary small { margin-left: 7px; color: var(--muted); font-weight: 400; }
.smtp-advanced-settings[open] summary { margin-bottom: 15px; }
.smtp-test-form { display: none; }
.smtp-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 30px; padding-left: 108px; }
.smtp-form-actions > span { color: var(--muted); font-size: 12px; }
.smtp-save-button, .smtp-test-button { min-height: 36px; padding: 8px 16px; border-radius: 4px; box-shadow: none; }
.smtp-save-button { background: #0aa293; }
.smtp-test-button { border: 0; color: #fff; background: #ff5b43; }
.smtp-form-actions button:disabled, .primary-button:disabled, .secondary-button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.smtp-section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 4px; padding-top: 25px; border-top: 1px solid #e8eef6; }
.smtp-section-title > div > span { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.smtp-section-title h3 { margin: 5px 0 0; font-size: 17px; }
.smtp-section-title .secondary-button { min-height: 36px; padding: 8px 14px; }
.smtp-security-note { margin-top: 0; }
.smtp-example-grid textarea { min-height: 190px; }
.smtp-delivery-summary { margin-top: 24px; padding-top: 2px; border-top: 1px solid #e8eef6; }
.smtp-summary-grid { margin-bottom: 14px; }
.smtp-summary-grid strong { font-size: 24px; }
.smtp-table-wrap table { min-width: 960px; }
.smtp-table-wrap td { vertical-align: top; font-size: 12px; }
.smtp-table-wrap code { font-family: Consolas, "SFMono-Regular", monospace; color: var(--blue-dark); }
.smtp-table-wrap td small { display: block; margin-top: 5px; color: #a05c67; }
.smtp-delivery-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.smtp-delivery-status.status-sent { color: #17714f; background: #e7f7f0; }
.smtp-delivery-status.status-failed, .smtp-delivery-status.status-permanent_failed { color: #a43f4e; background: #ffedf0; }
.smtp-delivery-status.status-delivery_unknown { color: #875d1d; background: #fff3db; }
.smtp-delivery-status.status-preparing, .smtp-delivery-status.status-prepared, .smtp-delivery-status.status-sending { color: #315f9f; background: #eaf2ff; }
.smtp-claim-summary { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e8eef6; scroll-margin-top: 88px; }
.smtp-claim-counters { margin: 14px 0; }
.smtp-claim-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; padding: 14px; border: 1px solid #e3eaf4; border-radius: 13px; background: #f8faff; }
.smtp-claim-filter label { display: grid; gap: 6px; min-width: min(100%, 260px); }
.smtp-claim-filter label:first-child { flex: 1 1 320px; }
.smtp-claim-filter label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.smtp-claim-filter input, .smtp-claim-filter select { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.smtp-claim-filter .tiny-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.smtp-claim-reset { color: #66758a; }
.smtp-claim-table-wrap table { min-width: 1020px; }
.smtp-claim-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.smtp-claim-status.is-cooling { color: #875d1d; background: #fff3db; }
.smtp-claim-status.is-processing { color: #315f9f; background: #eaf2ff; }
.smtp-claim-status.is-eligible { color: #17714f; background: #e7f7f0; }
.smtp-claim-action-notice { margin: 0 0 14px; }
.smtp-claim-delete-form { margin: 0; }
.smtp-claim-delete-button { min-height: 30px; padding: 5px 9px; }

.qq-binding-panel { position: relative; overflow: hidden; isolation: isolate; }
.qq-binding-panel::before, .qq-binding-panel::after { content: ""; position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.qq-binding-panel > * { position: relative; z-index: 1; }
.qq-binding-panel::before { top: -120px; right: -90px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(102, 126, 234, .12), rgba(102, 126, 234, 0) 70%); }
.qq-binding-panel::after { left: -110px; bottom: -150px; width: 310px; height: 310px; background: radial-gradient(circle, rgba(232, 101, 115, .09), rgba(232, 101, 115, 0) 70%); }
.qq-binding-panel-head { align-items: flex-start; }
.qq-binding-panel-head p { margin-top: 8px; max-width: 650px; }
.qq-binding-total-chip { display: grid; min-width: 128px; padding: 12px 18px; border: 1px solid #d8e2f6; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #6b7fd7, #435cae); box-shadow: 0 10px 24px rgba(69, 91, 171, .2); text-align: center; }
.qq-binding-total-chip span { color: #e8edff; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.qq-binding-total-chip strong { margin-top: 3px; font-size: 25px; line-height: 1.1; }
.qq-binding-intro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0 0 18px; padding: 17px 19px; border: 1px solid #dce4f8; border-radius: 16px; background: linear-gradient(125deg, #f4f6ff, #fff8fb); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); }
.qq-binding-intro-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(145deg, #7186dc, #5167bd); box-shadow: 0 9px 20px rgba(81, 103, 189, .24); }
.qq-binding-intro-icon span { position: relative; width: 22px; height: 16px; border: 2px solid #fff; border-radius: 5px; }
.qq-binding-intro-icon span::before { content: ""; position: absolute; left: 4px; right: 4px; top: -9px; height: 10px; border: 2px solid #fff; border-bottom: 0; border-radius: 10px 10px 0 0; }
.qq-binding-intro strong { display: block; color: #354b91; font-size: 15px; }
.qq-binding-intro p { margin: 5px 0 0; color: #6d7993; font-size: 12px; line-height: 1.7; }
.qq-binding-privacy-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border: 1px solid #efcad8; border-radius: 999px; color: #a64e6d; background: #fff2f7; font-size: 11px; font-weight: 800; white-space: nowrap; }
.qq-binding-notice { margin: 0 0 14px; }
.qq-binding-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin: 0 0 16px; }
.qq-binding-summary-grid article { position: relative; overflow: hidden; min-width: 0; padding: 16px; border: 1px solid #e0e7f4; border-radius: 14px; background: rgba(255, 255, 255, .92); box-shadow: 0 7px 20px rgba(49, 72, 111, .05); }
.qq-binding-summary-grid article::after { content: ""; position: absolute; right: -17px; bottom: -21px; width: 62px; height: 62px; border-radius: 50%; background: rgba(76, 102, 180, .07); }
.qq-binding-summary-grid article.is-today::after { background: rgba(36, 159, 121, .09); }
.qq-binding-summary-grid article.is-groups::after { background: rgba(226, 151, 62, .1); }
.qq-binding-summary-grid article.is-recent::after { background: rgba(111, 89, 190, .09); }
.qq-binding-summary-grid article.is-pending::after { background: rgba(220, 91, 116, .09); }
.qq-binding-summary-grid span { display: block; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.qq-binding-summary-grid strong { display: block; margin-top: 5px; color: #354b91; font-size: 25px; line-height: 1.2; }
.qq-binding-summary-grid .is-today strong { color: #238965; }
.qq-binding-summary-grid .is-groups strong { color: #9a6532; }
.qq-binding-summary-grid .is-recent strong { color: #6750a4; }
.qq-binding-summary-grid .is-pending strong { color: #b14e62; }
.qq-binding-summary-grid small { display: block; margin-top: 4px; color: #97a3b5; font-size: 10px; }
.qq-binding-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 15px; padding: 14px; border: 1px solid #e1e8f4; border-radius: 14px; background: linear-gradient(135deg, #f8faff, #fcfbff); }
.qq-binding-filter label { flex: 1 1 460px; gap: 6px; min-width: 260px; }
.qq-binding-filter label > span { color: #53627a; font-size: 11px; font-weight: 800; }
.qq-binding-filter input { min-height: 37px; padding: 8px 11px; border-radius: 9px; background: #fff; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.qq-binding-filter .tiny-button { display: inline-flex; align-items: center; justify-content: center; min-height: 37px; text-decoration: none; }
.qq-binding-filter-reset { color: #69778b; }
.qq-binding-table-wrap { position: relative; max-width: 100%; border-color: #dfe6f2; background: rgba(255, 255, 255, .96); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.qq-binding-table { min-width: 1000px; }
.qq-binding-table th { padding-top: 12px; padding-bottom: 12px; color: #66768e; background: linear-gradient(180deg, #f8faff, #f4f7fc); white-space: nowrap; }
.qq-binding-table td { vertical-align: top; color: #40516b; font-size: 12px; }
.qq-binding-table tbody tr { transition: background .18s; }
.qq-binding-table tbody tr:hover { background: #fbfcff; }
.qq-binding-table th:nth-child(1), .qq-binding-table td:nth-child(1) { width: 280px; }
.qq-binding-table th:nth-child(2), .qq-binding-table td:nth-child(2) { width: 150px; }
.qq-binding-table th:nth-child(3), .qq-binding-table td:nth-child(3) { width: 110px; }
.qq-binding-table th:nth-child(4), .qq-binding-table td:nth-child(4) { width: 245px; }
.qq-binding-table th:nth-child(5), .qq-binding-table td:nth-child(5) { width: 180px; }
.qq-binding-identity { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 7px; min-width: 0; }
.qq-binding-identity code { display: block; overflow-wrap: anywhere; color: #324f86; font-family: Consolas, "SFMono-Regular", monospace; font-size: 11px; line-height: 1.55; word-break: break-all; }
.qq-binding-qq code { color: #ad4961; font-size: 13px; font-weight: 800; word-break: normal; }
.qq-binding-table td:nth-child(2) > small { display: block; margin-top: 5px; color: #8e9bad; font-size: 10px; }
.qq-binding-copy { min-height: 25px; padding: 3px 7px; border: 1px solid #d4def0; border-radius: 7px; color: #536fc2; background: #f3f6ff; font-size: 10px; font-weight: 800; cursor: pointer; }
.qq-binding-copy:hover { border-color: #b8c8e7; background: #eaf0ff; }
.qq-binding-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.qq-binding-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(35, 137, 101, .1); }
.qq-binding-status.is-verified { color: #1d7d5d; background: #e8f8f1; }
.qq-binding-status.is-pending { color: #95631d; background: #fff4dc; }
.qq-binding-status.is-pending::before { box-shadow: 0 0 0 3px rgba(149, 99, 29, .1); }
.qq-binding-status.is-disabled { color: #a84558; background: #ffedf1; }
.qq-binding-status.is-disabled::before { box-shadow: 0 0 0 3px rgba(168, 69, 88, .1); }
.qq-binding-status.is-neutral { color: #66758a; background: #eef2f7; }
.qq-binding-status.is-neutral::before { box-shadow: 0 0 0 3px rgba(102, 117, 138, .1); }
.qq-binding-time-cell strong { display: block; color: #3f5068; font-size: 11px; line-height: 1.5; }
.qq-binding-time-cell small { display: block; margin-top: 4px; color: #8d99aa; font-size: 10px; line-height: 1.45; }
.qq-binding-delete-form { margin: 0; }
.qq-binding-delete-button { min-height: 30px; padding: 5px 9px; }
.qq-binding-table-note { margin-top: 13px; padding-left: 2px; line-height: 1.65; }

@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .database-status-card { grid-template-columns: 1fr; }
  .database-count-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .database-config-grid { grid-template-columns: 1fr; }
  .smtp-form-grid { grid-template-columns: 1fr; }
  .smtp-rule-grid, .smtp-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qq-binding-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-generator { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-generator .primary-button { justify-self: start; }
  .card-export-panel { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-header { height: auto; min-height: 70px; padding: 11px 16px; }
  .admin-brand small, .header-actions a { display: none; }
  .admin-layout { display: block; }
  .admin-sidebar { position: static; width: 100%; height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .admin-sidebar nav { display: flex; width: max-content; }
  .admin-sidebar nav a { white-space: nowrap; }
  .sidebar-user { display: none; }
  .admin-main { padding: 24px 14px; }
  .section-title, .panel-head, .form-footer { align-items: flex-start; flex-direction: column; }
  .form-grid, .three-columns, .version-stats { grid-template-columns: 1fr; }
  .database-driver-grid, .mysql-fields-grid { grid-template-columns: 1fr; }
  .database-count-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .database-form-footer .primary-button { width: 100%; }
  .api-example-grid { grid-template-columns: 1fr; }
  .api-action-row { align-items: stretch; flex-direction: column; }
  .api-action-row form, .api-action-row button { width: 100%; }
  .smtp-form-grid { grid-template-columns: 1fr; }
  .smtp-form-row { grid-template-columns: 1fr; gap: 7px; }
  .smtp-form-row > span { text-align: left; }
  .smtp-form-row > input, .smtp-form-row > select, .smtp-form-row > textarea, .smtp-form-row > small { grid-column: 1; }
  .smtp-textarea-row > span { padding-top: 0; }
  .smtp-advanced-settings { margin-left: 0; }
  .smtp-form-actions { padding-left: 0; }
  .smtp-section-title { align-items: flex-start; flex-direction: column; }
  .smtp-claim-filter { align-items: stretch; flex-direction: column; }
  .smtp-claim-filter label, .smtp-claim-filter label:first-child, .smtp-claim-filter .tiny-button { flex: none; width: 100%; min-width: 0; }
  .smtp-claim-table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .smtp-claim-table-wrap th:last-child, .smtp-claim-table-wrap td:last-child { position: sticky; right: 0; z-index: 1; box-shadow: -8px 0 12px -12px rgba(31, 52, 84, .48); }
  .smtp-claim-table-wrap th:last-child { z-index: 2; background: #f7f9fc; }
  .smtp-claim-table-wrap td:last-child { background: #fff; }
  .qq-binding-panel-head { align-items: stretch; }
  .qq-binding-total-chip { width: 100%; min-width: 0; text-align: left; }
  .qq-binding-total-chip strong { font-size: 22px; }
  .qq-binding-intro { grid-template-columns: auto minmax(0, 1fr); }
  .qq-binding-privacy-badge { grid-column: 2; justify-self: start; }
  .qq-binding-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qq-binding-filter { align-items: stretch; flex-direction: column; }
  .qq-binding-filter label, .qq-binding-filter .tiny-button { flex: none; width: 100%; min-width: 0; }
  .qq-binding-table-wrap th:last-child, .qq-binding-table-wrap td:last-child { position: sticky; right: 0; z-index: 1; box-shadow: -8px 0 12px -12px rgba(31, 52, 84, .48); }
  .qq-binding-table-wrap th:last-child { z-index: 2; background: #f5f8fd; }
  .qq-binding-table-wrap td:last-child { background: #fff; }
  .card-generator { grid-template-columns: 1fr; }
  .card-export-file { align-items: flex-start; flex-direction: column; }
  .card-table-head { align-items: flex-start; flex-direction: column; }
  .card-table-tools { justify-content: flex-start; width: 100%; }
  .card-list-group { padding: 14px; }
  .card-table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .account-confirm { align-items: stretch; flex-direction: column; }
  .account-confirm label { width: 100%; }
}

@media (max-width: 480px) {
  .auth-card { padding: 25px 20px; border-radius: 19px; }
  .auth-heading h1 { font-size: 24px; }
  .stat-grid { grid-template-columns: 1fr; }
  .card-summary-grid { grid-template-columns: 1fr 1fr; }
  .database-meta, .database-count-grid { grid-template-columns: 1fr 1fr; }
  .database-status-card, .database-config-card { padding: 15px; }
  .smtp-rule-grid, .smtp-summary-grid { grid-template-columns: 1fr 1fr; }
  .qq-binding-intro { grid-template-columns: 1fr; padding: 16px; }
  .qq-binding-intro-icon { width: 42px; height: 42px; }
  .qq-binding-privacy-badge { grid-column: 1; }
  .qq-binding-summary-grid { grid-template-columns: 1fr 1fr; }
  .qq-binding-summary-grid article { padding: 14px; }
  .smtp-form-actions { align-items: stretch; flex-direction: column; }
  .smtp-form-actions button { width: 100%; }
  .smtp-advanced-settings summary small { display: block; margin: 5px 0 0 17px; }
  .card-table-tools .inline-danger-form { width: 100%; }
  .card-table-tools .inline-danger-form .tiny-button { width: 100%; }
  .panel { padding: 20px 15px; }
  .header-actions button { padding: 0 11px; }
}
