:root {
  color-scheme: light;
  --ink: #151722;
  --muted: #7e828e;
  --line: #dfe4ea;
  --panel: #ffffff;
  --surface: #f4f7f8;
  --sidebar: #15151d;
  --lime: #ccff29;
  --violet: #7367ba;
  --violet-soft: #f7f1ff;
  --yellow-soft: #fbfde7;
  --shadow: 0 18px 48px rgba(30, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  width: 304px;
  min-height: 100vh;
  padding: 42px 22px 28px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  margin-bottom: 38px;
}

.brand-name {
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-name span {
  color: var(--lime);
}

.brand-subtitle,
.eyebrow {
  letter-spacing: 5px;
  font-size: 12px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 14px;
  color: #92929c;
}

.nav-list {
  display: grid;
  gap: 14px;
}

.nav-item {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  color: #8f909a;
  font-size: 17px;
  font-weight: 700;
  text-align: left;
}

.nav-item b {
  min-width: 30px;
  height: 30px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: #b2b3bc;
  font-size: 15px;
}

.nav-item.active {
  background: var(--lime);
  color: #1a1c22;
  box-shadow: 0 18px 38px rgba(204, 255, 41, 0.18);
}

.nav-item.active b {
  background: transparent;
  color: #34393b;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 54px;
  color: #7f8089;
}

.device-status {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.device-status i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 6px rgba(204, 255, 41, 0.08);
}

.ghost-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #777984;
}

.workspace {
  flex: 1;
  min-width: 0;
  padding: 36px 54px 48px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--violet);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 28px;
}

.connection,
.soft-button,
.mode-pill,
.mini-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: #30323a;
  box-shadow: 0 8px 24px rgba(20, 25, 30, 0.03);
}

.connection {
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.soft-button,
.primary-button,
.dark-button,
.mini-button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
}

.soft-button {
  border: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 106px;
  padding: 24px 24px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card span {
  display: block;
  color: #8b9098;
  font-weight: 700;
  margin-bottom: 10px;
}

.metric-card strong {
  font-size: 36px;
  line-height: 1;
}

.strategy-bar {
  min-height: 132px;
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) 148px 160px minmax(250px, 1fr) auto;
  gap: 16px;
  align-items: center;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.92), rgba(247, 240, 255, 0.84) 56%, rgba(247, 255, 218, 0.88)),
    #fff;
  box-shadow: var(--shadow);
}

.assistant-chip,
.spark {
  display: grid;
  place-items: center;
  background: #11131c;
  color: var(--lime);
}

.assistant-chip {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-weight: 900;
}

.strategy-copy h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.strategy-copy p,
.field span,
.fallback-toggle small,
.task-card span {
  color: var(--muted);
}

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

.field span {
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d9e0e7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  outline: none;
}

input {
  height: 50px;
  padding: 0 14px;
}

textarea {
  padding: 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #a9d926;
  box-shadow: 0 0 0 4px rgba(204, 255, 41, 0.18);
}

.fallback-toggle {
  min-height: 66px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.fallback-toggle input {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: #1b1d25;
}

.fallback-toggle span {
  display: grid;
  gap: 3px;
}

.primary-button,
.dark-button {
  border: 0;
  background: #151722;
  color: #fff;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 512px;
  gap: 18px;
  align-items: start;
}

.composer,
.latest-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.composer {
  padding: 30px;
  background: #fff;
}

.section-head,
.latest-head,
.prompt-title,
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2,
.latest-head h2 {
  font-size: 29px;
}

.mode-pill {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  white-space: nowrap;
}

.mode-tabs {
  margin: 24px 0 18px;
  padding: 6px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef0f5;
}

.mode-card {
  min-height: 86px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  display: grid;
  align-content: center;
  gap: 7px;
  background: transparent;
  text-align: left;
  color: #4a4e58;
}

.mode-card.selected {
  border: 1px solid var(--line);
  background: #fff;
  color: #191c24;
  box-shadow: 0 12px 30px rgba(20, 26, 35, 0.08);
}

.mode-card span {
  color: var(--muted);
}

.prompt-panel {
  padding: 22px;
  border: 1px solid #e6dff0;
  border-radius: 22px;
  display: grid;
  gap: 18px;
  background:
    linear-gradient(110deg, rgba(245, 239, 255, 0.9), rgba(255, 246, 255, 0.72) 54%, rgba(253, 255, 226, 0.8)),
    #fff;
}

.prompt-title > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
}

.prompt-title small {
  color: var(--muted);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wide {
  min-width: 180px;
}

.latest-panel {
  padding: 30px;
  background: #15151d;
  color: #fff;
}

.latest-panel .eyebrow {
  color: #8476f0;
}

.mini-button {
  min-height: 48px;
  color: #c4c5cb;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.video-shell {
  position: relative;
  margin-top: 20px;
  border-radius: 16px;
  overflow: hidden;
  background: #05060a;
  aspect-ratio: 9 / 13;
}

.video-shell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-shell::before,
.video-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  background: rgba(0, 0, 0, 0.62);
}

.video-shell::before {
  left: 0;
}

.video-shell::after {
  right: 0;
}

.video-controls {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 42px;
  z-index: 1;
  display: grid;
  grid-template-columns: 34px 1fr 34px 34px 34px;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-weight: 700;
}

.video-controls button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}

.timeline {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 26px;
  z-index: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
}

.timeline i {
  display: block;
  width: 22%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.task-card {
  margin-top: 20px;
  padding: 18px 4px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.task-card b {
  color: var(--lime);
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  transform: translateY(28px);
  opacity: 0;
  pointer-events: none;
  padding: 14px 18px;
  border-radius: 14px;
  background: #151722;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1500px) {
  .sidebar {
    width: 260px;
  }

  .workspace {
    padding: 30px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 420px;
  }

  .strategy-bar {
    grid-template-columns: auto minmax(180px, 1fr) 118px 128px minmax(210px, 1fr) auto;
  }

  .latest-panel {
    padding: 28px;
  }
}

@media (max-width: 1180px) {
  .strategy-bar,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .strategy-bar {
    align-items: stretch;
  }

  .latest-panel {
    max-width: 560px;
  }
}

@media (max-width: 860px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 22px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    margin-top: 28px;
    gap: 18px;
  }

  .topbar,
  .top-actions,
  .section-head,
  .prompt-title,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 36px;
  }

  .metrics,
  .form-row,
  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 24px 16px;
  }

  .composer,
  .latest-panel {
    padding: 22px;
  }
}
