/* =================================================================
 *  Aurora Market — 全局样式表
 *  =================================================================
 *  设计令牌 (Design Tokens) + 布局 + 组件 + 响应式
 *  命名约定：语义化 BEM 风格，不依赖第三方框架
 * ================================================================= */

/* ---- 设计令牌 (CSS 自定义属性) ---- */
:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #e7ebf0;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --red: #ef3340;
  --red-dark: #d82331;
  --blue: #1f8fbf;
  --green: #13a06f;
  --shadow: 0 18px 45px rgba(24, 34, 53, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

/* ---- 全局重置 & 基础排版 ---- */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
input,
select {
  font: inherit;
}

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

/* ---- 布局容器：统一的页面宽度约束 ---- */
main,
.market-nav,
.simple-header {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---- 头部导航栏 (sticky 吸顶，毛玻璃效果) ---- */
.market-header,
.simple-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(27, 39, 61, 0.08);
  backdrop-filter: blur(16px);
}

/* ---- 购物车页面专用头部 (占满宽度，flex 布局) ---- */
.cart-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(27, 39, 61, 0.08);
  backdrop-filter: blur(16px);
}

.cart-header::before {
  content: none;
}

.cart-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  font-weight: 900;
}

.cart-header-actions > a:not(.cart-link) {
  color: #344054;
}

.market-nav,
.simple-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.market-nav {
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto auto auto;
}

/* ---- 品牌 Logo & 搜索栏 ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--blue));
  box-shadow: 0 10px 24px rgba(239, 51, 64, 0.24);
}

.nav-links,
.hero-actions,
.auth-links,
.benefit-list {
  display: flex;
  align-items: center;
  gap: 16px;
}

.market-search {
  height: 46px;
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 96px;
  overflow: hidden;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: #fff;
}

.market-search select,
.market-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: #fff;
}

.market-search select {
  padding: 0 14px;
  color: #344054;
  border-right: 1px solid var(--line);
  font-weight: 900;
}

.market-search input {
  padding: 0 16px;
}

.market-search button {
  border: 0;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  cursor: pointer;
}

.nav-links a {
  color: #3a4656;
  font-weight: 800;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  font-weight: 900;
}

/* ---- 用户区域：登录/注册入口 & 下拉菜单 ---- */
.user-area {
  position: relative;
  min-width: 116px;
}

.guest-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-weight: 900;
}

.guest-links a:first-child {
  color: var(--red);
}

.user-dropdown {
  position: relative;
}

.user-trigger {
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.user-menu a,
.user-menu button {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: #344054;
  background: transparent;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.user-menu a:hover,
.user-menu button:hover {
  color: var(--red);
  background: #fff1f2;
}

#cartCount {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 13px;
}

/* =================================================================
 *  首页 Hero 区域：快捷面板 + 轮播图
 * ================================================================= */
.simple-hero {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 26px;
  align-items: stretch;
  padding: 34px 0 20px;
}

.quick-panel,
.hero-copy,
.carousel,
.promo-tile,
.product-card,
.auth-benefits,
.auth-card,
.cart-panel,
.summary-card {
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px;
}

.quick-panel {
  min-height: 420px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(239, 51, 64, 0.14), transparent 24%),
    linear-gradient(135deg, #ffffff, #fff7f7);
}

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

.quick-panel-head h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
}

.quick-panel-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--red);
  background: #ffe8ea;
  font-weight: 900;
}

.quick-deal {
  border: 1px solid #ffd3d8;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.quick-deal strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
}

.quick-deal p {
  margin-bottom: 14px;
  color: var(--muted);
}

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

.quick-categories a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: #344054;
  text-align: center;
  font-weight: 900;
}

.quick-categories a:hover {
  color: var(--red);
  border-color: #ffc6cd;
  background: #fff1f2;
}

.quick-stats {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.quick-stats span {
  flex: 1;
  border-radius: 8px;
  padding: 12px;
  background: #101828;
  color: #fff;
}

.quick-stats strong {
  margin-right: 4px;
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1,
.auth-benefits h1 {
  margin-bottom: 16px;
  font-size: 42px;
  line-height: 1.14;
}

.hero-copy p,
.auth-benefits p,
.page-title p {
  color: var(--muted);
}

.primary-btn,
.ghost-btn,
.text-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(239, 51, 64, 0.24);
}

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

.ghost-btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  color: #116d88;
  background: #eaf7fb;
  font-weight: 900;
}

.full {
  width: 100%;
}

/* ---- 轮播图 (3 张幻灯片，渐隐切换 + 自动播放) ---- */
.carousel {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  color: #fff;
  background: #111827;
}

.carousel-track,
.slide {
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 44%;
  gap: 28px;
  align-items: center;
  padding: 42px;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.4s ease, transform 0.4s ease;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.36), transparent 18%),
    linear-gradient(135deg, #ef3340, #1f8fbf);
}

.slide:nth-child(2) {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.32), transparent 18%),
    linear-gradient(135deg, #13a06f, #5ea8ff);
}

.slide:nth-child(3) {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.32), transparent 18%),
    linear-gradient(135deg, #202a44, #ff9b54);
}

.slide.active {
  opacity: 1;
  transform: scale(1);
}

.slide-tag {
  width: fit-content;
  margin-bottom: 14px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  font-weight: 900;
}

.slide h2 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.16;
}

.slide p {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.9);
}

.slide-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 22px 42px rgba(16, 24, 40, 0.24);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  font-size: 28px;
  cursor: pointer;
}

.carousel-btn.prev {
  left: 18px;
}

.carousel-btn.next {
  right: 18px;
}

.carousel-dots {
  position: absolute;
  left: 42px;
  bottom: 22px;
  display: flex;
  gap: 8px;
}

.carousel-dots button {
  width: 24px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.carousel-dots button.active {
  background: #fff;
}

/* ---- 四联推广卡片 (秒杀/券包/闪购/排行榜) ---- */
.promo-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 10px 0 34px;
}

.promo-tile {
  position: relative;
  min-height: 132px;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #ef3340, #ff8a65);
}

.promo-tile::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.promo-tile.blue {
  background: linear-gradient(135deg, #1f8fbf, #66c7ff);
}

.promo-tile.green {
  background: linear-gradient(135deg, #13a06f, #7adf9c);
}

.promo-tile.dark {
  background: linear-gradient(135deg, #17202a, #536071);
}

.promo-tile strong,
.promo-tile span,
.promo-tile p {
  position: relative;
  z-index: 1;
  display: block;
}

.promo-tile span {
  margin-bottom: 8px;
  opacity: 0.86;
  font-size: 14px;
  font-weight: 900;
}

.promo-tile strong {
  margin-bottom: 8px;
  font-size: 24px;
}

.promo-tile p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

/* ---- 商品区域：标题栏 + 筛选 + 卡片网格 + 分页 ---- */
.section-head,
.cart-head,
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
}

.search-head {
  padding-top: 28px;
}

.search-head h1 {
  margin: 0;
  font-size: 28px;
}

.section-head h2,
.page-title h1 {
  margin-bottom: 0;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.filter-control select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #fff;
  outline: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 4px 0 48px;
}

.pagination button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.pagination button:not(:disabled):hover {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.pagination button:disabled {
  color: #a7b1c2;
  cursor: not-allowed;
}

.pagination span {
  color: var(--muted);
  font-weight: 900;
}

.product-card {
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(24, 34, 53, 0.16);
}

.product-art {
  height: 190px;
  padding: 12px;
  background: #f8fafc;
}

.product-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.product-body {
  padding: 16px;
}

.product-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.product-meta span {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.product-body h3 {
  min-height: 46px;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
}

.product-body p {
  color: var(--muted);
  font-size: 14px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.price {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.add-btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.sales-line {
  margin: 10px 0 0;
  color: #98a2b3 !important;
  font-size: 12px !important;
}

/* ---- 页脚 ---- */
.site-footer {
  padding: 30px 16px;
  color: #98a2b3;
  background: #101828;
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

/* =================================================================
 *  登录/注册页：双栏布局 (品牌展示 + 表单卡片)
 * ================================================================= */
.auth-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 28px;
  align-items: center;
  padding: 42px 0;
}

.auth-benefits {
  min-height: 560px;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.34), transparent 18%),
    linear-gradient(135deg, #17202a, #1f8fbf);
}

.register-benefits {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.34), transparent 18%),
    linear-gradient(135deg, #ef3340, #13a06f);
}

.auth-benefits .eyebrow,
.auth-benefits p {
  color: rgba(255, 255, 255, 0.88);
}

.benefit-list {
  flex-wrap: wrap;
  margin-top: 18px;
}

.benefit-list span {
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.auth-card {
  padding: 34px;
}

.auth-card h2 {
  margin-bottom: 6px;
  font-size: 30px;
}

.auth-card > p {
  color: var(--muted);
}

.auth-card form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-card label span {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fafc;
  outline: 0;
}

.auth-card input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(239, 51, 64, 0.1);
}

.auth-card input.is-invalid,
.auth-card input.is-invalid:focus {
  border-color: var(--red);
  background: #fff7f7;
  box-shadow: 0 0 0 4px rgba(239, 51, 64, 0.1);
}

.auth-card input.is-valid {
  border-color: var(--green);
  background: #f6fffb;
}

.field-message {
  min-height: 20px;
  margin-top: 5px;
  display: block;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.password-strength {
  margin-top: 8px;
}

.strength-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 5px;
}

.strength-bars i {
  height: 5px;
  border-radius: 3px;
  background: #e4e7ec;
}

.password-strength span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.password-strength[data-level="1"] .strength-bars i:nth-child(1) {
  background: var(--red);
}

.password-strength[data-level="2"] .strength-bars i:nth-child(-n+2) {
  background: #e59a16;
}

.password-strength[data-level="3"] .strength-bars i {
  background: var(--green);
}

.password-strength[data-level="1"] strong {
  color: var(--red);
}

.password-strength[data-level="2"] strong {
  color: #b66e00;
}

.password-strength[data-level="3"] strong {
  color: var(--green);
}

.auth-card .remember-option {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.auth-card .remember-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

.auth-card .remember-option span {
  margin: 0;
  display: inline;
  font-weight: 800;
}

.remember-hint {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-links {
  justify-content: space-between;
  margin-top: 18px;
  color: #116d88;
  font-weight: 900;
}

.form-message {
  min-height: 24px;
  margin-top: 16px;
  color: var(--red-dark);
  font-weight: 900;
}

.form-message.success {
  color: var(--green);
}

/* =================================================================
 *  购物车页面：清单 + 摘要侧栏
 * ================================================================= */
.cart-page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 174px);
  padding-bottom: 46px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

.cart-panel,
.summary-card {
  padding: 24px;
}

.cart-head {
  margin-top: 0;
  align-items: center;
}

.text-btn {
  padding: 8px 0;
  color: var(--red-dark);
  background: transparent;
  font-weight: 900;
}

.cart-items {
  display: grid;
  gap: 14px;
}

.cart-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.cart-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-info h3,
.cart-info p {
  margin: 0 0 4px;
}

.cart-info p {
  color: var(--muted);
}

.cart-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.quantity-control button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.quantity-control span {
  min-width: 34px;
  text-align: center;
  font-weight: 900;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: var(--red-dark);
  cursor: pointer;
  font-weight: 900;
}

.summary-card {
  position: sticky;
  top: 100px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.summary-line strong {
  color: var(--red);
  font-size: 24px;
}

.summary-line.muted,
.empty-state {
  color: var(--muted);
}

.empty-state {
  padding: 38px;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  text-align: center;
}

/* ---- 空状态提示 ---- */

/* ---- 商品图片占位符 (无图片时显示) ---- */
.product-art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 15px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
}

.cart-thumb-placeholder {
  width: 84px;
  height: 84px;
  background: #f1f5f9;
  border-radius: 8px;
}

/* =================================================================
 *  管理后台：商品图片上传/URL 管理
 * ================================================================= */
.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-badge {
  background: #111827;
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.admin-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-header-actions a,
.admin-header-actions button {
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.admin-header-actions button:hover {
  color: var(--red);
}

.admin-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.admin-hero {
  margin-bottom: 32px;
}

.admin-hero h1 {
  font-size: 28px;
  margin: 8px 0;
}

.admin-hero > p {
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 20px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-toolbar select,
.admin-toolbar input[type="search"] {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.admin-toolbar input[type="search"] {
  width: 240px;
}

.admin-stats {
  color: var(--muted);
  font-size: 14px;
  margin-left: auto;
}

/* ---- Admin product grid ---- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.admin-product-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.admin-product-card:hover {
  box-shadow: 0 8px 28px rgba(24, 34, 53, 0.10);
}

.admin-product-preview {
  height: 200px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.admin-no-image {
  color: #94a3b8;
  font-size: 15px;
}

.admin-product-info {
  padding: 16px;
}

.admin-product-info h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.admin-product-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.admin-image-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  white-space: nowrap;
}

.admin-file-btn:hover {
  background: #f8fafc;
}

.admin-url-input {
  flex: 1;
  min-width: 120px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.admin-save-btn,
.admin-clear-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-save-btn {
  background: #111827;
  color: #fff;
}

.admin-save-btn:hover {
  background: #333;
}

.admin-clear-btn {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

.admin-clear-btn:hover {
  background: #fff5f5;
}

.admin-save-msg {
  font-size: 13px;
  margin-top: 6px;
  min-height: 20px;
}

.admin-save-msg.success {
  color: #16a34a;
}

.admin-save-msg.error {
  color: var(--red);
}

/* =================================================================
 *  响应式布局
 *  =================================================================
 *  断点 1: ≤900px → 平板/小屏笔记本
 *  断点 2: ≤640px → 手机
 * ================================================================= */
@media (max-width: 900px) {
  .market-nav {
    grid-template-columns: 1fr auto;
    padding: 14px 0;
  }

  .market-search {
    grid-column: 1 / -1;
    order: 3;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .simple-hero,
  .auth-shell,
  .cart-layout {
    grid-template-columns: 1fr;
  }

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

  .summary-card {
    position: static;
  }

  .cart-header {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .cart-header::before {
    content: none;
  }

  .cart-header-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar input[type="search"] {
    width: 100%;
  }

  .admin-stats {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  main,
  .market-nav,
  .simple-header,
  .auth-shell,
  .cart-page {
    width: min(100% - 22px, 1440px);
  }

  .brand {
    font-size: 18px;
  }

  .simple-header,
  .market-nav,
  .cart-header {
    min-height: 66px;
  }

  .nav-links {
    gap: 10px;
    font-size: 14px;
  }

  .market-search {
    grid-template-columns: 108px 1fr 72px;
  }

  .market-search select,
  .market-search input {
    padding-left: 10px;
    padding-right: 10px;
  }

  .user-area {
    min-width: 0;
  }

  .user-trigger {
    max-width: 128px;
  }

  .cart-header-actions {
    gap: 10px;
    font-size: 14px;
  }

  .hero-copy,
  .slide,
  .auth-benefits,
  .auth-card,
  .cart-panel,
  .summary-card {
    padding: 22px;
  }

  .hero-copy,
  .carousel,
  .auth-benefits {
    min-height: 350px;
  }

  .hero-copy h1,
  .auth-benefits h1 {
    font-size: 30px;
  }

  .slide h2 {
    font-size: 28px;
  }

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

  .slide-image {
    height: 150px;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-control {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-control select {
    width: 100%;
  }

  .product-art {
    height: 230px;
  }

  .cart-row {
    grid-template-columns: 72px 1fr;
  }

  .cart-thumb {
    width: 72px;
    height: 72px;
  }

  .cart-tools {
    grid-column: 1 / -1;
    justify-items: stretch;
  }

  .product-art-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
  }

  .admin-product-card .admin-no-image {
    font-size: 16px;
  }
}
