:root {
  --ink: #17202a;
  --muted: #65758b;
  --line: #d9e1ea;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --brand: #1677ff;
  --brand-dark: #0f5dcc;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 14px 38px rgba(18, 38, 63, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: #eef3f8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='120' viewBox='0 0 190 120'%3E%3Ctext x='18' y='62' fill='%231677ff' fill-opacity='0.11' font-size='18' font-weight='700' font-family='Arial' transform='rotate(-24 95 60)'%3E%E5%B0%8F%E7%86%8A%E5%9B%A2%E9%98%9F%3C/text%3E%3C/svg%3E"), repeating-linear-gradient(-28deg, rgba(22, 119, 255, 0.04) 0 1px, transparent 1px 120px);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
  font-size: 13px;
}

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

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

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

.cloud-status {
  display: block;
  margin-top: 4px;
  color: #7c8aa0;
  font-size: 12px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav button,
.ghost-btn,
.primary-btn,
.danger-btn,
.tiny-btn {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 700;
}

.nav button,
.ghost-btn,
.tiny-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.nav button.active,
.primary-btn {
  background: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.danger-btn {
  background: #fff1f0;
  color: var(--red);
  border: 1px solid #ffc9c4;
}

.tiny-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.hero,
.buyer-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.buyer-page {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.poster-panel {
  background: #ffffff;
  border: 1px solid #a7d9d4;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.poster-panel,
.order-panel {
  position: relative;
  overflow: hidden;
}

.poster-panel::before,
.order-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='120' viewBox='0 0 190 120'%3E%3Ctext x='18' y='62' fill='%231677ff' fill-opacity='0.08' font-size='18' font-weight='700' font-family='Arial' transform='rotate(-24 95 60)'%3E%E5%B0%8F%E7%86%8A%E5%9B%A2%E9%98%9F%3C/text%3E%3C/svg%3E");
}

.poster-panel > *,
.order-panel > * {
  position: relative;
  z-index: 1;
}

.poster-head,
.poster-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.poster-top {
  grid-template-columns: minmax(230px, 0.9fr) minmax(320px, 1.1fr);
}

.poster-head > div:first-child {
  padding: 18px;
  border-radius: 8px;
  background: #d9f7fb;
  border: 2px solid #6cc7cc;
}

.poster-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #075985;
}

.poster-head p {
  margin: 0;
  color: #155e75;
  line-height: 1.7;
}

.poster-tip {
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 8px;
  color: #075985;
  background: #b8eff7;
  border: 2px solid #22b8cf;
  font-weight: 700;
}

.poster-tip strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.poster-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.recommend-card {
  height: 320px;
  padding: 14px 22px 20px;
  border: 2px solid #7acfd3;
  border-radius: 26px 8px 26px 8px;
  background: linear-gradient(135deg, #c7f4fb, #48c0e8);
  color: #064e63;
  display: flex;
  flex-direction: column;
}

.recommend-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  flex: 0 0 auto;
}

.recommend-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
  flex: 1 1 auto;
  overflow: auto;
}

.poster-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 16px;
  background: #fff;
}

.poster-note {
  height: 210px;
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  overflow: auto;
}

.poster-note p {
  margin: 0 0 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef2ff;
  color: #334155;
  font-size: 18px;
  font-weight: 800;
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
}

.qr-after-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.qr-after-form h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.qr-after-form .qr-box {
  width: min(260px, 100%);
  min-height: 260px;
  margin: 0 auto;
}

.qr-after-form p {
  margin: 10px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.intro {
  padding: 28px;
  background: #12395f;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 280px;
}

.intro h2 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.18;
}

.intro p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.8;
}

.notice-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.notice-list span {
  display: block;
  padding: 12px 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.11);
}

.panel,
.card,
.table-wrap,
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel h2,
.panel h3,
.section-title {
  margin: 0 0 16px;
  font-size: 20px;
}

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

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

.product-card {
  position: relative;
  padding: 12px;
  border: 2px solid #9ed8d2;
  border-radius: 8px;
  background: #ffffff;
  min-height: 210px;
  text-align: left;
  overflow: hidden;
}

.product-card.selected {
  border-color: var(--brand);
  background: #eef7ff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.22), 0 16px 34px rgba(22, 119, 255, 0.18);
  transform: translateY(-2px);
}

.product-card.selected::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(22, 119, 255, 0.52);
  border-radius: 6px;
  pointer-events: none;
}

.selected-ribbon {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 7px 13px;
  border-radius: 999px;
  background: #1677ff;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.28);
}

.featured-card {
  min-height: 238px;
  background: linear-gradient(135deg, #ddfbff, #48bde8);
}

.featured-card .washer-art {
  background: rgba(255, 255, 255, 0.62);
}

.product-brand {
  display: block;
  width: max-content;
  min-width: 118px;
  max-width: 90%;
  margin: 0 auto 10px;
  padding: 5px 20px;
  border-radius: 0 0 4px 4px;
  background: #12b8d7;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.poster-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.washer-art {
  width: 100%;
  height: 300px;
  border-radius: 7px;
  background: linear-gradient(135deg, #dfe8ef, #ffffff);
  position: relative;
  display: flex;
  flex-direction: column;
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
}

.washer-image-zone {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.washer-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.washer-art small {
  display: block;
  width: 100%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.gallery-zone {
  flex: 0 0 42px;
  width: 100%;
  display: grid;
  place-items: center;
  background: rgba(22, 119, 255, 0.9);
  cursor: zoom-in;
}

.washer-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 4px solid #8aa2b5;
  background: #f8fbfd;
  position: relative;
}

.washer-icon::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 4px solid #1677ff;
}

.product-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
  color: #008b9a;
  background: #d7fbff;
  padding: 4px 6px;
  border-radius: 4px;
}

.product-copy ul {
  display: none;
  margin: 0;
  padding-left: 18px;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
}

.product-copy {
  display: none;
}

.price-line {
  display: none !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.price {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 800;
}

.old-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 20px;
  font-weight: 800;
  text-decoration: line-through;
  white-space: nowrap;
}

.old-price span {
  margin-bottom: 3px;
  font-size: 12px;
}

.student-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef233c, #ff6b35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 10px 22px rgba(239, 35, 60, 0.28);
  white-space: nowrap;
}

.student-price span {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
  opacity: 0.95;
}

.desc,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field.compact-note textarea {
  min-height: 54px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.order-note {
  display: none;
  color: #64748b;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.support-contact {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.qr-after-form {
  display: none;
}

.product-edit-card .field:has([name="original_price"]),
.product-edit-card .field:has([name="student_price"]),
.product-edit-card .field:has([name="description"]) {
  display: none;
}

.message {
  border-radius: 8px;
  padding: 13px 14px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.message.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.login-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.login-box {
  width: min(420px, 100%);
  padding: 24px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

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

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-card strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ordered {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge.paid {
  color: #047857;
  background: #d1fae5;
}

.badge.completed {
  color: #334155;
  background: #e2e8f0;
}

.badge.cancelled {
  color: #b42318;
  background: #fee2e2;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.account-grid,
.seller-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-card h3 {
  margin: 0 0 8px;
}

.product-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-toolbar h2 {
  margin-bottom: 8px;
}

.product-edit-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.product-image-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 150px;
  margin-bottom: 14px;
  border: 1px dashed #b7c4d1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  overflow: hidden;
}

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

.detail-image-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.detail-image-item.cover {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.detail-image-item img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.detail-image-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.image-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tiny-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.gallery-dialog {
  position: relative;
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.gallery-dialog h3 {
  margin: 0 42px 14px 0;
  font-size: 20px;
}

.gallery-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.gallery-tools button {
  padding: 8px 12px;
  border-radius: 7px;
  background: #eef2f7;
  color: #334155;
  font-weight: 800;
}

.gallery-tools span {
  margin-left: auto;
  color: var(--muted);
  font-weight: 900;
}

.gallery-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 24px;
  line-height: 1;
}

.gallery-stage {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.gallery-image-wrap {
  width: 100%;
  height: 56vh;
  overflow: auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fafc;
}

.gallery-image-wrap img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.18s ease;
}

.gallery-arrow {
  width: 42px;
  height: 52px;
  border-radius: 8px;
  background: #1677ff;
  color: #fff;
  font-size: 34px;
}

.gallery-count {
  margin: 10px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumbs button {
  flex: 0 0 72px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
}

.gallery-thumbs button.active {
  border-color: #1677ff;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-edit-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-edit-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-preview {
  max-width: 260px;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .shell {
    padding: 14px 12px 34px;
  }

  .topbar,
  .actions,
  .product-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    justify-content: stretch;
  }

  .nav button,
  .primary-btn,
  .ghost-btn,
  .danger-btn {
    flex: 1;
  }

  .hero,
  .buyer-page,
  .form-grid,
  .products,
  .poster-products,
  .poster-head,
  .poster-top,
  .poster-bottom,
  .filters,
  .stats-grid,
  .account-grid,
  .product-edit-grid,
  .seller-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 22px;
    min-height: auto;
  }

  .intro h2 {
    font-size: 27px;
  }

  .panel {
    padding: 16px;
  }

  .poster-panel {
    padding: 12px;
  }

  .recommend-card {
    height: 320px;
  }

  .poster-body {
    grid-template-columns: 1fr;
  }

  .washer-art {
    height: 300px;
  }

  .detail-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-stage {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .gallery-arrow {
    width: 34px;
  }
}
