:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111827;
  --panel-soft: #152033;
  --panel-2: #152033;
  --surface: #0f172a;
  --surface-strong: #172033;
  --border: #253145;
  --border-soft: #1e293b;
  --text: #e5e7eb;
  --text-strong: #f8fafc;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --line: #253145;
  --line-strong: #334155;
  --accent: #2563eb;
  --accent-2: #10b981;
  --accent-warm: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #0c1218 0%, #0f151b 46%, #0b1015 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101820 0%, #0d1218 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
}

.site-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 1 1 520px;
  gap: 14px;
}

.site-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 210px;
  min-height: 72px;
  border: 1px solid #33475a;
  border-radius: 8px;
  padding: 10px 14px 10px 10px;
  background: linear-gradient(180deg, #172230, #121a23);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  gap: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.site-link:hover {
  background: linear-gradient(180deg, #1c2d3c, #14202b);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(63, 140, 255, 0.12);
}

.site-link-art {
  position: relative;
  flex: 0 0 auto;
}

.site-link-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #223047;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
}

.site-link-x {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #0d1116;
  background: #000000;
  color: #ffffff;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.site-link-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.site-link-copy strong {
  font-size: 18px;
  line-height: 1.1;
}

.site-link-copy small {
  color: var(--muted);
  font-size: 12px;
}

.site-link-trx {
  font-family: inherit;
}

.site-link-trx .site-link-icon {
  background: linear-gradient(135deg, #ff2636 0%, #c91428 58%, #8f0d1d 100%);
  border-color: rgba(255, 111, 121, 0.78);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.12), 0 5px 14px rgba(255, 38, 54, 0.2);
}

.trx-site-icon {
  position: relative;
  overflow: hidden;
}

.trx-triangle {
  position: relative;
  width: 34px;
  height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M9 8l48 9-22 42L9 8z' fill='none' stroke='white' stroke-width='4.8' stroke-linejoin='round'/%3E%3Cpath d='M9 8l25 51M57 17L25 24M25 24l10 35M9 8l16 16' fill='none' stroke='white' stroke-width='4.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  clip-path: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
}

.trx-triangle::before {
  content: none;
}

.trx-triangle::after {
  content: none;
}

.trx-energy {
  display: none;
}

.site-link-2fa .site-link-icon {
  background: #233250;
}

.twofa-site-icon {
  position: relative;
  overflow: hidden;
  align-content: center;
  gap: 1px;
}

.twofa-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.twofa-code {
  color: #9cc3ff;
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1;
}

.twofa-check {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #18b884;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.site-link-growth .site-link-icon {
  background: #1b3a35;
}

.x-platform-main-icon {
  background: #000000;
  color: #ffffff;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 25px;
  font-weight: 900;
}

.growth-site-icon {
  position: relative;
  overflow: hidden;
  background: #281818;
}

.growth-hot-img {
  width: 44px;
  height: 44px;
  display: block;
}

.social-badge {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #0d1116;
  border-radius: 50%;
  color: #ffffff;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.social-ins {
  top: -7px;
  left: -7px;
  background: radial-gradient(circle at 25% 110%, #feda75 0 18%, #fa7e1e 32%, #d62976 56%, #962fbf 76%, #4f5bd5 100%);
  font-size: 8px;
}

.social-fb {
  bottom: -7px;
  left: -7px;
  background: #1877f2;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
}

.social-tiktok {
  right: -7px;
  bottom: -7px;
  background: #050505;
  color: #ffffff;
  text-shadow: -1px 0 #25f4ee, 1px 0 #fe2c55;
  font-size: 16px;
}

.site-link-growth .site-link-x {
  background: #000000;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px 32px 32px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #6f5128;
  background: #2a2016;
  color: #ffd89a;
  border-radius: 6px;
}

.tabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(76, 105, 132, 0.55);
}

.tab {
  border: 1px solid transparent;
  border-bottom: 0;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
}

.tab.active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.primary-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin-bottom: 4px;
  padding: 7px 16px 8px 8px;
  border: 1px solid #2f6ba6;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a4269, #152635);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(18, 77, 128, 0.22);
}

.tab.active.primary-tab {
  border-color: #3f8cff;
  background: linear-gradient(135deg, #20517f, #172b3e);
}

.tab-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #3f8cff, #16a085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.tab-icon::before {
  content: "";
  width: 17px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 3px;
  background:
    linear-gradient(135deg, transparent 47%, rgba(255, 255, 255, 0.9) 48%, rgba(255, 255, 255, 0.9) 54%, transparent 55%),
    linear-gradient(225deg, transparent 47%, rgba(255, 255, 255, 0.9) 48%, rgba(255, 255, 255, 0.9) 54%, transparent 55%);
}

.tab-icon::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #18d39e;
  box-shadow: 0 0 0 2px #16314a;
}

.tab-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.tab-copy strong {
  font-size: 16px;
  line-height: 1.15;
}

.tab-copy small {
  color: #a8c7e6;
  font-size: 12px;
  line-height: 1.2;
}

.guide-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-left: 6px;
  margin-bottom: 8px;
  padding: 5px 10px 5px 7px;
  border-color: #2f4053;
  background: #121a24;
  color: var(--text);
}

.guide-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(145deg, #2f6ba6, #1f3d5b);
  color: #ffffff;
  font-weight: 800;
}

.guide-trigger span:last-child {
  display: grid;
  gap: 1px;
  text-align: left;
}

.guide-trigger strong {
  font-size: 14px;
  line-height: 1.2;
}

.guide-trigger small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.panel {
  display: none;
  background: linear-gradient(180deg, rgba(22, 31, 40, 0.98), rgba(17, 24, 31, 0.98));
  border: 1px solid #33485a;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel.active {
  display: block;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 22px;
}

.column {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d141b;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 10px;
  line-height: 1.5;
}

.field-help {
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px dashed #32485c;
  border-radius: 8px;
  background: rgba(15, 22, 30, 0.64);
  color: #a7b7c6;
  font-size: 12px;
  line-height: 1.5;
}

.account-input-block {
  position: relative;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #3c78ad;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(33, 82, 126, 0.28), rgba(15, 24, 32, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(15, 77, 124, 0.16);
}

.account-input-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.account-input-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.account-input-head strong {
  color: #ffffff;
  font-size: 16px;
}

.account-input-head span {
  color: #9fc4e9;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.account-input-block textarea {
  margin-top: 0;
  min-height: 190px;
  border-color: #3a6389;
  background: #0b121a;
  box-shadow: inset 0 1px 12px rgba(0, 0, 0, 0.18);
}

.account-input-block textarea:focus {
  border-color: #55a5ff;
  box-shadow: 0 0 0 2px rgba(63, 140, 255, 0.14);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.13);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0 16px;
  background: linear-gradient(180deg, #4b98ff, #2f78e6);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(47, 120, 230, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button.secondary {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, #20b99f, #138d79);
  box-shadow: 0 10px 20px rgba(22, 160, 133, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button.ghost {
  border-color: #3a4b5b;
  background: #111922;
  color: #d8e4ef;
  box-shadow: none;
}

button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.copy-code-btn {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, #143f39, #0f2c29);
  color: #dffcf5;
  white-space: nowrap;
  box-shadow: none;
}

.copy-code-btn.ready {
  background: var(--accent-2);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(22, 160, 133, 0.25), 0 0 18px rgba(22, 160, 133, 0.2);
}

button.copied {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #ffffff;
}

#imapParseBtn::before {
  content: "+";
  font-size: 18px;
  line-height: 1;
}

#imapFetchBtn {
  min-height: 44px;
  padding: 0 20px;
  border-color: #49a0ff;
  background: linear-gradient(180deg, #54a2ff, #2f76ea);
}

#imapFetchBtn::before {
  content: ">";
  font-size: 15px;
  line-height: 1;
}

#unifiedMsReadBtn::before {
  content: ">";
  font-size: 15px;
  line-height: 1;
}

#unifiedMsSendBtn::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.95;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 16px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.output-head,
.code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.output-head div {
  display: flex;
  gap: 8px;
}

.output-head strong {
  font-size: 17px;
  color: #ffffff;
}

.code-line {
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid #315f76;
  border-radius: 10px;
  background: linear-gradient(180deg, #1b2a34, #14202a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.code-line span {
  color: var(--muted);
}

.code-line strong {
  font-size: 26px;
  letter-spacing: 2px;
  color: #ffffff;
}

.output {
  min-height: 520px;
  max-height: 70vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #2b3d4b;
  border-radius: 10px;
  background: #090f14;
  color: #d8e1ea;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  box-shadow: inset 0 1px 18px rgba(0, 0, 0, 0.25);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 16, 0.88);
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-panel button {
  width: 100%;
  margin-top: 10px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  padding: 16px;
  background: rgba(8, 12, 16, 0.76);
}

.modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #344a5d;
  border-radius: 10px;
  background: linear-gradient(180deg, #17212b, #121a22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.modal-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: var(--text);
  text-decoration: none;
}

.modal-official-link:hover {
  border-color: var(--accent);
  color: #ffffff;
}

.modal-panel button {
  min-width: 108px;
}

.guide-panel {
  width: min(760px, calc(100vw - 32px));
}

.guide-intro {
  margin-bottom: 16px !important;
}

.guide-important {
  color: #ff7a7a;
  font-weight: 700;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.guide-step {
  min-width: 0;
  padding: 12px;
  border: 1px solid #30475a;
  border-radius: 8px;
  background: linear-gradient(180deg, #121d27, #101820);
}

.guide-step strong {
  display: block;
  margin: 10px 0 5px;
  color: var(--text);
  font-size: 15px;
}

.guide-step p,
.guide-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-visual {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #2d3a48;
  border-radius: 8px;
  background: #0d1218;
  color: #cdd8e4;
}

.input-visual {
  gap: 7px;
}

.input-visual .mini-label {
  color: var(--muted);
  font-size: 12px;
}

.input-visual .mini-textarea {
  display: grid;
  gap: 7px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid #263443;
  border-radius: 6px;
  background: #101923;
  color: #ffffff;
  font-size: 12px;
}

.input-visual .mini-textarea b,
.input-visual .mini-textarea i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-style: normal;
}

.input-visual .mini-textarea i {
  color: #8e9baa;
}

.input-visual .mini-help {
  color: #91c9ff;
  font-size: 12px;
}

.button-visual {
  grid-template-columns: max-content max-content;
  align-content: center;
}

.button-visual span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
}

.button-visual span:last-child {
  border: 1px solid var(--line);
  background: #111820;
}

.select-visual {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.select-visual span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-visual i {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
}

.code-visual {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.code-visual strong {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.code-visual em {
  padding: 6px 8px;
  border: 1px solid #17b89c;
  border-radius: 6px;
  color: #dffcf6;
  font-size: 12px;
  font-style: normal;
}

.guide-note {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #30475a;
  border-radius: 8px;
  background: #111a22;
}

.guide-note strong {
  display: block;
  margin-bottom: 4px;
}

.guide-note-ms {
  border-color: #365178;
  background: #121d2c;
}

.guide-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.error-text {
  color: var(--danger);
  min-height: 20px;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-header,
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-links {
    justify-content: flex-start;
    flex-basis: 100%;
  }

  .site-link {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .grid.two,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .output {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  body {
    overflow-x: hidden;
  }

  .app-header {
    align-items: flex-start;
    gap: 14px;
    padding-top: 18px;
  }

  h1 {
    font-size: 22px;
  }

  .site-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-link {
    width: 100%;
    min-height: 64px;
    padding: 9px 12px 9px 9px;
  }

  .site-link-icon {
    width: 42px;
    height: 42px;
  }

  .site-link-copy strong {
    font-size: 16px;
  }

  .site-link-copy small {
    white-space: normal;
    line-height: 1.35;
  }

  .layout {
    padding-top: 14px;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: visible;
    scrollbar-width: none;
  }

  .tab {
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .guide-trigger {
    justify-content: flex-start;
    width: auto;
    margin-left: 4px;
    white-space: nowrap;
  }

  .panel {
    padding: 14px;
    border-radius: 6px;
  }

  .guide-steps {
    grid-template-columns: 1fr;
  }

  .account-input-head {
    display: block;
  }

  .account-input-head span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  textarea {
    min-height: 132px;
  }

  .toolbar,
  .output-head,
  .code-line {
    align-items: stretch;
  }

  .toolbar button {
    flex: 1 1 auto;
  }

  .code-line {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .code-line span {
    grid-column: 1 / -1;
  }

  .code-line strong {
    min-width: 0;
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .output-head {
    flex-direction: column;
  }

  .output-head div {
    width: 100%;
  }

  .output-head button {
    flex: 1 1 0;
  }

  .output {
    min-height: 300px;
    max-height: none;
    font-size: 13px;
  }
}

/* SaaS UI refresh: official, quiet, mobile-first tool layout. */
html {
  background: var(--bg);
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app-header {
  display: block;
  padding: 24px 16px 0;
  border-bottom: 0;
  background: var(--bg);
}

.header-inner,
.layout {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand-block h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.header-badges span,
.tool-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.78);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.layout {
  padding: 20px 16px 32px;
}

.quick-links-section {
  margin-bottom: 20px;
}

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

.section-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.4;
}

.section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.quick-links-section .site-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  justify-content: stretch;
  flex: none;
}

.site-link {
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  color: var(--text);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.site-link:hover {
  transform: translateY(-1px);
  border-color: #334155;
  background: var(--panel-soft);
  filter: none;
}

.site-link-art {
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.site-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 17px;
}

.site-link-copy {
  min-width: 0;
}

.site-link-copy strong {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-link-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-link-x,
.social-badge {
  transform: scale(0.82);
  transform-origin: center;
}

.tool-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.tool-titlebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: #0b1220;
}

.module-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f172a;
  color: var(--text);
  box-shadow: none;
}

.module-card-active {
  border-color: rgba(37, 99, 235, 0.62);
  background: #111c31;
}

.module-card-icon,
.guide-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  font-weight: 800;
}

.module-card-mail {
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.module-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.module-card-copy strong {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-trigger {
  flex: 0 0 auto;
  justify-content: flex-start;
  margin: 0;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f172a;
  color: var(--text);
  box-shadow: none;
}

.guide-trigger-icon {
  position: relative;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: transparent;
  font-weight: 800;
}

.guide-doc-icon::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 17px;
  border: 2px solid #bfdbfe;
  border-radius: 4px;
  background: rgba(191, 219, 254, 0.05);
}

.guide-doc-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #bfdbfe;
  box-shadow: 0 5px 0 rgba(191, 219, 254, 0.86), 0 10px 0 rgba(191, 219, 254, 0.58);
}

.module-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-left: auto;
  padding: 0 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(21, 32, 51, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.guide-trigger:hover .module-card-action {
  border-color: rgba(37, 99, 235, 0.46);
  color: #bfdbfe;
}

.guide-trigger strong {
  color: var(--text-strong);
  font-size: 14px;
}

.guide-trigger small {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  display: none;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel.active {
  display: block;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 1.02fr);
  gap: 20px;
}

.column {
  min-width: 0;
}

.flow-stack {
  display: grid;
  gap: 16px;
}

.flow-section,
.result-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f172a;
}

.flow-section {
  padding: 14px;
}

.compact-flow {
  padding-bottom: 18px;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  font-size: 13px;
}

.step-head h3 {
  margin: 1px 0 4px;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.35;
}

.step-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-input-block {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.account-input-head {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.account-input-head strong {
  color: var(--text-strong);
  font-size: 14px;
}

.account-input-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

label,
.form-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input,
select {
  min-height: 44px;
  padding: 0 14px;
}

textarea,
.account-input-block textarea {
  min-height: 150px;
  margin: 0;
  padding: 12px;
  border-color: var(--border);
  background: #0b1220;
  box-shadow: none;
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.account-input-block textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  background: #0c1526;
}

.format-details,
.advanced-options {
  margin-top: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(21, 32, 51, 0.48);
}

.format-details summary,
.advanced-options summary {
  cursor: pointer;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.format-list {
  display: grid;
  gap: 4px;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.format-list p {
  margin: 0;
}

.form-grid,
.inline-fields.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.account-select-field {
  margin-bottom: 12px;
}

.field-help {
  display: none;
}

.toolbar,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

button {
  min-height: 44px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: none;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: none;
  filter: none;
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button.ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

button.ghost:hover {
  background: #1e293b;
  border-color: #334155;
}

button.secondary {
  border-color: var(--primary);
  background: var(--primary);
}

button.small {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

#imapParseBtn::before {
  content: "+";
  font-size: 17px;
  line-height: 1;
}

.primary-action button:first-child {
  min-width: 150px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-head h3 {
  margin: 8px 0 0;
  color: var(--text-strong);
  font-size: 18px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.code-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(21, 32, 51, 0.55);
}

.code-line span {
  color: var(--muted);
  font-size: 14px;
}

.code-line strong {
  min-width: 0;
  color: var(--text-strong);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.copy-code-btn {
  border-color: var(--success);
  background: transparent;
  color: #d1fae5;
}

.copy-code-btn:hover {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.14);
}

button.copied {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.result-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 280px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #0b1220;
  color: var(--muted);
  text-align: center;
}

.result-empty strong {
  color: var(--text);
  font-size: 16px;
}

.result-empty span {
  font-size: 13px;
}

.result-empty.hidden {
  display: none;
}

.result-empty:not(.hidden) ~ .output {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mail-presentation {
  display: grid;
  gap: 12px;
}

.mail-presentation.hidden {
  display: none;
}

.mail-summary-card,
.mail-original-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  padding: 14px;
}

.mail-section-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
}

.mail-summary-card h4 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.4;
}

.mail-summary-card p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.mail-summary-warning {
  margin-top: 10px !important;
  color: var(--warning) !important;
  font-size: 13px !important;
}

.mail-important-fields {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mail-important-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.mail-important-row span:first-child {
  color: var(--muted);
}

.mail-important-row span:last-child {
  overflow-wrap: anywhere;
}

.mail-links {
  display: grid;
  gap: 8px;
}

.mail-link-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(21, 32, 51, 0.38);
}

.mail-link-item strong {
  color: var(--muted);
  font-size: 12px;
}

.mail-link-item code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-original-details summary {
  cursor: pointer;
  color: var(--text-strong);
  font-weight: 700;
}

.mail-original-text {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #050b14;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.output.presentation-source {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: pre-wrap;
  border: 0;
}

.output {
  min-height: 480px;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-head {
  display: none;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111827;
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  line-height: 1.45;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.58);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.68);
}

.toast.danger {
  border-color: rgba(239, 68, 68, 0.66);
}

.modal-panel,
.login-panel {
  border-radius: 14px;
  background: var(--panel);
  border-color: var(--border);
}

.guide-panel {
  width: min(760px, calc(100vw - 32px));
}

@media (max-width: 980px) {
  .quick-links-section .site-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .output {
    min-height: 360px;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding-top: 20px;
  }

  .header-inner {
    display: grid;
    gap: 14px;
  }

  .header-badges {
    justify-content: flex-start;
  }

  .brand-block h1 {
    font-size: 24px;
  }

  .layout {
    padding-top: 18px;
  }

  .tool-titlebar {
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }

  .guide-trigger {
    width: auto;
  }

  .panel {
    padding: 14px;
  }

  .flow-section,
  .result-panel {
    border-radius: 12px;
    padding: 14px;
  }

  .form-grid,
  .inline-fields.form-grid {
    grid-template-columns: 1fr;
  }

  textarea,
  .account-input-block textarea {
    min-height: 150px;
  }
}

@media (max-width: 560px) {
  .layout,
  .app-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .quick-links-section .site-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .site-link {
    min-height: 72px;
    padding: 10px;
    gap: 8px;
  }

  .site-link-art,
  .site-link-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .site-link-copy strong {
    font-size: 13px;
  }

  .site-link-copy small {
    font-size: 11px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .tool-shell {
    border-radius: 12px;
  }

  .tool-titlebar {
    gap: 10px;
    padding: 12px;
  }

  .module-card {
    min-height: 58px;
    padding: 9px 10px;
    gap: 8px;
  }

  .module-card-icon,
  .guide-trigger-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .module-card-copy strong {
    font-size: 13px;
  }

  .module-card-copy small {
    font-size: 11px;
  }

  .module-card-action {
    display: none;
  }

  .account-input-head {
    display: none;
  }

  .toolbar,
  .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-action {
    grid-template-columns: 1fr;
  }

  .primary-action button:first-child {
    width: 100%;
    min-width: 0;
  }

  .code-line {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .code-line span {
    grid-column: 1 / -1;
  }

  .code-line strong {
    text-align: left;
    font-size: 24px;
  }

  .copy-code-btn {
    min-width: 96px;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions button {
    flex: 1 1 0;
  }

  .result-empty {
    min-height: 220px;
  }

  .output {
    min-height: 320px;
  }

  .toast-host {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

.app-header {
  display: none;
}

@media (max-width: 560px) {
  .quick-links-section {
    margin-bottom: 12px;
  }

  .quick-links-section .site-links {
    gap: 8px;
  }

  .site-link {
    min-height: 58px;
    padding: 8px;
    gap: 7px;
    border-radius: 12px;
  }

  .site-link-art,
  .site-link-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .site-link-copy {
    gap: 2px;
  }

  .site-link-copy strong {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-link-copy small {
    font-size: 10px;
    line-height: 1.25;
    -webkit-line-clamp: 1;
  }

  .tool-titlebar {
    gap: 8px;
    padding: 8px;
  }

  .module-card {
    min-height: 50px;
    padding: 8px;
    gap: 7px;
    border-radius: 12px;
  }

  .module-card-icon,
  .guide-trigger-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
  }

  .module-card-copy {
    gap: 1px;
  }

  .module-card-copy strong {
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .module-card-copy small {
    font-size: 10.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .module-card-action {
    display: none !important;
  }

  .flow-stack {
    gap: 10px;
  }

  .flow-section {
    padding: 11px;
  }

  .step-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .step-index {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 12px;
  }

  .step-head h3 {
    margin: 0 0 2px;
    font-size: 17px;
    line-height: 1.28;
  }

  .step-head p {
    font-size: 12px;
    line-height: 1.4;
  }

  textarea,
  .account-input-block textarea {
    min-height: 124px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.55;
  }

  .format-details,
  .advanced-options {
    margin-top: 8px;
    border-radius: 10px;
  }

  .format-details summary,
  .advanced-options summary {
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .toolbar,
  .action-row {
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .layout,
  .app-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .site-link {
    min-height: 52px;
    padding: 7px;
  }

  .site-link-copy small {
    display: none;
  }

  .tool-titlebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-card {
    min-height: 46px;
    padding: 8px 9px;
  }

  .tool-titlebar .module-card-copy small {
    display: none;
  }

  .module-card-copy strong {
    white-space: nowrap;
    overflow: visible;
  }

  .flow-section {
    padding: 10px;
  }

  textarea,
  .account-input-block textarea {
    min-height: 116px;
  }
}
