:root {
  --page: #f5f5f5;
  --paper: #ffffff;
  --soft: #f2f2f2;
  --line: #e5e5e5;
  --ink: #101014;
  --muted: #85858b;
  --violet-light: #b09bff;
  --violet-deep: #5031a4;
  --violet-soft: #f0edff;
  --yellow: #f4f35a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-page {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px 88px;
  background: var(--page);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(28, 28, 34, 0.04);
}

.workspace-card,
.result-card,
.queue-card {
  padding: 14px;
  margin-bottom: 14px;
}

.page-head,
.composer-top,
.composer-icons,
.material-row,
.composer-bottom,
.setting-card,
.result-tabs,
.queue-stats,
.bottom-nav {
  display: flex;
  align-items: center;
}

.page-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.page-head strong {
  font-size: 17px;
}

.new-button,
.write-button,
.download {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.new-button {
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet-deep);
  padding: 7px 11px;
}

.task-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.task-tabs button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 8px 14px;
  font-weight: 900;
}

.task-tabs button.active {
  background: var(--violet-light);
  border-color: rgba(80, 49, 164, 0.18);
  color: var(--ink);
}

.composer-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}

.composer-top {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.composer-icons {
  gap: 8px;
  color: var(--ink);
}

.composer-icons span {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--violet-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.material-row {
  gap: 12px;
  margin-bottom: 12px;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--soft);
  position: relative;
}

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

.thumb em {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--violet-light);
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.add-material {
  width: 84px;
  height: 64px;
  border-radius: 12px;
  background: var(--violet-light);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.add-material strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

#caseUpload {
  display: none;
}

textarea {
  width: 100%;
  min-height: 162px;
  border: 0;
  outline: none;
  resize: vertical;
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
  background: transparent;
}

.composer-bottom {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.write-button {
  color: var(--violet-deep);
}

.setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.setting-card {
  min-width: 0;
  gap: 9px;
  border: 1px solid rgba(176, 155, 255, 0.34);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.setting-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--violet-light);
  color: var(--ink);
  font-weight: 900;
  flex: 0 0 auto;
}

.setting-card div {
  min-width: 0;
}

.setting-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.setting-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.setting-card em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
}

.generate-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}

.generate-button span {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.result-tabs {
  gap: 18px;
  margin-bottom: 12px;
}

.result-tabs button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  padding: 0 0 8px;
}

.result-tabs .active {
  border-bottom: 2px solid var(--ink);
}

.result-tabs .download {
  margin-left: auto;
  border-radius: 10px;
  background: var(--violet-light);
  color: var(--ink);
  padding: 8px 12px;
}

.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #0e1114;
}

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

.video-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 6px;
}

.video-caption strong,
.video-caption span {
  border-radius: 10px;
  background: rgba(16, 16, 20, 0.72);
  color: #fff;
  padding: 9px 10px;
  line-height: 1.45;
}

.video-caption span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.video-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.queue-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.queue-stats {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.queue-stats div {
  flex: 1;
  padding: 10px;
}

.queue-stats div + div {
  border-left: 1px solid var(--line);
}

.queue-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.queue-stats strong {
  font-size: 20px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-list article {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.queue-list img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.queue-list strong,
.queue-list span {
  display: block;
}

.queue-list strong {
  font-size: 14px;
}

.queue-list span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 430px);
  transform: translateX(-50%);
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 7px 10px 8px;
}

.bottom-nav a {
  display: grid;
  gap: 3px;
  place-items: center;
  min-width: 52px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.bottom-nav span {
  width: 32px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.bottom-nav .active span {
  background: var(--violet-light);
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 40;
  font-weight: 800;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 360px) {
  .phone-page {
    padding-inline: 10px;
  }

  textarea {
    font-size: 15px;
  }
}
