:root {
  --ink: #161616;
  --muted: #8a8a8a;
  --line: #dedede;
  --soft-line: #ededed;
  --lime: #dfff5a;
  --black: #151515;
  --canvas: #fafafa;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.launch-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  color: #111111;
  background: var(--lime);
  font-size: 14px;
  font-weight: 700;
}

.launch-bar span {
  justify-self: center;
}

.launch-bar button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-nav {
  display: grid;
  grid-template-columns: 129px 1fr auto;
  align-items: center;
  height: 58px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e4e4e4;
}

.brand,
.main-nav,
.nav-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  font-size: 16px;
}

.brand-badge {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #151515;
  background: #ffe266;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 900;
}

.main-nav {
  gap: 20px;
  color: #666666;
  font-size: 14px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border-radius: 6px;
}

.main-nav a.is-active {
  color: #222222;
  background: #f4f4f4;
  font-weight: 800;
}

.nav-actions {
  gap: 18px;
  font-size: 13px;
}

.nav-actions button {
  border: 0;
  background: transparent;
  color: #666666;
  cursor: pointer;
}

.login-button {
  display: grid;
  min-width: 60px;
  height: 36px;
  place-items: center;
  color: #ffffff;
  background: #151515;
  border-radius: 6px;
  font-weight: 800;
}

.detail-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - 100px);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
  background: #ffffff;
  border-right: 1px solid #dedede;
}

.upload-section,
.platform-section {
  padding: 19px 20px 0;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.label-row h1,
.platform-section h2 {
  margin: 0;
  color: #111111;
  font-size: 15px;
}

.label-row span,
.label-row small {
  color: #8a8a8a;
  font-size: 12px;
}

.hero-upload {
  display: grid;
  height: 152px;
  place-items: center;
  padding: 24px 18px;
  text-align: center;
  border: 2px dashed #d7d7d7;
  border-radius: 8px;
  cursor: pointer;
}

.hero-upload input,
.reference-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-badge {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 10px;
  color: #777777;
  background: #eeeeee;
  border-radius: 8px;
  font-size: 24px;
}

.hero-upload strong {
  margin-bottom: 8px;
  font-size: 13px;
}

.hero-upload small {
  color: #909090;
  font-size: 12px;
}

.label-row.secondary {
  margin: 13px 0 10px;
}

.reference-upload {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: #b1b1b1;
  border: 2px dashed #dcdcdc;
  border-radius: 6px;
  cursor: pointer;
}

.reference-upload strong {
  margin-top: 9px;
  line-height: 1;
}

.reference-upload small {
  margin-top: -15px;
  font-size: 12px;
}

.platform-section {
  padding-top: 22px;
}

.platform-section h2 {
  margin-bottom: 17px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.field span {
  color: #606060;
  font-size: 12px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: #222222;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 5px;
  outline: none;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #8f8f8f 50%) calc(100% - 17px) 14px / 6px 6px no-repeat,
    linear-gradient(135deg, #8f8f8f 50%, transparent 50%) calc(100% - 12px) 14px / 6px 6px no-repeat,
    #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: #a7a7a7;
}

textarea {
  min-height: 50px;
  padding: 10px;
  resize: none;
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.think-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
  background: #f4f4f4;
  border-radius: 8px;
}

.think-tabs button {
  height: 29px;
  color: #777777;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}

.think-tabs button.is-active {
  color: #111111;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}

.cost-note {
  margin: 12px 0 0;
  color: #9a9a9a;
  font-size: 12px;
}

.panel-action {
  margin-top: auto;
  padding: 15px 20px;
  border-top: 1px solid #e3e3e3;
}

.panel-action span {
  display: block;
  margin-bottom: 10px;
  color: #8d8d8d;
  font-size: 12px;
}

.panel-action button {
  width: 100%;
  height: 40px;
  color: #ffffff;
  background: #151515;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.detail-workspace {
  position: relative;
  display: grid;
  grid-template-rows: 58px 1fr;
  min-height: calc(100vh - 100px);
  background: var(--canvas);
}

.workspace-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #ededed;
}

.workspace-topbar h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #111111;
  font-size: 16px;
}

.workspace-topbar strong {
  padding: 5px 12px;
  color: #777777;
  background: #f3f3f3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
}

.workspace-canvas {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  background: #fafafa;
}

.empty-state {
  width: min(440px, 100%);
  text-align: center;
}

.stack-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin: 0 auto 26px;
  color: #bcbcbc;
  background: #f1f1f1;
  border-radius: 16px;
}

.stack-icon::before {
  content: "▱";
  transform: rotate(-45deg);
  font-size: 32px;
  font-weight: 900;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.empty-state > p {
  margin: 0 0 26px;
  color: #999999;
  font-size: 14px;
}

.guide-card {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  width: 362px;
  margin: 0 auto;
  padding: 18px 18px 15px;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
}

.guide-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #2989ff;
  background: #eaf4ff;
  border-radius: 7px;
  font-weight: 900;
}

.guide-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.guide-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
  color: #666666;
  font-size: 12px;
  line-height: 1.45;
}

.detail-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 180px));
  gap: 14px;
  width: min(980px, calc(100% - 80px));
}

.detail-results article {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.detail-results span {
  display: block;
  height: 260px;
  background:
    linear-gradient(#ffffff, #ffffff) 50% 50% / 74px 120px no-repeat,
    linear-gradient(160deg, #eeeeee, #d8d8d8);
}

.detail-results strong,
.detail-results small {
  display: block;
  padding: 0 12px;
}

.detail-results strong {
  margin-top: 11px;
}

.detail-results small {
  margin: 4px 0 13px;
  color: #777777;
}

.history-fab {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #ffffff;
  background: #111111;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 22px;
}

@media (min-width: 981px) {
  body {
    display: flex;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
  }

  .launch-bar,
  .app-nav {
    flex: 0 0 auto;
  }

  .detail-shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .detail-panel,
  .detail-workspace {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-height: 820px) and (min-width: 981px) {
  .upload-section,
  .platform-section {
    padding: 13px 16px 0;
  }

  .label-row {
    margin-bottom: 9px;
  }

  .hero-upload {
    height: 104px;
    padding: 12px;
  }

  .upload-badge {
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
    font-size: 19px;
  }

  .label-row.secondary {
    margin: 9px 0 7px;
  }

  .reference-upload {
    width: 48px;
    height: 48px;
  }

  .reference-upload strong {
    margin-top: 5px;
  }

  .reference-upload small {
    margin-top: -12px;
  }

  .platform-section h2 {
    margin-bottom: 9px;
  }

  .field {
    gap: 4px;
    margin-bottom: 6px;
  }

  select,
  input,
  textarea {
    min-height: 30px;
  }

  textarea {
    min-height: 40px;
    padding: 7px 10px;
  }

  .think-tabs button {
    height: 26px;
  }

  .cost-note {
    margin-top: 7px;
  }

  .panel-action {
    padding: 9px 16px;
  }

  .panel-action span {
    margin-bottom: 7px;
  }

  .panel-action button {
    height: 36px;
  }
}

@media (max-width: 980px) {
  .app-nav {
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 58px;
  }

  .main-nav {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 12px;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #dedede;
  }

  .detail-workspace {
    min-height: 650px;
  }
}

@media (max-width: 620px) {
  .launch-bar {
    height: auto;
    min-height: 42px;
    font-size: 12px;
  }

  .two-fields,
  .detail-results {
    grid-template-columns: 1fr;
  }

  .guide-card {
    width: calc(100% - 28px);
  }
}
