:root {
  --bg: #f4efe6;
  --panel: rgba(251, 248, 241, 0.92);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --panel-accent: rgba(255, 247, 237, 0.96);
  --line: rgba(59, 47, 34, 0.12);
  --line-strong: rgba(179, 83, 47, 0.28);
  --text: #201912;
  --text-soft: #635444;
  --accent: #b3532f;
  --accent-strong: #8d3b1f;
  --accent-soft: rgba(179, 83, 47, 0.1);
  --success: #2d6a55;
  --danger: #bf3f36;
  --shadow: 0 18px 50px rgba(75, 46, 23, 0.12);
  --shadow-strong: 0 20px 40px rgba(141, 59, 31, 0.16);
  --radius: 24px;
  --font: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(226, 157, 117, 0.28), transparent 35%),
    radial-gradient(circle at bottom right, rgba(84, 138, 118, 0.18), transparent 34%),
    linear-gradient(135deg, #f7f1e7 0%, #efe4d3 48%, #e8ddce 100%);
}

code {
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.32;
  pointer-events: none;
}

.ambient-left {
  top: -8vw;
  left: -10vw;
  background: rgba(209, 115, 67, 0.22);
}

.ambient-right {
  right: -12vw;
  bottom: -10vw;
  background: rgba(62, 121, 102, 0.2);
}

.page-shell,
.login-shell {
  position: relative;
  z-index: 1;
}

.page-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 18px 48px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hero,
.panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  border-radius: 28px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero h1,
.login-panel h1,
.panel h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2rem, 2.8vw, 3.2rem);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent-strong);
  font-weight: 700;
}

.intro,
.section-note {
  margin: 12px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 290px;
}

.meta-card {
  border-radius: 20px;
  padding: 16px 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.meta-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  margin-bottom: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: start;
}

.panel,
.login-panel {
  border-radius: var(--radius);
  padding: 22px;
}

.tips-panel {
  background:
    linear-gradient(135deg, rgba(255, 248, 239, 0.9), rgba(248, 241, 233, 0.88)),
    var(--panel);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}

.field input,
.chip-entry-row input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(59, 47, 34, 0.16);
  background: rgba(255, 253, 248, 0.95);
  padding: 13px 14px;
  color: var(--text);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.field input:focus,
.chip-entry-row input:focus {
  outline: none;
  border-color: rgba(179, 83, 47, 0.65);
  box-shadow: 0 0 0 4px rgba(179, 83, 47, 0.12);
  transform: translateY(-1px);
}

.grow {
  flex: 1;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 14px;
}

.inline-form-tight {
  align-items: center;
}

.inline-form-tight input {
  flex: 1;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease, background 120ms ease;
}

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

.primary-btn {
  color: #fff7f1;
  background: linear-gradient(135deg, var(--accent) 0%, #c06439 100%);
  box-shadow: 0 14px 26px rgba(179, 83, 47, 0.22);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid rgba(59, 47, 34, 0.12);
}

.danger-btn {
  color: white;
  background: linear-gradient(135deg, var(--danger) 0%, #d45846 100%);
}

.mini-btn {
  padding: 9px 14px;
  font-size: 13px;
}

.primary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.wide-btn {
  width: 100%;
}

.notice {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.notice.error {
  background: rgba(191, 63, 54, 0.1);
  color: #8a261f;
  border: 1px solid rgba(191, 63, 54, 0.16);
}

.notice.success {
  background: rgba(73, 136, 111, 0.12);
  color: #245945;
  border: 1px solid rgba(73, 136, 111, 0.18);
}

.notice.info {
  background: rgba(179, 83, 47, 0.1);
  color: #7c341e;
  border: 1px solid rgba(179, 83, 47, 0.14);
}

.hidden {
  display: none;
}

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

.stat-tile {
  background: var(--panel-strong);
  border: 1px solid rgba(59, 47, 34, 0.08);
  border-radius: 20px;
  padding: 16px;
}

.stat-tile span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.stat-tile strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.stat-tile p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 13px;
}

.list-panel {
  min-height: 640px;
}

.channel-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.channel-card {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(59, 47, 34, 0.1);
  background: rgba(255, 251, 245, 0.72);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.channel-card.is-active {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
  background: var(--panel-accent);
}

.channel-card-main {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 18px 18px 14px;
  cursor: pointer;
}

.channel-card-main:hover {
  background: rgba(255, 248, 241, 0.5);
}

.channel-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.channel-card-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.channel-card-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.channel-chip-preview,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-chip,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(179, 83, 47, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.channel-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

.editor-panel {
  position: sticky;
  top: 24px;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.95), rgba(249, 242, 234, 0.9)),
    var(--panel);
}

.editor-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.editor-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(191, 63, 54, 0.12);
  color: #8a261f;
  font-size: 13px;
  font-weight: 700;
}

.id-composer {
  border-radius: 20px;
  border: 1px solid rgba(59, 47, 34, 0.12);
  background: rgba(255, 252, 247, 0.92);
  padding: 14px;
}

.empty-chip-list {
  min-height: 42px;
  align-items: center;
}

.chip-placeholder {
  color: var(--text-soft);
  font-size: 13px;
}

.chip button {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(141, 59, 31, 0.14);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.chip-entry-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions-split {
  justify-content: space-between;
}

.form-actions-left,
.form-actions-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(179, 83, 47, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  padding: 24px;
  margin-top: 18px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.78);
  border: 1px dashed rgba(59, 47, 34, 0.18);
  color: var(--text-soft);
  text-align: center;
}

.login-panel {
  width: min(460px, 100%);
}

.login-form {
  display: grid;
  gap: 14px;
}

.fade-in-up {
  animation: fade-in-up 380ms ease both;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1160px) {
  .workspace,
  .top-grid,
  .tips-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 20px 14px 36px;
  }

  .hero {
    padding: 24px;
    display: grid;
  }

  .hero-side {
    min-width: auto;
  }

  .panel,
  .login-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .panel-head,
  .editor-top,
  .inline-form,
  .chip-entry-row,
  .form-actions,
  .form-actions-left,
  .form-actions-right,
  .channel-card-head,
  .channel-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }
}
