:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #1f232c;
  --line: #2a2f3a;
  --text: #e8ebf0;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --green: #2fbf71;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2233 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { padding: 30px 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 26px; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.tagline { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.tagline strong { color: var(--accent); }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) 1fr;
  gap: 22px;
  padding-top: 22px;
  padding-bottom: 40px;
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-input { position: sticky; top: 18px; }
.panel-title { margin: 0 0 16px; font-size: 16px; color: var(--muted); font-weight: 600; }

/* Fields */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field-label em { font-style: normal; color: var(--accent); font-size: 12px; }
.field-label em.opt { color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"], select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
textarea { resize: vertical; line-height: 1.6; }

/* Buttons */
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  font-weight: 600;
  flex: 1;
  min-width: 120px;
}
.btn-ghost { background: transparent; color: var(--muted); }
.btn-small { padding: 7px 12px; font-size: 13px; }

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

/* Output */
.output-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.output-actions { display: flex; gap: 8px; }
.meta {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.meta strong { color: var(--text); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-emoji { font-size: 40px; margin: 0 0 12px; }

.block { margin-bottom: 26px; }
.block-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
}

/* Titles list */
.title-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.title-item:hover { border-color: var(--accent); }
.title-tag {
  flex: none;
  font-size: 11px;
  color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
  border-radius: 6px;
  padding: 2px 7px;
  margin-top: 2px;
  white-space: nowrap;
}
.title-text { flex: 1; font-size: 14px; }
.copy-hint { flex: none; font-size: 11px; color: var(--muted); }

/* Thesis */
.thesis {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(79, 140, 255, 0.08));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.thesis .lead { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.thesis ol { margin: 0; padding-left: 20px; color: var(--muted); }
.thesis ol li { margin-bottom: 4px; }

/* Outline */
.section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--panel-2);
}
.section h4 { margin: 0 0 6px; font-size: 14px; }
.section .goal { font-size: 13px; color: var(--text); margin: 0 0 6px; }
.section ul { margin: 6px 0 0; padding-left: 18px; }
.section ul li { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.section .mat { color: var(--green); }
.section .placeholder { color: var(--muted); font-style: italic; }

/* Angles */
.angle {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: var(--panel-2);
}
.angle .name { font-weight: 700; font-size: 13px; color: var(--accent-2); }
.angle .first { font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.angle .second { font-size: 13px; }

/* Conversion */
.conv { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--panel-2); }
.conv p { margin: 0 0 8px; font-size: 13px; }
.conv .label { color: var(--muted); }
.conv .cta { background: var(--panel); border-radius: 8px; padding: 10px 12px; color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 34px; }
.site-footer p { color: var(--muted); font-size: 13px; margin: 0; text-align: center; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .panel-input { position: static; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .brand-name { font-size: 19px; }
  .title-item { flex-wrap: wrap; }
}
