:root {
  --bg-a: #e8f1fb;
  --bg-b: #f6fbff;
  --ink: #162033;
  --muted: #6b7890;
  --line: rgba(111, 133, 165, 0.28);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.93);
  --blue: #2f7df6;
  --blue-deep: #1f63d9;
  --blue-soft: #e6f0ff;
  --red: #ef4444;
  --red-soft: #fff1f0;
  --shadow: 0 22px 70px rgba(66, 92, 125, 0.2);
  --shadow-soft: 0 14px 36px rgba(66, 92, 125, 0.12);
  --shadow-blue: 0 18px 42px rgba(47, 125, 246, 0.22);
  --focus-ring: 0 0 0 4px rgba(47, 125, 246, 0.16);
  --ease-ui: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(68, 146, 255, 0.18), transparent 30%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b) 54%, #edf7f2);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    background 200ms ease,
    border-color 200ms ease,
    color 160ms ease,
    opacity 160ms ease,
    filter 200ms ease;
}

button:disabled:not(.is-busy) {
  cursor: not-allowed;
  opacity: 0.76;
  transform: none;
  filter: saturate(0.7);
}

button:active:not(:disabled),
.tool-tab:active,
.history-item:active,
.recent-item:active {
  transform: translateY(0) scale(0.985);
}

button:focus-visible,
.tool-tab:focus-visible,
.history-main:focus-visible,
.message-main:focus-visible,
.recent-item:focus-visible,
.history-restore:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mini-icon,
.button-icon,
.title-icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
  transition: transform 180ms var(--ease-ui), filter 200ms ease;
}

.mini-icon {
  width: 18px;
  height: 18px;
  margin-right: 7px;
}

.button-icon {
  width: 20px;
  height: 20px;
  margin-right: 7px;
}

.title-icon {
  width: 32px;
  height: 32px;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100vw - 54px));
  min-height: 74px;
  margin: 0 auto 16px;
  padding: 0 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(242, 248, 255, 0.78);
  box-shadow: 0 18px 58px rgba(66, 92, 125, 0.16);
  backdrop-filter: blur(20px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #536dff;
  font-size: 19px;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  width: 28px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(135deg, #536dff, #4dd6ff);
  box-shadow: 0 8px 18px rgba(83, 109, 255, 0.24);
}

.tool-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(111, 133, 165, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 28px rgba(66, 92, 125, 0.1);
}

.tool-tab {
  display: inline-grid;
  position: relative;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  padding: 0 16px;
  color: #4f607a;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  overflow: hidden;
}

.tool-tab::before {
  content: "";
  position: absolute;
  inset: -16px auto -16px -36px;
  width: 28px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: skewX(-22deg) translateX(-130px);
  transition: transform 480ms ease;
  pointer-events: none;
}

.tool-tab:hover {
  color: #2a4e96;
  background: rgba(255, 255, 255, 0.92);
}

.tool-tab:hover::before {
  transform: skewX(-22deg) translateX(210px);
}

.tool-tab.active {
  color: var(--blue);
  background: #e8f1ff;
  box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.14);
}

.site-locked {
  background:
    radial-gradient(circle at 18% 12%, rgba(84, 109, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #17192e 0%, #181a2e 100%);
}

.site-lock-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.site-lock-card {
  overflow: hidden;
  width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(69, 203, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(12, 18, 34, 0.96), rgba(8, 12, 25, 0.97)),
    #0b1324;
  box-shadow:
    0 28px 80px rgba(7, 11, 24, 0.32),
    inset 0 1px 0 rgba(133, 228, 255, 0.06);
  backdrop-filter: blur(18px);
}

.site-lock-inner {
  display: grid;
  gap: 16px;
  padding: 28px 30px 30px;
}

.site-lock-title {
  margin: 0;
  color: #f4fbff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.06;
}

.site-lock-form {
  display: grid;
  gap: 10px;
}

.site-lock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.site-lock-form input {
  min-height: 44px;
  border: 1px solid rgba(72, 199, 255, 0.22);
  border-radius: 12px;
  padding: 0 12px;
  color: #edf7ff;
  background:
    linear-gradient(180deg, rgba(18, 27, 48, 0.96), rgba(13, 22, 40, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 32px rgba(5, 9, 20, 0.16);
}

.site-lock-form input::placeholder {
  color: #6f87ab;
}

.site-lock-status {
  min-height: 20px;
  margin: 2px 0 0;
  color: #8ca3c2;
  font-size: 13px;
  text-align: center;
}

.site-lock-status[data-tone="success"] {
  color: #63e3b0;
}

.site-lock-status[data-tone="error"] {
  color: #ff8f8f;
}

.page-shell {
  width: min(1120px, calc(100vw - 54px));
  margin: 0 auto;
  padding: 0 0 20px;
}

.dashboard {
  display: grid;
  grid-template-columns: 300px minmax(0, 800px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.main-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.history-panel,
.generator-panel,
.mail-zone {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.history-panel {
  min-height: 130px;
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #006a8e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #538eff);
  box-shadow: 0 10px 18px rgba(50, 72, 102, 0.18);
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover,
.history-restore:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
  filter: saturate(1.04);
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  transition:
    transform 180ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    background 200ms ease,
    border-color 200ms ease;
}

.history-item:hover,
.history-item.active {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 246, 0.62);
  box-shadow: 0 10px 20px rgba(47, 125, 246, 0.12);
  background: white;
}

.history-main {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.history-action {
  display: inline-grid;
  position: relative;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #bfd0ec;
  border-radius: 8px;
  background: #eef5ff;
  font-size: 13px;
  line-height: 1;
  overflow: hidden;
}

.history-action:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 20px rgba(47, 125, 246, 0.14);
}

.history-action.pin {
  color: #1e63d4;
}

.history-action.delete {
  color: #d93c3c;
  background: #fff1f1;
  border-color: #ffd1d1;
}

.history-address {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-time,
.history-empty {
  color: #8a9ab2;
  font-size: 12px;
}

.generator-panel {
  position: relative;
  overflow: hidden;
}

.accent-line {
  height: 4px;
  background: linear-gradient(90deg, #2f7df6, #4fd1c5 45%, #ff4e92);
}

.generator-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px 0;
}

.generator-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.generator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
  gap: 18px;
  padding: 8px 22px 16px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 900;
}

.current-address {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--blue);
  background: rgba(232, 242, 255, 0.86);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 900;
  overflow-wrap: anywhere;
  transition: box-shadow 200ms ease, transform 180ms var(--ease-ui), background 200ms ease;
}

.current-address:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 14px 28px rgba(47, 125, 246, 0.12);
}

.current-address.custom-mode {
  min-height: 90px;
  gap: 8px;
  padding: 8px;
}

.inline-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  width: 100%;
}

.inline-custom[hidden] {
  display: none !important;
}

.inline-custom input {
  min-height: 36px;
  border-color: #7aa7ff;
  background: #ffffff;
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  font-weight: 700;
}

.inline-custom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.button-grid .secondary.muted {
  grid-column: span 2;
}

.button-grid button,
.inline-custom button,
.mode,
.random-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  min-height: 36px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 13px;
  padding: 0 14px;
  overflow: hidden;
  isolation: isolate;
}

.button-grid button::before,
.inline-custom button::before,
.mode::before,
.random-main::before,
.detail-action::before,
.message-action::before,
.ghost-danger::before,
.history-restore::before {
  content: "";
  position: absolute;
  inset: -18px auto -18px -42px;
  width: 32px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
  transform: skewX(-22deg) translateX(-136px);
  transition: transform 520ms ease;
  pointer-events: none;
}

.button-grid button:hover::before,
.inline-custom button:hover::before,
.mode:hover::before,
.random-main:hover::before,
.detail-action:hover::before,
.message-action:hover::before,
.ghost-danger:hover::before,
.history-restore:hover::before {
  transform: skewX(-22deg) translateX(280px);
}

.button-grid button:hover,
.inline-custom button:hover,
.mode:hover,
.random-main:hover,
.detail-action:hover,
.ghost-danger:hover {
  transform: translateY(-2px);
}

.button-grid button:hover .button-icon,
.inline-custom button:hover .button-icon,
.mode:hover .button-icon,
.random-main:hover .button-icon,
.message-action:hover .button-icon {
  transform: translateY(-1px) scale(1.06);
  filter: saturate(1.1);
}

.button-grid .button-icon,
.inline-custom .button-icon,
.mode .button-icon,
.random-main .button-icon,
.detail-action .button-icon {
  margin: 0;
}

.primary-outline {
  border: 1px solid var(--blue);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.primary-outline:hover {
  border-color: rgba(47, 125, 246, 0.72);
  background: linear-gradient(180deg, white, #eef5ff);
  box-shadow: 0 16px 34px rgba(47, 125, 246, 0.18);
}

.secondary,
.mode.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), #538eff);
  box-shadow: 0 16px 30px rgba(47, 125, 246, 0.24);
}

.secondary:hover,
.mode.active:hover {
  background: linear-gradient(135deg, var(--blue-deep), #397ef9);
  box-shadow: var(--shadow-blue);
}

.secondary.muted {
  color: #2d3d57;
  background: linear-gradient(180deg, #dceaff, #c8dcff);
  box-shadow: 0 14px 30px rgba(97, 129, 175, 0.16);
}

.secondary.muted:hover {
  color: #203757;
  background: linear-gradient(180deg, #e4f0ff, #cfe0ff);
  box-shadow: 0 16px 32px rgba(97, 129, 175, 0.2);
}

.disabled,
.disabled:hover {
  color: white;
  background: #8eb4ef;
  cursor: not-allowed;
}

.danger {
  border: 1px solid var(--red);
  color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.1);
}

.danger:hover {
  border-color: #ff7d7d;
  background: linear-gradient(180deg, #fff4f3, #ffe9e8);
  box-shadow: 0 16px 30px rgba(239, 68, 68, 0.16);
}

.field-label {
  display: flex;
  align-items: center;
  margin: 0 0 5px;
  color: #45556f;
  font-size: 13px;
  font-weight: 900;
}

.field-label + input {
  margin-bottom: 10px;
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #b9cbed;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 22px rgba(66, 92, 125, 0.08);
  outline: none;
  transition: border-color 180ms ease, box-shadow 200ms ease, transform 180ms var(--ease-ui);
}

input::placeholder,
textarea::placeholder {
  color: #8190a8;
  opacity: 1;
}

input[readonly] {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  color: #1d2a3f;
}

input:focus,
textarea:focus {
  border-color: rgba(47, 125, 246, 0.62);
  box-shadow: 0 0 0 4px rgba(47, 125, 246, 0.12);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--blue);
}

output {
  display: inline-grid;
  min-width: 48px;
  min-height: 30px;
  place-items: center;
  border: 1px solid rgba(47, 125, 246, 0.26);
  border-radius: 8px;
  color: var(--blue);
  background: #e7f0ff;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mode {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(111, 133, 165, 0.16);
  box-shadow: var(--shadow-soft);
}

.mode:hover:not(.active) {
  color: var(--blue);
  border-color: rgba(47, 125, 246, 0.38);
  background: rgba(255, 255, 255, 0.98);
}

.random-main {
  width: 100%;
  margin-top: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #538eff);
  font-size: 14px;
  box-shadow: 0 16px 34px rgba(47, 125, 246, 0.24);
}

.random-main:hover {
  background: linear-gradient(135deg, var(--blue-deep), #397ef9);
  box-shadow: var(--shadow-blue);
}

.mail-zone {
  display: block;
  min-height: 0;
  margin-top: 10px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(235, 248, 255, 0.78)),
    var(--panel);
}

.mail-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px 30px 8px;
}

.mail-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(111, 133, 165, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(66, 92, 125, 0.12);
}

.seg-btn {
  min-width: 74px;
  min-height: 34px;
  padding: 0 16px;
  color: #30415e;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.seg-btn.active {
  color: var(--blue);
  background: #e9f2ff;
}

.seg-btn:disabled {
  cursor: not-allowed;
  opacity: 0.74;
}

.mail-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(111, 133, 165, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 30px rgba(66, 92, 125, 0.1);
  font-size: 13px;
  font-weight: 900;
}

.mail-list-panel {
  border: 0;
  position: relative;
  background: transparent;
  padding: 10px 30px 20px;
}

.mail-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  font-weight: 900;
  font-size: 14px;
}

#status {
  color: var(--muted);
  font-size: 14px;
  transition: color 160ms ease, letter-spacing 160ms ease;
}

#status.is-refreshing {
  color: var(--blue);
  letter-spacing: 0.03em;
  background: #eef5ff;
  border-color: rgba(47, 125, 246, 0.2);
}

#status.is-success {
  color: #16764b;
  background: #eefbf4;
  border-color: rgba(22, 118, 75, 0.18);
}

#status.is-error {
  color: #c43b3b;
  background: #fff2f0;
  border-color: rgba(239, 68, 68, 0.18);
}

#status.is-refreshing::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(47, 125, 246, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin360 760ms linear infinite;
}

.message-list {
  display: grid;
  gap: 10px;
  background: transparent;
}

.mail-zone.is-refreshing .mail-list-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(47, 125, 246, 0.78), rgba(79, 209, 197, 0.7), transparent);
  animation: shimmerSweep 1s linear infinite;
}

.message-item {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(111, 133, 165, 0.24);
  border-radius: 18px;
  padding: 16px 18px 16px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(66, 92, 125, 0.11);
  text-align: left;
  transition:
    transform 180ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    background 200ms ease,
    border-color 200ms ease;
}

.message-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  opacity: 0;
  background: linear-gradient(180deg, var(--blue), #8b5cf6);
  transition: opacity 160ms ease;
}

.message-item:hover,
.message-item.active {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 246, 0.58);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(47, 125, 246, 0.14);
}

.message-item:hover::before,
.message-item.active::before {
  opacity: 1;
}

.message-item.is-removing {
  pointer-events: none;
  animation: removeMessageCard 160ms ease forwards;
}

.message-main {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.message-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.label-chip {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border: 1px solid rgba(111, 133, 165, 0.14);
  border-radius: 999px;
  color: #52627c;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
}

.message-from,
.message-preview,
.message-subject {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-subject {
  font-weight: 900;
  font-size: 15px;
}

.message-from,
.message-preview {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.message-side {
  display: grid;
  justify-items: end;
  gap: 18px;
}

.message-code-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(47, 125, 246, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: linear-gradient(180deg, #f5f9ff, #e7f0ff);
  box-shadow: 0 10px 22px rgba(47, 125, 246, 0.12);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.message-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8ca0bc;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.time-icon {
  color: var(--ink);
  font-size: 16px;
}

.message-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 180ms var(--ease-ui);
}

.message-item:hover .message-actions,
.message-item.active .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.message-action {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #bfd0ec;
  border-radius: 12px;
  background: #eef5ff;
  color: var(--blue);
  box-shadow: 0 10px 22px rgba(66, 92, 125, 0.1);
}

.message-action.delete {
  border-color: #ffd0d0;
  color: var(--red);
  background: #fff0f0;
}

.message-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(47, 125, 246, 0.18);
}

.message-action.delete:hover {
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.18);
}

.message-action .button-icon {
  margin: 0;
}

.action-tooltip {
  position: absolute;
  right: 50%;
  bottom: -38px;
  z-index: 2;
  display: block;
  min-width: 128px;
  transform: translateX(50%);
  border: 1px solid rgba(25, 32, 51, 0.16);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(66, 92, 125, 0.16);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 180ms var(--ease-ui);
}

.message-action.copy:hover .action-tooltip {
  opacity: 1;
  transform: translateX(50%) translateY(-4px);
}

.message-detail {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(111, 133, 165, 0.2);
  margin: 6px -4px -2px;
  padding: 18px 6px 4px;
}

.detail-shell {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(111, 133, 165, 0.16);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 92% 10%, rgba(47, 125, 246, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.92));
  box-shadow: 0 18px 40px rgba(66, 92, 125, 0.1);
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-meta-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(111, 133, 165, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
}

.detail-meta-label {
  color: #7a8aa4;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.detail-meta-value {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-action {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  isolation: isolate;
}

.detail-action.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #538eff);
  box-shadow: 0 16px 32px rgba(47, 125, 246, 0.24);
}

.detail-action.primary:hover {
  box-shadow: var(--shadow-blue);
}

.detail-action.ghost {
  border: 1px solid rgba(47, 125, 246, 0.28);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.92);
}

.detail-action.ghost:hover {
  border-color: rgba(47, 125, 246, 0.42);
  background: linear-gradient(180deg, white, #eef5ff);
  box-shadow: 0 16px 30px rgba(47, 125, 246, 0.16);
}

.detail-code-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(47, 125, 246, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(234, 242, 255, 0.96), rgba(247, 251, 255, 0.94));
  box-shadow: 0 16px 34px rgba(47, 125, 246, 0.12);
}

.detail-code-label {
  color: #5f7393;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.detail-code-value {
  color: var(--blue);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-code-note {
  color: #7b8da7;
  font-size: 12px;
  font-weight: 700;
}

.detail-frame-wrap {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(111, 133, 165, 0.14);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.detail-frame-head {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(47, 125, 246, 0.16);
  border-radius: 999px;
  color: #4d6486;
  background: #eff5ff;
  font-size: 12px;
  font-weight: 900;
}

.inline-mail-text {
  max-height: 640px;
  overflow: auto;
  border: 1px solid rgba(111, 133, 165, 0.14);
  border-radius: 16px;
  padding: 20px 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.78;
  white-space: pre-wrap;
}

.inline-html-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  border-radius: 14px;
  background: white;
  box-shadow: 0 16px 32px rgba(66, 92, 125, 0.12);
}

.notice {
  border: 1px solid rgba(239, 68, 68, 0.14);
  border-radius: 14px;
  padding: 18px 18px;
  font-size: 13px;
  color: #c43b3b;
  background:
    linear-gradient(135deg, rgba(255, 245, 243, 0.96), rgba(255, 250, 249, 0.94));
  box-shadow: 0 16px 30px rgba(239, 68, 68, 0.08);
}

.reader {
  min-width: 0;
  margin: 0 30px 22px;
  overflow: hidden;
  border: 1px solid rgba(111, 133, 165, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 40px rgba(66, 92, 125, 0.12);
}

.reader[hidden] {
  display: none;
}

.mailbox-mode-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 125, 246, 0.2);
  border-radius: 12px;
  color: #35527f;
  font-size: 13px;
  line-height: 1.6;
  background: linear-gradient(135deg, rgba(244, 248, 255, 0.96), rgba(236, 245, 255, 0.92));
}

.approval-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.approval-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 8px;
}

.approval-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.approval-count {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 159, 67, 0.3);
  color: #9c5a11;
  background: rgba(255, 247, 237, 0.95);
  font-size: 13px;
  font-weight: 700;
}

.approval-note {
  margin: 0;
  padding: 0 22px 16px;
  color: #5f7395;
  font-size: 13px;
  line-height: 1.7;
}

.approval-list {
  display: grid;
  gap: 12px;
  padding: 0 22px 20px;
}

.pending-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(111, 133, 165, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(66, 92, 125, 0.08);
}

.pending-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pending-subject {
  font-size: 17px;
  color: var(--ink);
}

.pending-meta,
.pending-preview {
  color: #5f7395;
  font-size: 13px;
  line-height: 1.6;
}

.pending-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.approval-empty {
  border: 1px dashed rgba(111, 133, 165, 0.28);
  border-radius: 14px;
  padding: 18px;
  color: #6d7f99;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.ycx-page {
  min-height: 100vh;
}

.ycx-shell {
  width: min(980px, calc(100vw - 54px));
}

.ycx-hero,
.ycx-mail-zone {
  overflow: hidden;
}

.ycx-copy {
  margin: 0 30px 18px;
  color: #5f7395;
  line-height: 1.7;
}

.ycx-address-box {
  margin: 0 30px 14px;
  padding: 18px 22px;
  border-radius: 18px;
  border: 2px solid rgba(47, 125, 246, 0.75);
  background: linear-gradient(135deg, rgba(235, 244, 255, 0.92), rgba(246, 250, 255, 0.95));
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  color: #2f7df6;
  text-align: center;
  word-break: break-all;
}

.ycx-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 30px 12px;
}

.ycx-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 30px 24px;
}

.ycx-pending-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(111, 133, 165, 0.24);
  color: #5f7395;
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
}

.ycx-pending-pill.has-pending {
  border-color: rgba(255, 159, 67, 0.35);
  color: #9c5a11;
  background: rgba(255, 247, 237, 0.96);
}

.ycx-list {
  display: grid;
  gap: 12px;
}

.ycx-message {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(111, 133, 165, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 30px rgba(66, 92, 125, 0.08);
}

.ycx-message-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ycx-message-subject {
  font-size: 18px;
  color: var(--ink);
}

.ycx-message-time,
.ycx-message-from,
.ycx-message-preview {
  color: #60738f;
  font-size: 13px;
  line-height: 1.6;
}

.ycx-message-actions {
  display: inline-flex;
  gap: 10px;
  margin-top: 4px;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-content: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.mail {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.mail-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.mail-head h2 {
  margin: 0 0 14px;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.18;
  letter-spacing: 0;
}

.mail-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.mail-body {
  min-width: 0;
  padding: 20px 22px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.7;
}

.html-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--blue);
  background: white;
  font-weight: 900;
  font-size: 13px;
}

.history-restore {
  position: fixed;
  top: 76px;
  left: 10px;
  z-index: 20;
  display: none;
  width: 34px;
  height: 44px;
  border-radius: 0 8px 8px 0;
  color: white;
  background: linear-gradient(135deg, var(--blue), #538eff);
  box-shadow: 0 10px 24px rgba(47, 125, 246, 0.34);
  font-size: 22px;
  font-weight: 900;
  overflow: hidden;
  isolation: isolate;
}

.tab.active {
  color: white;
  background: var(--blue);
}

.tool-page {
  display: grid;
  gap: 18px;
  width: min(960px, calc(100vw - 54px));
  margin: 0 auto;
  padding: 0 0 28px;
}

.twofa-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 15% 8%, rgba(47, 125, 246, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transition: transform 220ms var(--ease-ui), box-shadow 260ms var(--ease-ui);
}

.twofa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 76px rgba(66, 92, 125, 0.18);
}

.twofa-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 12px;
}

.twofa-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.twofa-subtitle {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.privacy-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 125, 246, 0.16);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--blue);
  background: #e9f2ff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(47, 125, 246, 0.12);
}

.twofa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 12px 28px 28px;
}

.twofa-input-panel,
.twofa-output-panel {
  border: 1px solid rgba(111, 133, 165, 0.18);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 36px rgba(66, 92, 125, 0.08);
}

.secret-input {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 2px solid rgba(47, 125, 246, 0.46);
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  background: rgba(247, 251, 255, 0.94);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  outline: none;
}

.secret-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(47, 125, 246, 0.12);
}

.twofa-actions {
  display: grid;
  grid-template-columns: 1fr 0.6fr 0.6fr;
  gap: 10px;
  margin-top: 12px;
}

.twofa-actions button,
.ghost-danger {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 900;
}

.twofa-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.twofa-output-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  background:
    radial-gradient(circle at 88% 14%, rgba(47, 125, 246, 0.1), transparent 22%),
    rgba(255, 255, 255, 0.7);
}

.code-shell {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.timer-ring {
  --progress: 100%;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 58%, transparent 60%),
    conic-gradient(var(--blue) var(--progress), #dce8f8 0);
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.code-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.twofa-code {
  color: var(--blue);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.twofa-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.twofa-recent-card {
  padding: 20px 24px 24px;
}

.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.recent-head h2 {
  margin: 0;
  font-size: 22px;
}

.ghost-danger {
  border: 1px solid var(--red);
  color: var(--red);
  background: rgba(255, 241, 240, 0.72);
  padding: 0 14px;
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.1);
}

.recent-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.recent-item,
.recent-empty {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(111, 133, 165, 0.18);
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  font-weight: 900;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.recent-item {
  transition:
    transform 180ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    background 200ms ease,
    border-color 200ms ease;
}

.recent-item:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 246, 0.34);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(47, 125, 246, 0.12);
}

.recent-item small,
.recent-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.proxy-page {
  display: grid;
  gap: 18px;
  width: min(1160px, calc(100vw - 54px));
  margin: 0 auto;
  padding: 0 0 28px;
}

body.proxy-locked {
  background:
    radial-gradient(circle at 18% 12%, rgba(84, 109, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #17192e 0%, #181a2e 100%);
}

body.proxy-locked .site-topbar {
  display: none;
}

body.proxy-locked .proxy-page {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  place-items: center;
  padding: 0;
}

body.proxy-locked .proxy-shell {
  display: none !important;
}

body.proxy-ready .proxy-login-card {
  display: none !important;
}

body.proxy-ready .proxy-shell {
  display: grid !important;
}

.proxy-shell {
  display: grid;
  gap: 18px;
}

.proxy-card,
.proxy-login-card {
  overflow: hidden;
  border: 1px solid rgba(69, 203, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(12, 18, 34, 0.96), rgba(8, 12, 25, 0.97)),
    #0b1324;
  box-shadow:
    0 28px 80px rgba(7, 11, 24, 0.32),
    inset 0 1px 0 rgba(133, 228, 255, 0.06);
  backdrop-filter: blur(18px);
}

.proxy-login-inner,
.proxy-config-card,
.proxy-results-card {
  padding: 22px 24px 24px;
}

.proxy-locked .proxy-login-card {
  width: min(420px, calc(100vw - 40px));
}

.proxy-locked .proxy-login-inner {
  padding: 28px 30px 30px;
}

.proxy-login-title,
.proxy-title {
  margin: 0;
  color: #f4fbff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.06;
}

.proxy-title {
  font-size: 18px;
}

.proxy-login-subtitle,
.proxy-results-meta,
.proxy-hint,
.proxy-result-subline,
.proxy-login-status {
  color: #8ca3c2;
}

.proxy-login-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.proxy-locked .proxy-login-form {
  margin-top: 16px;
}

.proxy-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.proxy-login-form input,
.proxy-country-search,
.proxy-select,
.proxy-stepper input,
.proxy-duration-input input {
  min-height: 44px;
  border: 1px solid rgba(72, 199, 255, 0.22);
  border-radius: 12px;
  padding: 0 12px;
  color: #edf7ff;
  background:
    linear-gradient(180deg, rgba(18, 27, 48, 0.96), rgba(13, 22, 40, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 32px rgba(5, 9, 20, 0.16);
}

.proxy-login-form input::placeholder {
  color: #6f87ab;
}

.proxy-country-search::placeholder {
  color: #6f87ab;
}

.proxy-login-status[data-tone="success"] {
  color: #63e3b0;
}

.proxy-login-status[data-tone="error"] {
  color: #ff8f8f;
}

.proxy-locked .proxy-login-status {
  text-align: center;
}

.proxy-login-status {
  min-height: 20px;
  margin: 2px 0 0;
  font-size: 13px;
}

.proxy-head,
.proxy-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.proxy-head-actions,
.proxy-results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.proxy-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(86, 216, 255, 0.24);
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(8, 29, 48, 0.8);
  box-shadow: 0 14px 30px rgba(5, 11, 22, 0.18);
}

.proxy-balance-label {
  color: #8eb4d5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.proxy-balance-value {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.proxy-system-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(69, 203, 255, 0.2);
  border-radius: 999px;
  color: #61f0be;
  background: rgba(11, 35, 37, 0.75);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(5, 11, 22, 0.18);
}

.proxy-system-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

.proxy-system-pill[data-tone="warn"] {
  color: #ffd479;
  background: rgba(42, 29, 11, 0.78);
}

.proxy-system-pill[data-tone="error"] {
  color: #ff8f8f;
  background: rgba(48, 16, 16, 0.78);
}

.proxy-system-pill[data-tone="success"] {
  color: #56d8ff;
  background: rgba(9, 31, 47, 0.78);
}

.proxy-logout {
  min-height: 38px;
}

.proxy-banner {
  margin-top: 12px;
  border: 1px solid rgba(69, 203, 255, 0.16);
  border-radius: 14px;
  padding: 10px 14px;
  color: #d6ebff;
  background: rgba(11, 28, 44, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.proxy-banner[data-tone="warn"] {
  border-color: rgba(255, 212, 121, 0.22);
  color: #ffe7ad;
  background: rgba(43, 29, 11, 0.84);
}

.proxy-banner[data-tone="error"] {
  border-color: rgba(255, 143, 143, 0.22);
  color: #ffd0d0;
  background: rgba(49, 15, 15, 0.84);
}

.proxy-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px 22px;
  margin-top: 16px;
}

.proxy-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.proxy-label,
.proxy-subhead {
  color: #dbeaff;
  font-size: 13px;
  font-weight: 900;
}

.proxy-select {
  appearance: none;
  padding-right: 40px;
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, #81e9ff 50%),
    linear-gradient(135deg, #81e9ff 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 4px),
    calc(100% - 14px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.proxy-select option,
.proxy-select optgroup {
  color: #152033;
  background: #ffffff;
}

.proxy-select:focus,
.proxy-stepper input:focus,
.proxy-duration-input input:focus,
.proxy-login-form input:focus,
.proxy-country-search:focus {
  border-color: rgba(56, 209, 255, 0.66);
  box-shadow: 0 0 0 4px rgba(47, 125, 246, 0.12);
}

.proxy-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.proxy-session-box,
.proxy-quantity-box {
  display: grid;
  gap: 10px;
}

.proxy-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.proxy-session {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-height: 88px;
  border: 1px solid rgba(70, 107, 161, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  color: #9ab1ce;
  background: rgba(17, 23, 40, 0.84);
  box-shadow: 0 18px 32px rgba(4, 8, 18, 0.2);
}

.proxy-session strong {
  color: #ecf6ff;
  font-size: 14px;
}

.proxy-session span {
  color: #778dac;
  font-size: 12px;
  font-weight: 700;
}

.proxy-session.active {
  border-color: rgba(44, 215, 255, 0.8);
  color: #eff9ff;
  background:
    radial-gradient(circle at 18% 16%, rgba(31, 204, 255, 0.16), transparent 28%),
    rgba(13, 42, 56, 0.9);
  box-shadow:
    0 22px 40px rgba(6, 15, 28, 0.28),
    inset 0 0 0 1px rgba(52, 217, 255, 0.16);
}

.proxy-duration-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 170px);
  align-items: center;
  gap: 10px;
}

.proxy-duration-row.is-disabled {
  opacity: 0.5;
}

.proxy-duration-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.proxy-duration-input span {
  color: #7f95b2;
  font-size: 13px;
  font-weight: 700;
}

.proxy-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
}

.proxy-stepper input {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.proxy-step {
  min-height: 44px;
  border: 1px solid rgba(72, 199, 255, 0.22);
  border-radius: 12px;
  color: #edf7ff;
  background: rgba(17, 26, 45, 0.9);
  font-size: 28px;
  box-shadow: 0 18px 34px rgba(4, 8, 18, 0.18);
}

.proxy-step:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 199, 255, 0.5);
  box-shadow: 0 24px 40px rgba(9, 18, 32, 0.24);
}

.proxy-generate {
  min-height: 50px;
  width: 100%;
  margin-top: 18px;
  border-radius: 14px;
  color: #03111f;
  background: linear-gradient(135deg, #19d6ff, #26b8ff);
  box-shadow:
    0 20px 42px rgba(22, 171, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font-size: 15px;
  font-weight: 900;
}

.proxy-generate:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 48px rgba(22, 171, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.proxy-results-title {
  margin: 0;
  color: #f4fbff;
  font-size: 20px;
}

.proxy-results-meta {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.proxy-results-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.proxy-empty {
  border: 1px dashed rgba(81, 219, 255, 0.18);
  border-radius: 18px;
  padding: 30px 22px;
  color: #7f95b2;
  background: rgba(11, 18, 32, 0.58);
  text-align: center;
  font-size: 14px;
}

.proxy-result-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(68, 203, 255, 0.16);
  border-radius: 18px;
  padding: 16px;
  color: #ecf6ff;
  background:
    linear-gradient(180deg, rgba(14, 21, 39, 0.96), rgba(9, 15, 28, 0.98));
  box-shadow: 0 18px 34px rgba(5, 10, 21, 0.2);
}

.proxy-result-index {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #6be5ff;
  background: rgba(16, 35, 58, 0.96);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(67, 225, 255, 0.16);
}

.proxy-result-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.proxy-result-code {
  overflow-wrap: anywhere;
  color: #eef7ff;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 14px;
  line-height: 1.6;
}

.proxy-result-subline {
  font-size: 12px;
}

.proxy-result-copy {
  min-height: 42px;
  border: 1px solid rgba(72, 199, 255, 0.26);
  border-radius: 12px;
  color: #dff7ff;
  background: rgba(15, 34, 54, 0.96);
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(5, 10, 21, 0.18);
}

.proxy-result-copy:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 199, 255, 0.48);
  box-shadow: 0 20px 36px rgba(5, 10, 21, 0.26);
}

.button-loader {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.button-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  animation: buttonDots 900ms ease-in-out infinite;
}

.button-loader span:nth-child(2) {
  animation-delay: 120ms;
}

.button-loader span:nth-child(3) {
  animation-delay: 240ms;
}

.is-busy {
  pointer-events: none;
}

#refresh.is-busy {
  color: #203757;
  background: linear-gradient(180deg, #e7f0ff, #cfe0ff);
  box-shadow: 0 18px 34px rgba(47, 125, 246, 0.18);
}

#refresh.is-busy .button-loader {
  display: inline-flex;
}

#refresh.is-busy .button-icon {
  animation: spin360 760ms linear infinite;
}

.feedback-success {
  animation: feedbackSuccess 620ms var(--ease-ui);
}

.feedback-danger {
  animation: feedbackDanger 620ms var(--ease-ui);
}

.feedback-error {
  animation: feedbackError 620ms var(--ease-ui);
}

@keyframes spin360 {
  to {
    transform: rotate(360deg);
  }
}

@keyframes feedbackSuccess {
  0% {
    box-shadow: var(--shadow-soft);
  }

  45% {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 0 6px rgba(22, 118, 75, 0.12), 0 18px 32px rgba(22, 118, 75, 0.2);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes feedbackDanger {
  45% {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12), 0 18px 32px rgba(239, 68, 68, 0.2);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes feedbackError {
  20%,
  60% {
    transform: translateX(-3px);
  }

  40%,
  80% {
    transform: translateX(3px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes shimmerSweep {
  from {
    transform: translateX(-42%);
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  to {
    transform: translateX(42%);
    opacity: 0.5;
  }
}

@keyframes buttonDots {
  0%,
  80%,
  100% {
    opacity: 0.24;
    transform: translateY(0) scale(0.92);
  }

  40% {
    opacity: 1;
    transform: translateY(-1px) scale(1.04);
  }
}

@keyframes removeMessageCard {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

.history-collapsed .dashboard {
  grid-template-columns: minmax(0, 800px);
}

.history-collapsed .history-panel {
  display: none;
}

.history-collapsed .history-restore {
  display: block;
}

@media (max-width: 920px) {
  .page-shell {
    width: min(100vw - 20px, 720px);
    padding: 0 0 18px;
  }

  .site-topbar,
  .tool-page {
    width: min(100vw - 20px, 720px);
  }

  .site-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .tool-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }

  .dashboard,
  .main-column,
  .generator-grid,
  .mail-zone,
  .twofa-grid,
  .proxy-form-grid,
  .proxy-tools-grid {
    grid-template-columns: 1fr;
  }

  .site-lock-card {
    width: min(100vw - 20px, 420px);
  }

  .site-lock-inner {
    padding: 22px 18px;
  }

  .site-lock-row {
    grid-template-columns: 1fr;
  }

  .twofa-head {
    display: grid;
    padding: 22px 22px 10px;
  }

  .twofa-grid {
    padding: 10px 22px 22px;
  }

  .generator-grid {
    padding: 22px;
  }

  .mail-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mail-card-head {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 20px 22px 8px;
  }

  .mail-list-panel {
    padding: 10px 22px 18px;
  }

  .reader {
    margin: 0 22px 20px;
  }

  .detail-top,
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .message-item {
    grid-template-columns: 1fr;
  }

  .message-side {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .message-actions {
    opacity: 1;
    transform: none;
  }

  .reader {
    min-height: 420px;
  }

  .proxy-head,
  .proxy-results-head,
  .proxy-login-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .proxy-head-actions,
  .proxy-results-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .proxy-session-grid {
    grid-template-columns: 1fr;
  }

  .proxy-duration-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .button-grid,
  .inline-custom {
    grid-template-columns: 1fr;
  }

  .button-grid .secondary.muted {
    grid-column: auto;
  }

  .current-address {
    font-size: 16px;
  }

  .twofa-actions {
    grid-template-columns: 1fr;
  }

  .code-shell {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .mail-card-title {
    font-size: 22px;
  }

  .message-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
  }

  .message-side {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .message-actions {
    width: 100%;
  }

  .message-action {
    flex: 1;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-action {
    width: 100%;
  }

  .inline-html-frame {
    min-height: 420px;
  }

  .proxy-page {
    width: min(100vw - 20px, 720px);
  }

  body.proxy-locked .proxy-page {
    width: 100vw;
  }

  .proxy-login-inner,
  .proxy-config-card,
  .proxy-results-card {
    padding: 22px 18px;
  }

  .proxy-locked .proxy-login-inner {
    padding: 28px 22px;
  }

  .proxy-form-grid {
    margin-top: 20px;
    gap: 14px;
  }

  .proxy-result-item {
    grid-template-columns: 1fr;
  }

  .proxy-result-index {
    width: 36px;
    height: 36px;
  }

  .proxy-result-copy {
    width: 100%;
  }

  .approval-head,
  .pending-item,
  .ycx-status-row,
  .ycx-message-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .pending-actions,
  .ycx-message-actions,
  .ycx-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .ycx-shell {
    width: min(100vw - 20px, 720px);
  }

  .ycx-address-box {
    margin: 0 22px 14px;
    padding: 16px 18px;
    font-size: 22px;
  }

  .ycx-copy,
  .ycx-actions,
  .ycx-status-row {
    margin-left: 22px;
    margin-right: 22px;
  }

  .approval-head,
  .approval-note,
  .approval-list {
    padding-left: 22px;
    padding-right: 22px;
  }
}
