:root {
  --red: #d71618;
  --red-dark: #a90f12;
  --red-soft: #fff2f2;
  --black: #231815;
  --ink: #231815;
  --muted: #6f6662;
  --line: #dcdddd;
  --warm: #f7f8fa;
  --paper: #ffffff;
  --shadow: 0 18px 46px rgba(35, 24, 21, .08);
  --font: "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", "Heiti SC", "SimHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(215, 22, 24, .045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, #fff 0, var(--warm) 42%, #fff 100%);
  font-family: var(--font);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 78px;
  padding: 14px min(48px, 4vw);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: var(--black);
  text-decoration: none;
}

.brand-lockup img {
  display: block;
  width: 188px;
  height: auto;
  flex: 0 0 auto;
}

.brand-lockup span {
  display: block;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  color: #fff;
  background: var(--black);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

main {
  width: min(1500px, 94vw);
  margin: 26px auto 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 34px;
  align-items: stretch;
  padding: 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--red);
}

.hero-copy {
  position: relative;
  padding: 10px 8px 8px 0;
  min-width: 0;
}

.eyebrow {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 870px;
  margin: 14px 0 18px;
  color: var(--black);
  font-size: 54px;
  line-height: 1.08;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hero p,
.panel > p,
.hint {
  max-width: 940px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.actions,
.download-row,
.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 26px;
}

.btn,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--black);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 22, 24, .55);
  box-shadow: 0 10px 24px rgba(215, 22, 24, .12);
}

.btn:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(215, 22, 24, .22);
  outline-offset: 2px;
}

button:disabled {
  opacity: .44;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.accent {
  color: #fff;
  background: var(--black);
  border-color: var(--black);
}

.hero-dashboard {
  display: grid;
  grid-template-rows: minmax(210px, 1fr) auto;
  gap: 16px;
  min-width: 0;
}

.sheet-proof {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 240px;
  min-width: 0;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.sheet-head strong {
  color: var(--red);
  text-transform: uppercase;
}

.sheet-body {
  position: relative;
  margin: 18px;
  min-height: 178px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(220, 221, 221, .55) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(220, 221, 221, .55) 1px, transparent 1px) 0 0 / 28px 28px,
    #fff;
  border: 2px solid var(--black);
}

.sheet-body::before,
.sheet-body::after {
  content: "";
  position: absolute;
  background: var(--red);
}

.sheet-body::before {
  left: 12px;
  right: 12px;
  top: 18px;
  height: 3px;
}

.sheet-body::after {
  top: 12px;
  bottom: 12px;
  left: 18px;
  width: 3px;
}

.sheet-body i {
  position: absolute;
  display: block;
  border: 2px solid var(--black);
  background: var(--red-soft);
}

.layout-a { left: 11%; top: 28%; width: 22%; height: 28%; }
.layout-b { left: 37%; top: 28%; width: 22%; height: 28%; }
.layout-c { left: 64%; top: 28%; width: 15%; height: 28%; }
.layout-d { left: 11%; top: 64%; width: 36%; height: 28%; }
.layout-e { left: 51%; top: 64%; width: 27%; height: 28%; }
.layout-f { right: 7%; bottom: 9%; width: 18%; height: 22%; background: #fff; border-color: var(--red); }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.hero-grid div {
  min-width: 0;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.hero-grid div:last-child {
  border-right: 0;
}

.hero-grid b {
  display: block;
  color: var(--red);
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.hero-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  margin: 22px 0;
  padding: 26px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  gap: 28px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.section-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.section-title h2 {
  margin: 0;
  color: var(--black);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

label {
  display: block;
  margin: 10px 0 7px;
  color: var(--black);
  font-size: 13px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--black);
  border-radius: 8px;
  padding: 10px 12px;
}

input[type=file] {
  padding: 9px 12px;
  background: var(--warm);
  border-style: dashed;
  border-color: rgba(215, 22, 24, .35);
}

#uploadFolder {
  margin-top: 8px;
}

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

.param-grid input {
  margin-top: 7px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}

.check input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.status {
  position: relative;
  min-height: 44px;
  margin-top: 18px;
  padding: 12px 14px;
  overflow: hidden;
  color: var(--black);
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

#bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(215, 22, 24, .18), rgba(215, 22, 24, .05));
  transition: width .35s ease;
}

#status {
  position: relative;
}

.hidden {
  display: none;
}

.cards,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.format-card,
.class-stats div,
.plan-card,
.item-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.format-card,
.class-stats div,
.plan-card {
  padding: 18px;
}

.format-card b,
.class-stats b {
  display: block;
  color: var(--red);
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.format-card h3 {
  margin: 8px 0 6px;
  color: var(--black);
  font-size: 18px;
}

.format-card p,
.plan-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  margin: 5px 6px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--black);
  background: var(--warm);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
}

.FULL_SHEET {
  color: #fff;
  background: var(--black);
  border-color: var(--black);
}

.ANCHOR {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.FILLER {
  color: var(--black);
  background: var(--red-soft);
  border-color: rgba(215, 22, 24, .25);
}

.OVERSIZE {
  color: #fff;
  background: #7d1214;
  border-color: #7d1214;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 15px;
  max-height: 520px;
  overflow: auto;
  padding-right: 8px;
}

.item-card {
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: rgba(215, 22, 24, .4);
  box-shadow: 0 14px 34px rgba(35, 24, 21, .10);
}

.item-card img {
  width: 100%;
  height: 136px;
  object-fit: cover;
  background: var(--warm);
  border-bottom: 1px solid var(--line);
}

.item-body {
  padding: 13px;
}

.item-body b {
  display: block;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.plan-grid {
  grid-template-columns: repeat(3, 1fr);
}

.plan-card {
  cursor: pointer;
}

.plan-card.active {
  border-color: var(--red);
  box-shadow: inset 4px 0 0 var(--red), 0 14px 34px rgba(215, 22, 24, .10);
}

.plan-card h3 {
  margin: 0 0 10px;
  color: var(--black);
}

.plan-card .big {
  color: var(--red);
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
}

.sheet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.sheet-tabs button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
}

.sheet-tabs button.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.viewer {
  height: 660px;
  overflow: hidden;
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.download-row {
  margin-top: 16px;
}

.upload-actions {
  margin-top: 12px;
}

.upload-actions .mini {
  max-width: 660px;
}

.upload-drop {
  margin-top: 10px;
  padding: 16px;
  color: var(--black);
  text-align: center;
  background: var(--red-soft);
  border: 1px dashed rgba(215, 22, 24, .45);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.upload-drop.dragging {
  background: #ffe5e5;
  border-color: var(--red);
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 112px;
  margin-top: 10px;
  overflow: auto;
}

.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  min-height: 30px;
  padding: 5px 8px 5px 10px;
  color: var(--black);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.upload-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-pill button {
  min-width: 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  color: #fff;
  background: var(--black);
  border-color: var(--black);
  border-radius: 999px;
  line-height: 20px;
}

@media (max-width: 1160px) {
  .hero,
  .controls {
    grid-template-columns: 1fr;
  }

  .hero-dashboard {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-lockup img {
    width: 168px;
  }

  .brand-lockup span {
    padding-left: 0;
    border-left: 0;
    white-space: normal;
  }

  .topbar-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  main {
    width: min(100% - 24px, 1500px);
    margin-top: 12px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .hero h1 {
    font-size: 31px;
    line-height: 1.12;
    word-break: break-all;
  }

  .hero p,
  .panel > p,
  .hint {
    font-size: 14px;
  }

  .hero-grid,
  .param-grid,
  .class-stats,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-grid div:last-child {
    border-bottom: 0;
  }

  .sheet-body {
    margin: 12px;
    min-height: 210px;
    overflow: hidden;
  }

  .actions .btn,
  .upload-actions .btn,
  .download-row .btn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
  }

  .sheet-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer {
    height: 460px;
  }
}
