:root {
  --bg: #f4efe7;
  --bg-strong: #efe2d0;
  --panel: rgba(255, 252, 248, 0.9);
  --panel-strong: #fffaf3;
  --text: #1f2430;
  --muted: #5e6978;
  --line: rgba(33, 49, 71, 0.12);
  --accent: #213147;
  --accent-soft: #d98652;
  --success: #1f7a57;
  --warning: #9a6b17;
  --error: #a23b3b;
  --shadow: 0 28px 70px rgba(52, 41, 28, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 134, 82, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(33, 49, 71, 0.14), transparent 26%),
    linear-gradient(180deg, #f9f3ea 0%, #f4efe7 50%, #efe4d2 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.28;
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px 36px;
  border-radius: var(--radius-lg);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent-soft);
}

.hero h1 {
  margin: 0 0 12px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1.02;
}

.hero-text {
  margin: 0;
  max-width: 720px;
  font-size: 16px;
  color: var(--muted);
}

.hero-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  display: grid;
  gap: 16px;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(33, 49, 71, 0.94), rgba(47, 74, 102, 0.92)),
    var(--accent);
  color: #f9f0e2;
}

.stat {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.stat:last-child {
  border-bottom: 0;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(249, 240, 226, 0.72);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

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

.panel-head h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 28px;
}

.panel-note {
  font-size: 13px;
  color: var(--muted);
}

.tone-loading {
  color: var(--accent-soft);
}

.tone-success {
  color: var(--success);
}

.tone-warning {
  color: var(--warning);
}

.tone-error {
  color: var(--error);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 320px;
  resize: vertical;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.store-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 244, 236, 0.92));
  display: grid;
  gap: 12px;
}

.env-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.env-list code {
  background: rgba(33, 49, 71, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--accent);
}

.store-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-head h3 {
  margin: 0;
  font-size: 18px;
}

.chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(217, 134, 82, 0.14);
  color: #8a4d1f;
  font-size: 12px;
}

.server-status {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.server-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
}

.server-card strong {
  font-size: 15px;
}

.server-card-ready {
  background: rgba(31, 122, 87, 0.08);
  border-color: rgba(31, 122, 87, 0.18);
  color: #1b5e45;
}

.server-card-error {
  background: rgba(162, 59, 59, 0.08);
  border-color: rgba(162, 59, 59, 0.18);
  color: #8a2d2d;
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(33, 49, 71, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  border: 1px solid rgba(33, 49, 71, 0.12);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.panel-guide {
  margin-bottom: 24px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.guide-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 244, 236, 0.9));
  border: 1px solid rgba(33, 49, 71, 0.08);
}

.guide-card strong {
  display: block;
  margin-bottom: 8px;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.panel-output {
  overflow: hidden;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(33, 49, 71, 0.96), rgba(54, 76, 102, 0.92));
  color: #fff3e4;
}

.summary-card span {
  display: block;
  font-size: 12px;
  color: rgba(255, 243, 228, 0.72);
}

.summary-card strong {
  font-size: 28px;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.issues {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.issue-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 14px;
}

.issue-block summary {
  cursor: pointer;
  font-weight: 600;
}

.issue-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.result-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  vertical-align: top;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: #f8f1e6;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity,
.notes {
  display: grid;
  gap: 6px;
}

.mini-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(33, 49, 71, 0.08);
  margin-bottom: 8px;
  font-size: 13px;
}

.mini-card a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.status-ready {
  background: rgba(31, 122, 87, 0.12);
  color: var(--success);
}

.status-warning {
  background: rgba(154, 107, 23, 0.12);
  color: var(--warning);
}

.status-error {
  background: rgba(162, 59, 59, 0.12);
  color: var(--error);
}

.mail-meta {
  margin-bottom: 12px;
  font-size: 13px;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.mail-action-button {
  border: 1px solid rgba(33, 49, 71, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mail-action-link {
  background: var(--accent);
  color: #fff;
}

.mail-feedback {
  min-height: 18px;
  margin-bottom: 10px;
  color: var(--success);
  font-size: 12px;
}

.mail-meta pre {
  white-space: pre-wrap;
  background: rgba(250, 244, 236, 0.86);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(33, 49, 71, 0.08);
}

.mail-preview {
  min-width: 320px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(33, 49, 71, 0.08);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 42px 20px;
}

@media (max-width: 1080px) {
  .hero,
  .grid,
  .store-grid,
  .server-status,
  .guide-grid,
  .summary-bar {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 20px;
  }

  .panel,
  .hero-copy,
  .hero-card {
    padding: 20px;
  }
}
