:root {
  color-scheme: light;
  --ink: #102226;
  --muted: #627276;
  --line: #d9e2e0;
  --paper: #f4f2eb;
  --panel: #fffef9;
  --teal: #0d7b78;
  --teal-dark: #075c5a;
  --coral: #f05f46;
  --yellow: #f4c94e;
  --blue: #335ef7;
  --shadow: 0 18px 50px rgb(16 34 38 / 9%);
  font-family:
    Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgb(16 34 38 / 2%) 1px, transparent 1px),
    linear-gradient(rgb(16 34 38 / 2%) 1px, transparent 1px), var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select,
input[type="file"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: -80px;
  left: 16px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 10px clamp(20px, 4vw, 72px);
  border-bottom: 1px solid rgb(16 34 38 / 12%);
  background: rgb(244 242 235 / 92%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50% 50% 14% 50%;
  background: var(--teal);
  color: white;
  font-size: 24px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

.steps span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.steps b {
  color: #9aa7a5;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.steps .is-active {
  color: var(--ink);
  font-weight: 700;
}

.steps .is-active b {
  color: var(--coral);
}

.cart-button {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.cart-button output {
  display: grid;
  min-width: 25px;
  height: 25px;
  padding-inline: 6px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
}

main {
  width: min(1420px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 440px;
  align-items: center;
  gap: 40px;
  padding: 54px clamp(10px, 4vw, 62px) 46px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(42px, 5.3vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 25px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 254 249 / 70%);
  font-size: 12px;
  font-weight: 700;
}

.book-scene {
  position: relative;
  min-height: 330px;
  perspective: 900px;
}

.book-cover,
.book-pages,
.book-shadow {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 255px;
  height: 325px;
  transform: translate(-46%, -52%) rotateX(58deg) rotateZ(-25deg);
  border-radius: 4px 12px 12px 4px;
}

.book-shadow {
  background: rgb(16 34 38 / 28%);
  filter: blur(24px);
  transform: translate(-40%, -40%) rotateX(64deg) rotateZ(-23deg);
}

.book-pages {
  background: repeating-linear-gradient(
    0deg,
    #f1eadf 0,
    #f1eadf 2px,
    #d6cfc3 3px
  );
  transform: translate(-43%, -49%) rotateX(58deg) rotateZ(-25deg);
}

.book-cover {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background:
    linear-gradient(135deg, transparent 58%, rgb(255 255 255 / 16%) 58%),
    var(--teal);
  box-shadow: 0 16px 30px rgb(16 34 38 / 26%);
  color: white;
}

.book-cover span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.book-cover strong {
  margin: auto 0;
  font-size: 40px;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.book-cover i {
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.18em;
}

.color-chip {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgb(16 34 38 / 15%);
}

.chip-one {
  top: 16%;
  right: 12%;
  background: var(--coral);
}

.chip-two {
  right: 5%;
  bottom: 23%;
  background: var(--yellow);
}

.chip-three {
  bottom: 6%;
  left: 14%;
  background: var(--blue);
}

.configurator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 28px;
  padding-bottom: 72px;
}

#print-form {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.panel,
.quote-panel {
  min-width: 0;
  border: 1px solid rgb(16 34 38 / 11%);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(22px, 4vw, 42px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 34px;
}

.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dropzone {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  padding: 28px;
  border: 2px dashed #b4c4c1;
  background: #f8faf6;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--teal);
  background: #edf7f3;
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.dropzone strong {
  font-size: 16px;
}

.dropzone small {
  margin-top: 8px;
  color: var(--muted);
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #f8faf6;
}

.file-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.file-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card small {
  color: var(--muted);
}

.file-type {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--coral);
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.file-card button,
.special-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}

.field-error {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: #b12c1b;
  font-size: 13px;
}

fieldset {
  min-width: 0;
  margin: 0 0 34px;
  padding: 0;
  border: 0;
}

legend,
.field-grid label > span,
.special-fields label > span {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

legend span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.segmented button,
.direction-options button {
  border: 1px solid var(--line);
  background: #fafbf7;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.segmented button {
  display: grid;
  gap: 4px;
  min-height: 73px;
  place-items: center;
}

.segmented button b {
  font-size: 17px;
}

.segmented button small,
.direction-options small {
  color: var(--muted);
  font-size: 10px;
}

.segmented button:hover,
.direction-options button:hover {
  border-color: #8cacaa;
}

.segmented .is-selected,
.direction-options .is-selected {
  border-color: var(--teal);
  background: #edf7f3;
  box-shadow: inset 0 0 0 1px var(--teal);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 34px;
}

.field-grid label,
.special-fields label {
  display: grid;
}

select,
input[type="number"],
input[type="text"] {
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #cbd7d4;
  border-radius: 0;
  outline: none;
  background: white;
  color: var(--ink);
}

select {
  width: 100%;
  padding: 0 38px 0 13px;
}

input[type="number"],
input[type="text"] {
  padding: 0 13px;
}

select:focus,
input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(13 123 120 / 12%);
}

.direction-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.direction-options button {
  display: flex;
  align-items: center;
  min-height: 92px;
  gap: 16px;
  padding: 15px;
  text-align: left;
}

.direction-options button > span:last-child {
  display: grid;
  gap: 5px;
}

.page-icon {
  position: relative;
  width: 48px;
  height: 58px;
  border: 2px solid var(--ink);
  background: white;
  box-shadow: 5px 5px 0 #c8d9d4;
}

.page-icon::after {
  position: absolute;
  top: 12px;
  width: 21px;
  height: 16px;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  content: "";
}

.left-page::after {
  left: 11px;
}

.right-page {
  box-shadow: -5px 5px 0 #c8d9d4;
}

.right-page::after {
  right: 11px;
}

.page-count-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.page-count-grid > label {
  display: flex;
  align-items: center;
  min-height: 78px;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  background: #fafbf7;
  font-weight: 750;
}

.page-count-grid i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 50%;
}

.color-pages i {
  background: linear-gradient(135deg, var(--coral) 50%, var(--blue) 50%);
}

.mono-pages i {
  background: var(--ink);
}

.number-control {
  display: flex;
  align-items: center;
  border: 1px solid #cbd7d4;
  background: white;
}

.number-control input {
  width: 84px;
  min-height: 44px;
  border: 0;
  text-align: right;
}

.number-control small {
  padding-right: 11px;
  color: var(--muted);
  font-size: 12px;
}

.special-list {
  display: grid;
  gap: 12px;
}

.special-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fafbf7;
}

.special-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.special-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.special-title b:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e5ece8;
  font-size: 11px;
}

.special-type {
  width: min(310px, 55vw);
}

.special-fields {
  display: grid;
  grid-template-columns: 130px 1fr 150px;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.special-fields label[hidden] {
  display: none;
}

.validation-panel {
  display: flex;
  min-height: 68px;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px;
  border-left: 4px solid #9aa7a5;
  background: rgb(255 254 249 / 74%);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.validation-panel.is-valid {
  border-color: var(--teal);
  background: #edf7f3;
  color: var(--teal-dark);
}

.validation-panel.has-errors {
  border-color: var(--coral);
  background: #fff0eb;
  color: #8f281a;
}

.validation-panel ul {
  margin: 0;
  padding-left: 18px;
}

.quote-panel {
  position: sticky;
  top: 96px;
  padding: 28px;
}

.quote-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quote-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.quote-status.is-confirmed {
  background: #dff2ea;
  color: var(--teal-dark);
}

.quote-panel h2 {
  margin: 28px 0 5px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.quote-summary {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.breakdown {
  margin: 0;
}

.breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.breakdown dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.discount-row dd {
  color: var(--teal);
}

.quantity-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0;
  font-size: 13px;
  font-weight: 800;
}

.quote-total {
  display: grid;
  padding: 22px 0;
  border-top: 2px solid var(--ink);
}

.quote-total > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
}

.quote-total > span small {
  color: var(--muted);
  font-weight: 450;
}

.quote-total strong {
  margin-top: 8px;
  color: var(--teal);
  font-size: 40px;
  letter-spacing: -0.045em;
}

.quote-total > small {
  margin-top: 4px;
  color: var(--muted);
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--teal);
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.quote-note {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
