:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #17202a;
  --muted: #6c7683;
  --line: rgba(28, 42, 57, 0.12);
  --line-strong: rgba(28, 42, 57, 0.2);
  --accent: #c99d37;
  --accent-strong: #8e6716;
  --success: #11835b;
  --success-bg: #e9f7f1;
  --danger: #c83d4a;
  --danger-bg: #fff0f1;
  --panel: rgba(255, 255, 255, 0.62);
  --shadow: 0 30px 90px rgba(44, 38, 28, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at 12% 4%, rgba(201, 157, 55, 0.22), transparent 34vw),
    radial-gradient(circle at 90% 8%, rgba(28, 42, 57, 0.1), transparent 28vw),
    linear-gradient(135deg, #f7f4ed 0%, #ebe6da 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(28, 42, 57, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 42, 57, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.68), transparent 72%);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.is-hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(14px, 2.4vw, 32px);
}

.surface {
  width: min(1160px, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(18px, 2.5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar,
.panel-heading,
.result-main,
.summary-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #23303d;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background:
    linear-gradient(135deg, #1c2a39 0 52%, #f4d06f 52% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.language-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.lang-button {
  min-width: 48px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
}

.lang-button.is-active {
  color: #fff;
  background: #1c2a39;
  box-shadow: 0 8px 18px rgba(28, 42, 57, 0.18);
}

.hero {
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(410px, 1.07fr);
  gap: clamp(14px, 2vw, 22px);
  min-height: 0;
}

.input-panel,
.result-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.input-panel,
.result-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 1.8vw, 20px);
}

.result-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.54)),
    #fbfaf7;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

label {
  color: #1d2b39;
  font-size: 16px;
  font-weight: 820;
}

.parse-info {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.input-tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 157, 55, 0.18);
  border-radius: 15px;
  color: #53606e;
  background: rgba(244, 208, 111, 0.14);
}

.input-tip span {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(201, 157, 55, 0.12);
}

.input-tip p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

textarea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 240px;
  resize: none;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  line-height: 1.65;
  overflow: auto;
}

textarea::placeholder {
  color: #9aa2ab;
}

textarea:focus {
  border-color: rgba(201, 157, 55, 0.82);
  box-shadow:
    0 0 0 4px rgba(201, 157, 55, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

textarea:read-only {
  color: #415060;
  background: rgba(255, 255, 255, 0.64);
}

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

.primary-action,
.ghost-action {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 15px;
  font-weight: 820;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, #223447, #0f1d2b);
  box-shadow: 0 14px 26px rgba(28, 42, 57, 0.18);
}

.primary-action:hover {
  transform: translateY(-1px);
}

.ghost-action {
  color: #263543;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.summary-row {
  gap: 10px;
  margin-bottom: 12px;
}

.summary-row div {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
}

.summary-row span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-row strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1;
}

.summary-row .danger strong {
  color: var(--danger);
}

.summary-row .success strong {
  color: var(--success);
}

.status-bar {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.5;
}

.status-bar[data-tone="good"] {
  color: var(--success);
  border-color: rgba(17, 131, 91, 0.2);
  background: var(--success-bg);
}

.status-bar[data-tone="bad"] {
  color: var(--danger);
  border-color: rgba(200, 61, 74, 0.22);
  background: var(--danger-bg);
}

.status-bar[data-tone="warn"] {
  color: var(--accent-strong);
  border-color: rgba(201, 157, 55, 0.28);
  background: rgba(244, 208, 111, 0.2);
}

.loading-box {
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(201, 157, 55, 0.24);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(244, 208, 111, 0.16));
}

.loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(201, 157, 55, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-head strong {
  display: block;
  color: #1d2b39;
  font-size: 14px;
}

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

.progress-track {
  position: relative;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 42, 57, 0.08);
}

.progress-track span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4d06f, #c99d37, #f4d06f);
  background-size: 180% 100%;
  transition: width 0.28s ease;
  animation: shimmer 1.1s linear infinite;
}

.results-list {
  display: grid;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.empty-state,
.result-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.result-card {
  padding: 12px;
}

.result-card.is-banned {
  border-color: rgba(200, 61, 74, 0.22);
  background: linear-gradient(90deg, var(--danger-bg), rgba(255, 255, 255, 0.74) 58%);
}

.result-card.is-normal {
  border-color: rgba(17, 131, 91, 0.18);
  background: linear-gradient(90deg, var(--success-bg), rgba(255, 255, 255, 0.74) 58%);
}

.result-main {
  justify-content: space-between;
  gap: 12px;
}

.result-copy {
  min-width: 0;
}

.email-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.email-chip span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.email-chip strong {
  min-width: 0;
  overflow: hidden;
  color: #1d2a37;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.subline span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-badge {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

.is-banned .state-badge {
  color: var(--danger);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(200, 61, 74, 0.18);
}

.is-normal .state-badge {
  color: var(--success);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 131, 91, 0.15);
}

.results-list,
textarea {
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 42, 57, 0.28) transparent;
}

.results-list::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 8px;
}

.results-list::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(28, 42, 57, 0.24);
}

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

@keyframes shimmer {
  to {
    background-position: 180% 0;
  }
}

@media (min-width: 921px) {
  .surface {
    height: min(820px, calc(100dvh - clamp(28px, 4.8vw, 64px)));
    min-height: 640px;
  }

  .workspace {
    flex: 1 1 auto;
  }

  .input-panel,
  .result-panel {
    height: 100%;
  }
}

@media (max-width: 920px) {
  .app-shell {
    align-items: start;
  }

  .surface {
    min-height: auto;
  }

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

  textarea {
    min-height: 220px;
    max-height: 36vh;
  }

  .results-list {
    max-height: min(62vh, 560px);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .surface {
    gap: 15px;
    padding: 15px;
    border-radius: 24px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    max-width: 150px;
  }

  h1 {
    font-size: clamp(32px, 10vw, 46px);
  }

  .summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-row div {
    padding: 10px;
  }

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

  .panel-heading,
  .result-main {
    align-items: stretch;
    flex-direction: column;
  }

  .parse-info {
    width: fit-content;
  }

  .email-chip {
    width: 100%;
  }

  .state-badge {
    width: 100%;
  }
}
