:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8ebf1;
  --muted: #98a1b3;
  --accent: #5b8cff;
  --accent-2: #7ae0c3;
  --warn: #ffcf6b;
  --danger: #ff8a8a;
  --ok: #7ce0a0;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2740 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1120px, 92vw); margin: 0 auto; }

/* topbar */
.topbar { border-bottom: 1px solid var(--line); background: rgba(15, 17, 21, 0.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #3a5bd0); font-size: 20px; box-shadow: var(--shadow); }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.3px; }
.badges { display: flex; gap: 8px; }
.badge { font-size: 12px; color: var(--accent-2); border: 1px solid rgba(122, 224, 195, 0.3); background: rgba(122, 224, 195, 0.08); padding: 4px 10px; border-radius: 999px; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; padding: 26px 0 10px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.output { position: sticky; top: 78px; }

.h1 { font-size: 24px; margin: 2px 0 8px; line-height: 1.3; }
.lede { color: var(--muted); margin: 0 0 18px; }
.lede b { color: var(--text); }

.field { display: block; margin-bottom: 14px; }
.lbl { display: block; font-size: 13px; margin-bottom: 6px; color: #c6cdda; font-weight: 600; }
.lbl em { color: var(--muted); font-weight: 400; font-style: normal; margin-left: 6px; font-size: 12px; }
textarea, input[type="text"], select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="range"] { width: 100%; accent-color: var(--accent); }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600; transition: transform 0.05s, border-color 0.15s, background 0.15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #3a5bd0); border-color: transparent; }
.btn.ghost { background: transparent; color: var(--muted); }
.privacy { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* output cards */
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2 { font-size: 15px; margin: 0; }
.copy { font-size: 12px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--accent-2); cursor: pointer; font-weight: 600; }
.copy:hover { border-color: var(--accent-2); }
.subject { font-size: 13px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.sk { color: var(--muted); margin-right: 8px; }
.body { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; margin: 0; color: #dde2ec; }
.tip { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.alts { display: grid; gap: 10px; }
.alt { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: rgba(255,255,255,0.02); }
.alt .alt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.alt .alt-label { font-size: 12px; color: var(--accent); font-weight: 700; }

.export-row { display: flex; gap: 10px; margin-top: 4px; }
.export-row .btn { flex: 1; }

/* lint */
.lint { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; display: grid; gap: 6px; }
.lint .li { display: flex; gap: 8px; align-items: flex-start; }
.lint .li.warn { color: var(--warn); }
.lint .li.info { color: var(--muted); }
.lint .li.ok { color: var(--ok); }
.lint .dot { flex: none; }

/* why */
.why { padding: 30px 0 6px; }
.why h2 { font-size: 18px; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.why-grid > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.why-grid b { color: var(--accent-2); }
.why-grid p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.foot { padding: 26px 0 40px; color: var(--muted); font-size: 13px; text-align: center; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #22c993; color: #06231a; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); z-index: 50; }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .output { position: static; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .badges { display: none; }
}
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .h1 { font-size: 21px; }
}
