:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #7c5cff;
  --accent-2: #00d3a7;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 30px; }
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: 0.2px; }
.tagline { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ghlink { color: var(--muted); text-decoration: none; font-size: 13px; border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }
.ghlink:hover { color: var(--text); border-color: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  padding: 22px 28px;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.input-panel { position: sticky; top: 88px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 15px; margin: 0; color: var(--text); }
.head-actions { display: flex; gap: 8px; }

textarea#sourceText {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.65;
  font-family: inherit;
}
textarea#sourceText:focus { outline: none; border-color: var(--accent); }

.meta-row { display: flex; justify-content: flex-end; margin: 6px 2px 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.controls { margin-bottom: 16px; }
.ctrl-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.seg { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.ctrl-hint { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }

.plat-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chk {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 9px 12px; border-radius: 9px; font-size: 13px; cursor: pointer;
}
.chk input { accent-color: var(--accent); width: 15px; height: 15px; }

.primary-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--accent), #5b3fe0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}
.primary-btn:hover { box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4); }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--text); border-color: var(--accent); }

.privacy-note { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

/* 输出卡片 */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 50px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty-state p { margin: 6px 0; }

.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.card-badge { font-size: 16px; }
.card-meta { display: flex; align-items: center; gap: 10px; }
.count-pill { font-size: 11px; color: var(--muted); background: var(--panel); padding: 3px 8px; border-radius: 20px; }
.copy-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.copy-btn.done { border-color: var(--accent-2); color: var(--accent-2); }

.card-body {
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow-y: auto;
  color: #d7dbe4;
}
.card-tip { padding: 0 14px 12px; font-size: 11.5px; color: var(--muted); }

.footer { text-align: center; padding: 26px 20px 36px; color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-2);
  color: #06231d;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .input-panel { position: static; }
  .cards { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
  .tagline { display: none; }
}
