:root {
  --blue: #2667e9;
  --blue-dark: #1755cf;
  --gold: #f2a300;
  --ink: #333;
  --muted: #888;
  --line: #e5e5e5;
  --soft: #f6f6fa;
  --dark-tab: #131212;
  --danger: #e40231;
  --wrap: 1250px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 12px/1.5 "Microsoft YaHei", "Microsoft JhengHei", STHeiti, Arial, sans-serif;
  text-align: center;
}

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

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(var(--wrap), calc(100vw - 32px));
  margin: 0 auto;
  text-align: left;
}

.main-nav a:hover,
.hot-words a:hover {
  color: #ff6600;
}

.main-head {
  border-bottom: 1px solid #e4e4e4;
  background: #fff;
}

.head-inner {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 0;
  align-items: start;
  min-height: 96px;
}

.logo {
  display: flex;
  align-items: center;
  width: 430px;
  min-height: 86px;
  padding: 20px 0;
}

.logo img {
  max-width: 282px;
  max-height: 54px;
}

.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(180px, 1fr) 85px;
  width: min(500px, 100%);
  height: 40px;
  margin: 27px 0 0;
  border: 2px solid var(--blue);
}

.search-select {
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-size: 14px;
  background: #fafafa;
  border-right: 1px solid #eee;
}

.search-box input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  outline: none;
  font-size: 14px;
}

.search-box button {
  height: 36px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: var(--blue);
  font-size: 14px;
}

.search-box button:hover,
.support-join:hover {
  background: var(--blue-dark);
}

.hot-words {
  position: absolute;
  left: 0;
  top: 46px;
  display: flex;
  gap: 8px;
  margin: 0;
  color: #999;
  white-space: nowrap;
}

.support-join {
  display: block;
  width: 135px;
  height: 40px;
  margin-top: 27px;
  padding-left: 19px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  line-height: 40px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  height: auto;
  min-height: 38px;
  gap: 0 20px;
}

.main-nav a {
  display: block;
  padding: 0 30px;
  color: #333;
  font-size: 16px;
  line-height: 38px;
}

.main-nav .active {
  color: #fff;
  background: var(--blue);
}

.category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 50px;
}

.category-head h1 {
  margin: 0;
  color: #0f3661;
  font-size: 35px;
  line-height: 1.1;
}

.category-head p {
  margin: 10px 0 0;
  color: #42435d;
  font-size: 14px;
}

.category-tabs {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.category-tabs button {
  height: 37px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: var(--dark-tab);
  line-height: 37px;
}

.category-tabs button:hover,
.category-tabs button.active {
  background: var(--gold);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 30px;
  margin-top: 22px;
}

.product-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.product-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 26px rgba(38, 103, 233, .12);
  transform: translateY(-2px);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f3f3;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-meta {
  display: grid;
  grid-template-columns: 1fr 80px;
  margin-top: 4px;
  line-height: 30px;
}

.product-title {
  min-width: 0;
  overflow: hidden;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-date {
  color: #777;
  text-align: right;
}

.product-bottom {
  display: grid;
  grid-template-columns: 1fr 150px;
  line-height: 17px;
}

.views {
  position: relative;
  padding-left: 20px;
  color: #bbb;
}

.views::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 13px;
  height: 10px;
  border: 1px solid #cfcfcf;
  border-radius: 50%;
}

.price {
  color: #f00;
  text-align: right;
}

.price strong {
  font-weight: 700;
}

.empty-state {
  margin: 46px 0 20px;
  padding: 28px;
  border: 1px dashed #d8d8d8;
  color: #777;
  text-align: center;
  font-size: 14px;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin: 22px 0 0;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 14px;
}

.pager button,
.pager span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px 9px 11px;
  border-radius: 3px;
  background: #fff;
}

.pager button {
  border: 1px solid #ddd;
  cursor: pointer;
}

.pager button:hover:not(:disabled) {
  color: #fff;
  background: #ff6600;
}

.pager .current {
  color: #ff6600;
}

.pager button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.site-footer {
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid #e6e6e6;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  color: #888;
  line-height: 25px;
}

.footer-inner p {
  margin: 0;
}

.detail-page {
  padding-top: 28px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 30px;
}

.detail-image {
  width: 410px;
  aspect-ratio: 1 / 1;
  border: 1px solid #ddd;
  padding: 9px;
  background: #fff;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  min-width: 0;
  padding-top: 2px;
}

.detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  border-bottom: 1px solid #eee;
}

.detail-title-row h1 {
  margin: 0 16px 0 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
}

.member-price {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 2px;
  color: #fff;
  background: #42435d;
}

.member-price.vip {
  background: var(--gold);
}

.info-line {
  display: grid;
  grid-template-columns: 82px 1fr 100px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #f1f1f1;
}

.info-line .label {
  color: #888;
}

.info-line .amount {
  color: #f00;
  font-size: 30px;
  font-family: Arial, Helvetica, sans-serif;
}

.info-line .download {
  color: #777;
  text-align: right;
}

.include-line {
  display: grid;
  grid-template-columns: 82px 1fr;
  padding: 15px 0 8px;
}

.include-line .label {
  color: #888;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border: 1px solid #dedede;
  color: #555;
  background: #fafafa;
}

.buy-row {
  margin-top: 20px;
}

.buy-button {
  width: 156px;
  height: 44px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: #ff6600;
  font-size: 16px;
}

.buy-button:hover {
  background: #e85b00;
}

.notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: #777;
  background: #fff8f1;
  border: 1px solid #f0dccb;
  line-height: 22px;
}

.detail-stats {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  color: #999;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  margin-top: 30px;
}

.detail-main {
  min-width: 0;
}

.content-title {
  padding: 12px 16px;
  border: 1px solid #ededed;
  border-bottom: 0;
  color: #666;
  background: #fbfbfb;
  font-size: 14px;
}

.detail-main h2 {
  margin: 0;
  padding: 16px;
  border: 1px solid #ededed;
  border-bottom: 0;
  font-size: 18px;
}

.intro-panel {
  min-height: 240px;
  padding: 24px;
  border: 1px solid #ededed;
  line-height: 24px;
  font-size: 14px;
  text-align: center;
}

.intro-panel img {
  width: min(100%, 760px);
  margin: 0 0 18px;
  border: 1px solid #eee;
}

.intro-panel img:last-child {
  margin-bottom: 0;
}

.rich-description {
  margin-bottom: 20px;
  color: #333;
  text-align: left;
}

.rich-description:empty {
  display: none;
}

.rich-description img {
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  height: auto;
  margin: 12px auto;
}

.review-panel {
  margin-top: 20px;
  border: 1px solid #ededed;
}

.review-panel h2 {
  border: 0;
  border-bottom: 1px solid #ededed;
}

.score-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
}

.score-row span {
  width: 120px;
  height: 46px;
  border-right: 1px dotted #e5e5e5;
  color: #999;
  text-align: center;
}

.score-row strong {
  color: #ff6600;
  font-size: 18px;
}

.score-row a {
  margin-left: auto;
  padding: 10px 22px;
  color: #fff;
  background: #ff6600;
}

.detail-review-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.detail-review-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #f0f0f0;
  background: #fff;
}

.detail-review-item strong,
.detail-review-item span {
  display: block;
}

.detail-review-item strong {
  color: #333;
}

.detail-review-item span {
  color: #999;
}

.detail-review-item p {
  margin: 0;
  color: #666;
  line-height: 1.7;
}

.detail-side {
  min-width: 0;
}

.seller-card,
.recommend-card {
  border: 1px solid #e8e8e8;
  background: #fff;
}

.seller-card h2,
.recommend-card h2 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e8e8e8;
  font-size: 16px;
}

.seller-card {
  padding-bottom: 16px;
  text-align: center;
}

.seller-card img {
  width: 80px;
  height: 80px;
  margin: 16px auto 8px;
  border: 1px solid #eee;
  border-radius: 50%;
  object-fit: cover;
}

.seller-card a {
  display: block;
  font-size: 14px;
}

.seller-card p {
  margin: 8px 0 0;
  color: #777;
}

.seller-card .seller-desc {
  margin: 10px 16px 0;
  color: #555;
  line-height: 22px;
  text-align: left;
}

.recommend-card {
  margin-top: 20px;
}

.recommend-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.recommend-item:last-child {
  border-bottom: 0;
}

.recommend-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  background: #f4f4f4;
}

.recommend-item a {
  display: block;
  overflow: hidden;
  height: 38px;
  font-size: 13px;
  line-height: 19px;
}

.recommend-item span {
  display: block;
  margin-top: 4px;
  color: #999;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  z-index: 30;
  display: none;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, .78);
  font-size: 14px;
}

.toast.show {
  display: block;
}

.stock-line {
  margin-top: 7px;
  color: #999;
  line-height: 18px;
}

.admin-body {
  min-height: 100vh;
  background: #f5f7fb;
  text-align: left;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 22px 18px;
  background: #151923;
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 18px;
  font-weight: 700;
}

.admin-brand img {
  width: 92px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .28));
}

.admin-menu {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.admin-menu a {
  padding: 12px 14px;
  border-radius: 6px;
  color: #c8d1e5;
}

.admin-menu a:hover,
.admin-menu a.active {
  color: #fff;
  background: #2667e9;
}

.admin-main {
  margin-left: 236px;
  padding: 28px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 45, 74, .06);
}

.admin-topbar p,
.panel-head p {
  margin: 0;
  color: #778197;
}

.admin-topbar h1,
.panel-head h2 {
  margin: 4px 0 0;
  color: #192033;
}

.admin-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 128px 128px 150px auto auto;
  gap: 10px;
  align-items: center;
  min-width: min(100%, 880px);
  padding: 10px;
  border: 1px solid #e7ebf3;
  border-radius: 10px;
  background: #f8faff;
}

.primary-button,
.ghost-button,
.danger-button,
.status-button,
.edit-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 38px;
  font-weight: 700;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.status-button:hover,
.edit-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: #fff;
  background: #2667e9;
}

.primary-button:hover {
  background: #1755cf;
}

.ghost-button,
.edit-button {
  color: #2667e9;
  background: #fff;
  border-color: #cfd9f2;
}

.ghost-button:hover,
.edit-button:hover {
  border-color: #2667e9;
}

.danger-button {
  color: #c9283a;
  background: #fff;
  border-color: #f3c5cb;
}

.danger-button:hover {
  color: #fff;
  background: #c9283a;
  border-color: #c9283a;
}

.danger-button:disabled,
.danger-button:disabled:hover {
  color: #a5aec1;
  background: #f5f7fb;
  border-color: #e1e6ef;
  cursor: not-allowed;
  transform: none;
}

.status-button {
  color: #fff;
  background: #151923;
}

.status-button.offline {
  color: #fff;
  background: #0f9f6e;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-stats article {
  padding: 20px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 45, 74, .05);
}

.admin-stats span {
  display: block;
  color: #778197;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  color: #192033;
  font-size: 30px;
  line-height: 1;
}

.dashboard-product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}

.dashboard-block {
  min-width: 0;
}

.dashboard-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-block-head h3 {
  margin: 0;
  color: #192033;
  font-size: 18px;
}

.dashboard-block-head span {
  color: #8a93a8;
}

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

.dashboard-product-card {
  overflow: hidden;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fff;
}

.dashboard-product-card a {
  display: grid;
  gap: 8px;
  padding: 10px;
  color: inherit;
}

.dashboard-product-card img {
  width: 100%;
  aspect-ratio: 1 / .72;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.dashboard-product-card strong,
.dashboard-product-card span,
.dashboard-hot-item a {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dashboard-product-card strong {
  color: #192033;
}

.dashboard-product-card span {
  color: #7d879b;
}

.dashboard-product-card em,
.dashboard-hot-item strong {
  color: #e4432f;
  font-style: normal;
  font-weight: 800;
}

.dashboard-hot-list {
  display: grid;
  gap: 10px;
}

.dashboard-hot-item {
  display: grid;
  grid-template-columns: 26px 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fff;
}

.dashboard-hot-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: #151923;
  font-weight: 800;
}

.dashboard-hot-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.dashboard-hot-item div {
  min-width: 0;
}

.dashboard-hot-item a {
  display: block;
  color: #192033;
  font-weight: 700;
}

.dashboard-hot-item small {
  display: block;
  margin-top: 4px;
  color: #8a93a8;
}

.dashboard-empty {
  margin: 0;
  padding: 28px 12px;
  border: 1px dashed #d9dfec;
  border-radius: 8px;
  color: #8a93a8;
  text-align: center;
}

.admin-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 45, 74, .05);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.product-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

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

.editor-head-actions,
.editor-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.editor-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 45, 74, .08);
}

.editor-status-bar span,
.editor-status-bar strong {
  display: block;
}

.editor-status-bar span {
  color: #8a93a8;
}

.editor-status-bar strong {
  max-width: min(52vw, 560px);
  overflow: hidden;
  color: #192033;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.editor-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e7ebf3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 45, 74, .035);
}

.editor-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0f5;
}

.editor-card-head h3 {
  margin: 0;
  color: #192033;
  font-size: 17px;
}

.editor-card-head span {
  color: #8a93a8;
  font-weight: 400;
}

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

.editor-fields.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.editor-card-basic .editor-fields label {
  grid-column: span 2;
}

.editor-card-basic .editor-fields .wide {
  grid-column: span 3;
}

.image-manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.product-form label,
.editor-card label,
.description-field-block {
  display: grid;
  gap: 7px;
  color: #596176;
  font-weight: 700;
}

.field-label {
  display: block;
}

.product-form input,
.product-form select,
.product-form textarea,
.table-tools input,
.table-tools select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: #192033;
  background: #fff;
}

.product-form textarea {
  resize: vertical;
}

.rich-editor {
  overflow: hidden;
  border: 1px solid #cfd8e8;
  border-radius: 8px;
  background: #fff;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #dce3ef;
  background: #f7f9fd;
}

.rich-toolbar select,
.rich-toolbar button,
.rich-color {
  height: 30px;
  border: 1px solid #c7d0df;
  border-radius: 4px;
  color: #273047;
  background: #fff;
}

.rich-toolbar select {
  width: auto;
  min-height: 30px;
  padding: 0 24px 0 7px;
}

.rich-toolbar button,
.rich-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 0 8px;
  cursor: pointer;
  font-weight: 700;
}

.rich-toolbar button:hover,
.rich-color:hover {
  border-color: var(--blue);
  background: #eef5ff;
}

.rich-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: #cfd8e8;
}

.rich-color {
  position: relative;
  gap: 4px;
}

.rich-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.rich-edit-area {
  min-height: 260px;
  max-height: 620px;
  overflow-y: auto;
  padding: 18px;
  color: #253047;
  background: #fff;
  line-height: 1.75;
  font-size: 15px;
  font-weight: 400;
  outline: none;
}

.rich-edit-area:empty::before {
  content: attr(data-placeholder);
  color: #9aa3b7;
}

.rich-edit-area:focus {
  box-shadow: inset 0 0 0 2px rgba(38, 103, 233, .12);
}

.rich-edit-area img {
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border: 1px solid #e5eaf3;
}

.rich-edit-area table,
.intro-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.rich-edit-area td,
.rich-edit-area th,
.intro-panel td,
.intro-panel th {
  min-width: 80px;
  padding: 8px 10px;
  border: 1px solid #d9dfec;
}

.rich-edit-area blockquote,
.intro-panel blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--blue);
  background: #f5f8ff;
}

.field-hint {
  color: #8a93a8;
  font-weight: 400;
}

.main-image-manager,
.detail-image-manager {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9dfec;
  border-radius: 8px;
  background: #f8faff;
}

.main-image-add,
.detail-image-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 100px;
  gap: 8px;
}

.main-image-add .ghost-button,
.detail-image-add .ghost-button {
  min-height: 38px;
  padding: 0 10px;
}

.main-image-current {
  display: none;
  grid-template-columns: 74px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f5;
  border-radius: 8px;
  background: #fff;
}

.main-image-current.has-image {
  display: grid;
}

.main-image-current img {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.main-image-current div {
  min-width: 0;
}

.main-image-current strong,
.main-image-current span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.main-image-current strong {
  color: #192033;
}

.main-image-current span {
  margin-top: 4px;
  color: #8a93a8;
  font-weight: 400;
}

.detail-image-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.detail-image-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f5;
  border-radius: 8px;
  background: #fff;
}

.detail-image-item img {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.detail-image-item div {
  min-width: 0;
}

.detail-image-item strong,
.detail-image-item span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-image-item strong {
  color: #192033;
}

.detail-image-item span {
  margin-top: 4px;
  color: #8a93a8;
  font-weight: 400;
}

.delete-image-button {
  height: 32px;
  border: 1px solid #ffd0c8;
  border-radius: 6px;
  color: #d93422;
  background: #fff7f5;
  cursor: pointer;
}

.delete-image-button:hover {
  border-color: #d93422;
}

.detail-image-empty {
  margin: 0;
  padding: 18px 10px;
  border: 1px dashed #ccd5e8;
  border-radius: 8px;
  color: #8a93a8;
  text-align: center;
  font-weight: 400;
}

.inline-upload-button {
  width: max-content;
  min-height: 38px;
  padding: 0 14px;
}

.image-preview-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e7ebf3;
  border-radius: 8px;
  background: #f8faff;
}

.image-preview-panel h3 {
  margin: 0;
  color: #192033;
  font-size: 16px;
}

.preview-box {
  overflow: hidden;
  border: 1px solid #dde4f2;
  border-radius: 8px;
  background: #fff;
}

.preview-box span {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f5;
  color: #596176;
  font-weight: 700;
}

.preview-box img {
  display: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0f2f7;
}

.preview-box.has-image img {
  display: block;
}

.multi-image-preview {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.preview-box.has-image .multi-image-preview {
  display: grid;
}

.multi-image-preview a {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #eef2f8;
}

.multi-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.preview-box p {
  margin: 0;
  padding: 28px 14px;
  color: #8a93a8;
  text-align: center;
}

.preview-box.has-image p {
  display: none;
}

.merchant-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(460px, 1.3fr);
  gap: 18px;
  align-items: start;
}

.merchant-list-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7ebf3;
  border-radius: 10px;
  background: #f8faff;
}

.merchant-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.merchant-list-head input,
.merchant-form input,
.merchant-form select,
.merchant-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: #192033;
  background: #fff;
}

.merchant-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.merchant-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f5;
  border-radius: 10px;
  background: #fff;
}

.merchant-item.active {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(38, 103, 233, .1);
}

.merchant-item img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f8;
}

.merchant-item div {
  min-width: 0;
}

.merchant-item strong,
.merchant-item span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.merchant-item strong {
  color: #192033;
}

.merchant-item span {
  margin-top: 3px;
  color: #8a93a8;
}

.merchant-item button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
}

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

.merchant-product-stats article {
  padding: 12px;
  border: 1px solid #e2e8f5;
  border-radius: 8px;
  background: #f8faff;
}

.merchant-product-stats span,
.merchant-product-stats strong {
  display: block;
}

.merchant-product-stats span {
  color: #8a93a8;
}

.merchant-product-stats strong {
  margin-top: 4px;
  color: #192033;
  font-size: 20px;
}

.merchant-products-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.merchant-product-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f5;
  border-radius: 10px;
  background: #fff;
}

.merchant-product-item img {
  width: 72px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.merchant-product-item div {
  min-width: 0;
}

.merchant-product-item strong,
.merchant-product-item span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.merchant-product-item strong {
  color: #192033;
}

.merchant-product-item span {
  margin-top: 4px;
  color: #7d879b;
}

.merchant-product-actions {
  display: flex;
  gap: 8px;
}

.merchant-product-actions button,
.merchant-product-actions a {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  line-height: 30px;
  cursor: pointer;
}

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

.merchant-form label {
  display: grid;
  gap: 7px;
  color: #596176;
  font-weight: 700;
}

.merchant-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 120px;
  gap: 12px;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.taxonomy-grid section {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.taxonomy-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
}

.taxonomy-add-row.category-add-row {
  grid-template-columns: 110px minmax(0, 1fr) 96px;
}

.taxonomy-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #d9dfec;
  border-radius: 8px;
  background: #f8faff;
}

.taxonomy-manager input,
.taxonomy-manager select,
.taxonomy-manager button {
  min-height: 38px;
}

.taxonomy-manager .ghost-button {
  padding: 0 12px;
  border-radius: 8px;
  line-height: 36px;
}

.taxonomy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px 12px;
  border: 1px solid #e2e8f5;
  border-radius: 8px;
  background: #fff;
}

.taxonomy-edit-item > div {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 96px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.taxonomy-edit-item > div > input[type="hidden"] {
  display: none;
}

.taxonomy-edit-item .taxonomy-row-controls {
  display: contents;
}

.taxonomy-edit-item .taxonomy-row-controls select {
  display: none;
}

.taxonomy-edit-item span {
  grid-column: 1 / -1;
}

.taxonomy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  padding-top: 2px;
}

.taxonomy-item strong,
.taxonomy-item span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.taxonomy-item span {
  margin-top: 2px;
  color: #8a93a8;
  font-weight: 400;
}

.taxonomy-item button {
  min-width: 88px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #ffd0c8;
  border-radius: 6px;
  color: #d93422;
  background: #fff7f5;
  cursor: pointer;
}

.taxonomy-actions button:first-child {
  color: var(--blue);
  border-color: #c8d7fb;
  background: #f3f7ff;
}

.taxonomy-item button:disabled {
  color: #aab2c2;
  border-color: #e1e6ef;
  background: #f5f7fb;
  cursor: not-allowed;
}

.primary-button.is-busy,
.ghost-button.is-busy {
  opacity: .72;
  cursor: wait;
  transform: none;
}

.taxonomy-manager[hidden] {
  display: none;
}

.tag-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9dfec;
  border-radius: 8px;
  background: #f8faff;
}

.tag-editor-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.editable-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.editable-tag-list button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9dfec;
  border-radius: 999px;
  color: #3d4658;
  background: #fff;
  cursor: pointer;
}

.editable-tag-list strong {
  color: #d93422;
  font-size: 14px;
}

.notice-template-tools {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) 88px minmax(140px, .8fr) 104px 86px;
  gap: 8px;
  align-items: center;
}

.notice-template-tools select,
.notice-template-tools input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: #192033;
  background: #fff;
}

.review-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(520px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.review-list-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7ebf3;
  border-radius: 10px;
  background: #f8faff;
}

.review-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 76px;
  gap: 8px;
}

.review-list-head input,
.review-list-head select,
.review-form input,
.review-form select,
.review-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: #192033;
  background: #fff;
}

.review-admin-list {
  display: grid;
  gap: 10px;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e2e8f5;
  border-radius: 10px;
  background: #fff;
}

.review-admin-item.active {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(38, 103, 233, .1);
}

.review-admin-item strong,
.review-admin-item span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.review-admin-item strong {
  color: #192033;
}

.review-admin-item span {
  margin-top: 3px;
  color: #8a93a8;
}

.review-admin-item p {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #596176;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.review-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.review-admin-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d9dfec;
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
}

.review-admin-actions button:last-child {
  color: #d93422;
  border-color: #ffd0c8;
  background: #fff7f5;
}

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

.review-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 110px 140px;
  gap: 12px;
}

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

.admin-table-wrap {
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #edf1f8;
  border-radius: 12px;
  background: #f8faff;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 0;
  vertical-align: middle;
}

.admin-table th {
  padding-top: 8px;
  padding-bottom: 8px;
  color: #778197;
  font-weight: 700;
  background: transparent;
  white-space: nowrap;
}

.selection-column {
  width: 46px;
  min-width: 46px;
  text-align: center;
}

.selection-column input[type="checkbox"],
.product-select {
  width: 18px;
  height: 18px;
  accent-color: #2667e9;
  cursor: pointer;
}

.admin-table tbody tr {
  transition: transform .15s ease, box-shadow .15s ease;
}

.admin-table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 45, 74, .07);
}

.admin-table tbody td {
  background: #fff;
  border-top: 1px solid #e9eef7;
  border-bottom: 1px solid #e9eef7;
}

.admin-table tbody td:first-child {
  border-left: 1px solid #e9eef7;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.admin-table tbody td:last-child {
  border-right: 1px solid #e9eef7;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.admin-product-cell {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 340px;
}

.admin-product-cell img {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f2f7;
  box-shadow: inset 0 0 0 1px #e4e9f4;
}

.admin-product-cell strong {
  display: block;
  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-product-cell span {
  color: #8a93a8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  color: #11845b;
  background: #e8f8f1;
  font-weight: 800;
}

.status-pill.offline {
  color: #a15c00;
  background: #fff4d8;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 190px;
}

.row-actions .edit-button,
.row-actions .danger-button,
.row-actions .status-button {
  min-height: 34px;
  padding: 0 13px;
  line-height: 34px;
  font-size: 13px;
}

.row-actions .status-button {
  background: #111827;
  border-color: #111827;
}

.row-actions .status-button.offline {
  background: #0f9f6e;
  border-color: #0f9f6e;
}

.row-actions a.edit-button {
  color: #5f6f89;
  border-color: #d9e0ee;
  background: #f8faff;
}

.admin-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: #778197;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-pager button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid #d9dfec;
  border-radius: 999px;
  color: #2667e9;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.admin-pager button.active {
  color: #fff;
  border-color: #2667e9;
  background: #2667e9;
}

.admin-pager button:disabled {
  color: #a5aec1;
  cursor: not-allowed;
  background: #f5f7fb;
}

@media (max-width: 1100px) {
  .head-inner {
    grid-template-columns: 300px 1fr;
    gap: 0 24px;
  }

  .logo {
    width: 300px;
  }

  .support-join {
    grid-column: 2;
    margin-top: 12px;
  }

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

  .detail-hero {
    grid-template-columns: 340px 1fr;
  }

  .detail-image {
    width: 340px;
  }

  .admin-main {
    margin-left: 0;
    padding-top: 100px;
  }

  .admin-sidebar {
    right: 0;
    bottom: auto;
    width: auto;
    height: 82px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
  }

  .admin-brand {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .admin-menu {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0;
  }

  .editor-fields,
  .editor-fields.compact,
  .image-manager-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-card-basic .editor-fields label,
  .editor-card-basic .editor-fields .wide {
    grid-column: span 1;
  }

  .editor-status-bar {
    position: static;
  }

  .product-editor-grid {
    grid-template-columns: 1fr;
  }

  .image-preview-panel {
    position: static;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .merchant-admin-layout,
  .merchant-editor-grid,
  .review-admin-layout,
  .review-editor-grid {
    grid-template-columns: 1fr;
  }

  .notice-template-tools,
  .review-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .category-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .head-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 14px;
  }

  .logo {
    width: 100%;
    min-height: 0;
    padding: 16px 0 8px;
  }

  .search-box {
    width: 100%;
    margin-top: 8px;
  }

  .support-join {
    margin-top: 34px;
  }

  .main-nav a {
    padding: 0 16px;
  }

  .category-tabs {
    flex-direction: row;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .detail-hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-image {
    width: min(100%, 410px);
  }

  .admin-topbar,
  .panel-head {
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .main-image-add,
  .detail-image-add,
  .taxonomy-add-row,
  .taxonomy-add-row.category-add-row,
  .taxonomy-edit-item > div,
  .taxonomy-edit-item .taxonomy-row-controls,
  .notice-template-tools,
  .review-list-head,
  .review-score-grid {
    grid-template-columns: 1fr;
  }

  .table-tools .primary-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: min(var(--wrap), calc(100vw - 20px));
  }

  .search-box {
    grid-template-columns: 68px 1fr 74px;
  }

  .category-head {
    margin-top: 34px;
  }

  .category-head h1 {
    font-size: 30px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-bottom {
    grid-template-columns: 1fr 110px;
  }

  .pager {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-title-row h1 {
    font-size: 21px;
  }

  .info-line {
    grid-template-columns: 64px 1fr;
  }

  .info-line .download {
    grid-column: 2;
    text-align: left;
  }

  .include-line {
    grid-template-columns: 64px 1fr;
  }

  .admin-main {
    padding: 110px 12px 18px;
  }

  .admin-sidebar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-brand img {
    width: 78px;
  }

  .admin-menu a {
    padding: 8px 10px;
  }

  .admin-stats,
  .dashboard-product-grid,
  .editor-fields,
  .editor-fields.compact,
  .image-manager-grid {
    grid-template-columns: 1fr;
  }

  .editor-status-bar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-status-actions,
  .editor-head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .editor-fields .wide {
    grid-column: span 1;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }

  .admin-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
