:root {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --panel: #131c31;
  --panel-2: #18233c;
  --line: #243049;
  --text: #e6ecf7;
  --text-dim: #93a1bd;
  --text-faint: #6b7894;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --ok: #2dd4a7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 140, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(45, 212, 167, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* topbar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 17, 32, 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 {
  font-size: 26px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 12.5px; color: var(--text-dim); }
.badge {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--panel);
}

/* layout */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) 1.45fr;
  gap: 22px;
  align-items: start;
  padding: 26px 0 10px;
}

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

.panel-head h1 { font-size: 19px; margin: 0 0 4px; }
.hint { color: var(--text-dim); font-size: 13.5px; margin: 0 0 14px; }

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 14px;
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.7;
  outline: none;
  transition: border-color .15s;
}
textarea:focus { border-color: var(--accent); }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 16px;
}
.counter { font-size: 12.5px; color: var(--text-faint); }
.meta-actions { display: flex; gap: 8px; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }

.controls { display: grid; gap: 16px; }
.control label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 8px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

#topic {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
#topic:focus { border-color: var(--accent); }

.tip {
  font-size: 12px;
  color: var(--text-faint);
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* cards */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 240px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.card-title { display: flex; align-items: center; gap: 9px; }
.card-emoji { font-size: 18px; }
.card-name { font-weight: 600; font-size: 14.5px; }
.card-tools { display: flex; align-items: center; gap: 10px; }
.card-count { font-size: 11.5px; color: var(--text-faint); }
.copy-btn {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn.done { background: var(--ok); color: #06281f; border-color: var(--ok); }

.card-body {
  margin: 0;
  padding: 15px;
  font-family: inherit;
  font-size: 13.8px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  flex: 1;
  overflow: auto;
  max-height: 460px;
}
.card-body.empty { color: var(--text-faint); font-style: italic; }

/* footer */
.foot {
  padding: 30px 0 40px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}
.foot p { margin: 4px 0; }
.foot-sub { color: var(--text-dim); }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ok);
  color: #06281f;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* responsive */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .input-panel { position: static; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wrap { width: 92vw; }
  .seg { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .badge { display: none; }
}
