:root {
  --bg: #f5f7fb;
  --text: #101828;
  --muted: #667085;
  --line: #d9e2ef;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #10a37f;
  --amber: #b7791f;
  --red: #dc2626;
  --shadow: 0 20px 55px rgba(29, 41, 57, .12);
}

[v-cloak] {
  display: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 280px, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  min-height: 170px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
}

.subtitle {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* Floating action button */
.fab-query {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: transform .16s ease, box-shadow .16s ease;
}

.fab-query:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 99, 235, .45);
}

.fab-query:active {
  transform: scale(0.95);
}

.project-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.project-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .76);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.project-tab strong {
  display: block;
  font-size: 15px;
}

.project-tab span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.project-tab.active {
  border-color: rgba(76, 125, 255, .5);
  box-shadow: 0 12px 30px rgba(76, 125, 255, .16);
  transform: translateY(-1px);
}

.project-tab:hover {
  border-color: rgba(37, 99, 235, .34);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.project-panel,
.redeem-card {
  border: 1px solid rgba(217, 226, 239, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.project-panel {
  padding: 22px;
  min-height: 250px;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-head span {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(76, 125, 255, .1);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.panel-head strong {
  font-size: 24px;
}

.project-desc {
  min-height: 70px;
  color: var(--muted);
  line-height: 1.7;
}

.stock-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stock-line span {
  color: var(--muted);
  font-size: 13px;
}

.stock-line b {
  font-size: 26px;
  color: var(--green);
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}

.meta-list div {
  display: grid;
  gap: 4px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(217, 226, 239, .72);
}

.meta-list dt {
  color: var(--muted);
  font-size: 12px;
}

.meta-list dd {
  margin: 0;
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.guide-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(217, 226, 239, .72);
}

.guide-panel h3 {
  margin: 0 0 12px;
  color: #101828;
  font-size: 16px;
  line-height: 1.3;
}

.guide-panel ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-panel li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0 12px 12px;
  border-left: 3px solid var(--green);
}

.guide-panel li:nth-child(1) {
  border-left-color: var(--primary);
}

.guide-panel li:nth-child(4) {
  border-left-color: #f59e0b;
}

.guide-panel li:nth-child(5) {
  border-left-color: var(--red);
}

.guide-panel li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 163, 127, .12);
  color: #08775d;
  font-size: 12px;
  font-weight: 800;
}

.guide-panel strong {
  display: block;
  color: #101828;
  font-size: 14px;
}

.guide-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.guide-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px solid rgba(16, 163, 127, .28);
  border-radius: 8px;
  background: rgba(16, 163, 127, .1);
  color: #08775d;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.guide-panel a:hover {
  border-color: rgba(16, 163, 127, .45);
  background: rgba(16, 163, 127, .16);
}

.redeem-card {
  padding: 24px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

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

.mode-field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.sku-field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

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

.sku-card {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.sku-card strong {
  font-size: 14px;
  line-height: 1.25;
}

.sku-card small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.sku-card.active {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .13);
  transform: translateY(-1px);
}

.mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.mode-control button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mode-control button.active {
  background: #fff;
  color: var(--primary-dark);
  border-color: rgba(37, 99, 235, .18);
  box-shadow: 0 6px 16px rgba(29, 41, 57, .08);
}

.form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.form input,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.form input {
  height: 42px;
  padding: 0 12px;
}

.form textarea {
  min-height: 138px;
  resize: vertical;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.field-help a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.field-help a:hover {
  text-decoration: underline;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: end;
  gap: 10px;
}

.inline-field button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.form .check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #344054;
  cursor: pointer;
}

.form .check-field input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.form input:focus,
.form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(76, 125, 255, .12);
}

.submit-button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.task-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(16, 163, 127, .08);
  color: #08775d;
}

.task-box.failed {
  background: rgba(220, 38, 38, .08);
  color: var(--red);
}

.task-box span,
.task-box small {
  display: block;
  font-size: 12px;
}

.task-box strong {
  display: block;
  margin: 4px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.query-inline {
  display: flex;
  gap: 8px;
}

.query-inline input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
}

.query-inline button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.query-inline button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.polling-hint {
  color: var(--amber);
  font-weight: 600;
}

.task-result {
  padding: 14px;
  border-radius: 8px;
  background: rgba(76,125,255,.06);
}

.task-result.success {
  background: rgba(16,163,127,.08);
  color: #08775d;
}

.task-result.failed {
  background: rgba(220,38,38,.08);
  color: var(--red);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}

.result-row > span:first-child {
  min-width: 80px;
  color: var(--muted);
  font-size: 12px;
}

.result-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(0,0,0,.04);
  padding: 2px 8px;
  border-radius: 4px;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.pending {
  background: rgba(245,158,11,.12);
  color: #b7791f;
}

.status-badge.success {
  background: rgba(16,163,127,.12);
  color: #08775d;
}

.status-badge.failed {
  background: rgba(220,38,38,.12);
  color: var(--red);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
  animation: slideUp .2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

@media (max-width: 780px) {
  .hero {
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }

  .project-tabs,
  .workspace,
  .sku-grid,
  .inline-field {
    grid-template-columns: 1fr;
  }
}
