/* ============ 校园书屋 全站样式 ============ */
:root {
  --primary: #1f7a5a;
  --primary-dark: #176047;
  --primary-light: #e6f3ee;
  --bg: #f5f7f6;
  --card: #ffffff;
  --text: #22303a;
  --muted: #7b8a94;
  --border: #e5eae8;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(20, 40, 30, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: linear-gradient(165deg, #eaf3fe 0%, #f4f1fd 50%, #e9f5fc 100%) fixed;
  color: var(--text); font-size: 14px;
  display: flex; flex-direction: column; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 100%; margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; }

/* 头部 */
#site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-in { display: flex; align-items: center; gap: 28px; height: 58px; }
.logo { font-size: 20px; font-weight: 700; color: var(--primary); }
#site-header nav { display: flex; gap: 20px; flex: 1; }
#site-header nav a { color: var(--muted); padding: 4px 2px; }
#site-header nav a.on, #site-header nav a:hover { color: var(--primary); font-weight: 600; }
.header-r { display: flex; align-items: center; gap: 14px; }
.header-r a { color: var(--muted); }
.header-r a:hover { color: var(--primary); }
.user-link { display: inline-flex; align-items: center; gap: 6px; }
.header-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); display: inline-block; vertical-align: middle; }
.header-avatar-emoji { font-size: 16px; }
.badge { background: var(--danger); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 5px; font-style: normal; margin-left: 2px; }
.admin-link { color: var(--warn) !important; font-weight: 600; }

/* 按钮 */
.btn { display: inline-block; border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: 7px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: .15s; text-align: center; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger) !important; border-color: #f3c1c1; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 10px 34px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.section { margin: 22px 0; }
.section-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-h h2 { font-size: 18px; } .section-h h2::before { content: ""; display: inline-block; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; margin-right: 6px; vertical-align: -2px; }
.section-h .more { color: var(--muted); font-size: 13px; }

/* 图书网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.book-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: .15s; display: block; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(20,40,30,.12); }
.cover { position: relative; height: 200px; background: linear-gradient(135deg, #e8f1ec, #d3e6dc); display: flex; align-items: center; justify-content: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cover-ph { font-size: 56px; opacity: .55; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-style: normal; }
.tag-free { position: absolute; top: 8px; left: 8px; background: var(--warn); color: #fff; }
.tag-soldout { position: absolute; top: 8px; right: 8px; background: #999; color: #fff; }
.bc-body { padding: 10px 12px 12px; }
.bc-title { font-weight: 600; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bc-meta { color: var(--muted); font-size: 12px; margin: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-price { display: flex; align-items: baseline; gap: 6px; }
.bc-price b { color: var(--danger); font-size: 17px; }
.bc-price s { color: var(--muted); font-size: 12px; }
.bc-price em { color: var(--warn); font-size: 11px; font-style: normal; background: #fef3c7; padding: 0 4px; border-radius: 3px; }
.bc-sold { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Banner */
.banner-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 16px; }
.banner { border-radius: var(--radius); min-height: 180px; display: flex; flex-direction: column; justify-content: center;
  padding: 30px; color: #fff; background: linear-gradient(120deg, #1f7a5a, #3fae83); cursor: pointer; }
.banner.alt { background: linear-gradient(120deg, #b45309, #d97706); }
.banner h3 { font-size: 22px; margin-bottom: 8px; }
.banner p { opacity: .85; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner { position: relative; overflow: hidden; }
.banner > *:not(img) { position: relative; z-index: 1; }

/* 轮播图 */
.carousel { position: relative; margin-top: 16px; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.carousel-inner { position: relative; height: 280px; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.carousel-slide.active { opacity: 1; z-index: 1; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px 30px;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; }
.carousel-caption h3 { font-size: 24px; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.carousel-caption p { font-size: 14px; opacity: .9; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.carousel-prev, .carousel-next { position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.25); color: #fff; border: none; width: 40px; height: 40px;
  border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 2; display: flex;
  align-items: center; justify-content: center; transition: background .2s; }
.carousel-prev:hover, .carousel-next:hover { background: rgba(0,0,0,.45); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2; }
.carousel-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4);
  cursor: pointer; transition: background .2s, transform .2s; }
.carousel-dots .dot.active { background: var(--card); transform: scale(1.15); }
.carousel-dots .dot:hover { background: rgba(255,255,255,.7); }
.notice-bar { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: var(--radius);
  padding: 10px 16px; margin: 14px 0; font-size: 13px; }

/* 搜索 */
.search-box { display: flex; gap: 0; margin: 16px 0; }
.search-box input { flex: 1; border: 2px solid var(--primary); border-right: none; border-radius: 8px 0 0 8px; padding: 10px 16px; font-size: 15px; outline: none; }
.search-box button { border-radius: 0 8px 8px 0; }
.cat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.chip { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 6px 16px; cursor: pointer; font-size: 13px; }
.chip.on, .chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* 筛选条 */
.filters { display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.filters label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.filters input, .filters select { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 13px; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-weight: 600; font-size: 13px; }
.form-item label small { color: var(--muted); font-weight: 400; }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 12px; } .form-row .form-item { flex: 1; }
.form-tip { color: var(--muted); font-size: 12px; }

/* 认证页（登录 / 注册） */
body.auth-page {
  min-height: 100vh;
  background:
    url("../images/auth-bg.svg") center / cover no-repeat,
    linear-gradient(165deg, #cfe4fb 0%, #e6dcf8 52%, #f9dceb 100%);
  background-color: #e6ddf8;
}
body.auth-page #site-header {
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.auth-wrap { position: relative; z-index: 1; max-width: 420px; margin: 52px auto 70px; padding: 0 16px; }
.auth-wrap::before, .auth-wrap::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
}
.auth-wrap::before {
  width: 150px; height: 150px; left: -96px; top: 24px;
  background: radial-gradient(circle at 32% 32%, rgba(126,166,240,.36), rgba(126,166,240,0) 70%);
}
.auth-wrap::after {
  width: 180px; height: 180px; right: -110px; bottom: 36px;
  background: radial-gradient(circle at 68% 68%, rgba(178,146,232,.34), rgba(178,146,232,0) 70%);
}
.auth-wrap h1 { text-align: center; color: var(--primary-dark); margin-bottom: 6px; font-size: 26px; letter-spacing: 2px; }
.auth-wrap .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-wrap .card {
  position: relative; overflow: hidden;
  padding: 30px 28px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.94);
  box-shadow: 0 20px 45px rgba(20,56,42,.12), 0 2px 6px rgba(20,56,42,.05);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  animation: authIn .5s cubic-bezier(.22,.68,.36,1) both;
}
.auth-wrap .card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, #6f9de8, #9b86e0, #c79ae9);
}
@keyframes authIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-wrap .form-item input, .auth-wrap .form-item select {
  background: #fbfcff;
  border-color: #e3eaf7;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-wrap .form-item input:focus, .auth-wrap .form-item select:focus {
  background: var(--card); border-color: #7d9ce0; box-shadow: 0 0 0 3px rgba(125,156,224,.18);
}
.auth-wrap .btn-primary {
  border: none; border-radius: 10px; letter-spacing: 2px;
  background: linear-gradient(135deg, #238766, #1a6b4f);
  box-shadow: 0 8px 18px rgba(31,122,90,.28);
  transition: background .18s, box-shadow .18s, transform .18s;
}
.auth-wrap .btn-primary:hover {
  background: linear-gradient(135deg, #1f7a5a, #14543d);
  box-shadow: 0 10px 22px rgba(31,122,90,.34);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .auth-wrap { margin: 28px auto 44px; }
  .auth-wrap h1 { font-size: 22px; }
  .auth-wrap .card { padding: 22px 18px; border-radius: 14px; }
  .auth-wrap::before, .auth-wrap::after { display: none; }
}

/* 页脚：始终贴在页面最底部 */
.site-footer {
  margin-top: auto;
  text-align: center;
  background: #1a1a1a;
  color: #fff;
  padding: 30px 0 40px;
  font-size: 12px;
}

/* 详情页 */
.detail-top { display: grid; grid-template-columns: 380px 1fr; gap: 26px; background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.gallery .main-img { height: 380px; border-radius: 8px; background: linear-gradient(135deg,#e8f1ec,#d3e6dc);
  display: flex; align-items: center; justify-content: center; font-size: 90px; overflow: hidden; position: relative; }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs .th { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; position: relative;
  background: #eef4f1; display: flex; align-items: center; justify-content: center; }
.thumbs .th.on { border-color: var(--primary); }
.d-title { font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
.d-price { background: var(--primary-light); border-radius: 8px; padding: 14px 16px; margin: 14px 0; display: flex; align-items: baseline; gap: 12px; }
.d-price b { font-size: 28px; color: var(--danger); }
.d-price s { color: var(--muted); }
.d-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.d-tags .tag { background: #f1f5f3; color: var(--primary-dark); font-size: 12px; padding: 3px 10px; border-radius: 6px; }
.d-meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.d-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-ctl button { width: 32px; height: 34px; border: none; background: #f6f8f7; cursor: pointer; font-size: 16px; }
.qty-ctl span { min-width: 44px; text-align: center; }
/* 支付方式选择 */
.pay-methods { display: flex; gap: 12px; flex-wrap: wrap; }
.pay-opt { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 14px; transition: border-color .2s; }
.pay-opt:hover { border-color: var(--primary); }
.pay-opt input { accent-color: var(--primary); }
.pay-icon { font-size: 18px; }
.seller-card { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 评价 */
.review { border-bottom: 1px solid var(--border); padding: 14px 0; }
.review:last-child { border-bottom: none; }
.stars { color: #f59e0b; letter-spacing: 2px; }
.review .rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review .rv-images img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; margin-right: 8px; }
.review .rv-reply { background: #f6f8f7; border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: 13px; color: var(--primary-dark); }

/* 列表 / 订单 */
.status-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.order-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.order-head { display: flex; justify-content: space-between; padding: 12px 18px; background: #fafcfa; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.order-body { display: flex; gap: 14px; padding: 16px 18px; align-items: center; }
.order-thumb { width: 80px; height: 80px; border-radius: 8px; background: #eef4f1; display: flex; align-items: center; justify-content: center; font-size: 34px; overflow: hidden; flex-shrink: 0; }
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-info { flex: 1; }
.order-info .o-title { font-weight: 600; margin-bottom: 4px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px dashed var(--border); }
.o-status { font-weight: 600; } .o-status.warn{color:var(--warn)} .o-status.ok{color:var(--primary)} .o-status.info{color:#2563eb} .o-status.muted{color:var(--muted)}
.o-actions { display: flex; gap: 8px; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.tbl th { background: #f6f8f7; font-weight: 600; }
.tbl tr:hover td { background: #fafcfa; }

/* 个人中心布局 */
.page-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 18px; }
.side-menu { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.side-menu a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; position: relative; }
.side-menu a.on, .side-menu a:hover { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.menu-badge { display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; text-align: center; box-shadow: 0 1px 4px rgba(220,53,69,.4); }

/* 后台 */
.admin-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; margin-top: 18px; min-height: 70vh; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-card .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-card.hot .num { color: var(--danger); }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 10px 4px 0; }
.trend .bar { flex: 1; background: linear-gradient(180deg, #3fae83, #1f7a5a); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.trend .bar i { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-style: normal; }
.trend .bar em { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-style: normal; white-space: nowrap; }

/* 图片上传 */
.img-up { display: flex; gap: 10px; flex-wrap: wrap; }
.img-up .up-box { width: 90px; height: 90px; border: 1px dashed #c2cec9; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; font-size: 22px; background: #fafcfa; position: relative; overflow: hidden; }
.img-up .up-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-up .up-box .rm { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 18px; height: 18px;
  font-size: 12px; display: flex; align-items: center; justify-content: center; z-index: 2; }

/* Toast */
.toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%) translateY(-16px); background: rgba(30,40,36,.92); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 999; max-width: 80vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--primary); }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; margin: 22px 0; }
.pager a, .pager span { min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px;
  background: var(--card); border: 1px solid var(--border); cursor: pointer; }
.pager a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager span { border: none; background: transparent; cursor: default; }

/* 求购卡片 */
.want-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 12px; }
.want-card .w-t { font-weight: 600; margin-bottom: 6px; }
.want-card .w-meta { color: var(--muted); font-size: 13px; }
.want-card .w-price { color: var(--danger); font-weight: 700; white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.empty .ico { font-size: 44px; margin-bottom: 10px; }
.muted { color: var(--muted); } .mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex1 { flex: 1; }
.desc-pre { white-space: pre-wrap; line-height: 1.8; }

/* 移动端响应式保留 */
@media (max-width: 760px) {
  .detail-top { grid-template-columns: 1fr; }
  .page-grid, .admin-grid { grid-template-columns: 1fr; }
  .banner-row { grid-template-columns: 1fr; }
  #site-header nav { gap: 12px; overflow-x: auto; }
  .header-r { gap: 8px; }
  .wrap { padding: 0 12px; }
}

/* ============ 主题切换：日间 / 护眼 / 夜间 ============ */
.theme-sel {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border); background-color: var(--card); color: var(--text);
  border-radius: 16px; padding: 4px 24px 4px 10px; font-size: 12px; cursor: pointer; outline: none;
  font-family: inherit; line-height: 1.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b9aa6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color .2s, background-color .2s, color .2s;
}
.theme-sel:hover { border-color: var(--primary); }
body, #site-header, .card, .book-card, .btn, .order-card, .want-card, .filters, .chip,
.side-menu, .stat-card, .detail-top, table.tbl, .site-footer {
  transition: background-color .25s, color .25s, border-color .25s;
}

/* —— 护眼模式 —— */
html[data-theme="eye"] {
  --primary: #2f7d4f;
  --primary-dark: #256b42;
  --primary-light: #e6f0dc;
  --bg: #eef2e4;
  --card: #fdfcf3;
  --text: #33402f;
  --muted: #76816a;
  --border: #dfe3d1;
  --shadow: 0 1px 4px rgba(60, 80, 40, .08);
}
html[data-theme="eye"] body {
  background: linear-gradient(165deg, #e9f1dd 0%, #f4f1e0 52%, #e7f0e4 100%) fixed;
}
html[data-theme="eye"] body.auth-page {
  background: linear-gradient(160deg, #e3efd8 0%, #f3f0dd 52%, #e8f1e6 100%);
}
html[data-theme="eye"] body.auth-page #site-header { background: rgba(253,252,243,.85); }
html[data-theme="eye"] .auth-wrap .card { background: rgba(253,252,244,.95); border-color: rgba(255,255,255,.9); }
html[data-theme="eye"] .auth-wrap .card::before { background: linear-gradient(90deg, #6aa84f, #9ab86a, #c9c26a); }
html[data-theme="eye"] .auth-wrap .form-item input,
html[data-theme="eye"] .auth-wrap .form-item select { background: #f8f7ea; border-color: #e2e5d2; }
html[data-theme="eye"] .auth-wrap .form-item input:focus,
html[data-theme="eye"] .auth-wrap .form-item select:focus { background: #fffdf2; border-color: #8aa86e; box-shadow: 0 0 0 3px rgba(138,168,110,.18); }
html[data-theme="eye"] .auth-wrap::before,
html[data-theme="eye"] .auth-wrap::after { opacity: .5; }

/* —— 夜间模式 —— */
html[data-theme="night"] {
  --primary: #3fbf8e;
  --primary-dark: #2f9e75;
  --primary-light: #1d3b30;
  --bg: #10161c;
  --card: #182129;
  --text: #e4ecf2;
  --muted: #90a0ad;
  --border: #26323d;
  --warn: #f0a437;
  --danger: #f0616b;
  --shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
html[data-theme="night"] body {
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(46,72,99,.55), transparent 62%),
    radial-gradient(760px 480px at 92% 100%, rgba(62,44,92,.42), transparent 60%),
    linear-gradient(170deg, #0d1217 0%, #121a21 55%, #0f1720 100%) fixed;
  color: var(--text);
}
html[data-theme="night"] #site-header { background: rgba(20,28,36,.94); border-bottom-color: var(--border); }
html[data-theme="night"] .btn { background: #1e2933; color: var(--text); border-color: var(--border); }
html[data-theme="night"] .btn-primary { background: var(--primary); color: #071511 !important; border-color: var(--primary); }
html[data-theme="night"] .btn-primary:hover { background: #4fd39c; }
html[data-theme="night"] .btn-danger { border-color: #5a2a30; }
html[data-theme="night"] .btn-danger:hover { background: #3a1d20; }
html[data-theme="night"] .order-head,
html[data-theme="night"] .tbl th { background: #1b242d; }
html[data-theme="night"] .tbl tr:hover td { background: #1d2731; }
html[data-theme="night"] .cover,
html[data-theme="night"] .gallery .main-img { background: linear-gradient(135deg, #1e2a32, #16222a); }
html[data-theme="night"] .order-thumb,
html[data-theme="night"] .thumbs .th { background: #1b242d; }
html[data-theme="night"] .review .rv-reply,
html[data-theme="night"] .qty-ctl button,
html[data-theme="night"] .img-up .up-box { background: #1b242d; border-color: var(--border); }
html[data-theme="night"] .notice-bar { background: #2b2413; border-color: #4a3b16; color: #eac97a; }
html[data-theme="night"] .bc-price em { background: #3a2f12; color: #eac97a; }
html[data-theme="night"] .d-tags .tag { background: #1e2a32; color: #9fd4bb; }
html[data-theme="night"] .d-price { background: #1d3b30; }
html[data-theme="night"] .tag-soldout { background: #4a5560; }
html[data-theme="night"] .form-item input,
html[data-theme="night"] .form-item select,
html[data-theme="night"] .form-item textarea,
html[data-theme="night"] .filters input,
html[data-theme="night"] .filters select,
html[data-theme="night"] .search-box input {
  background: #141d25; color: var(--text); border-color: var(--border);
}
html[data-theme="night"] .search-box input { border-color: var(--primary); }
html[data-theme="night"] .form-item input:focus,
html[data-theme="night"] .form-item select:focus,
html[data-theme="night"] .form-item textarea:focus { border-color: var(--primary); }
html[data-theme="night"] .site-footer { background: #0b0f13; color: #9aa8b4; }
html[data-theme="night"] body.auth-page {
  background:
    radial-gradient(760px 460px at 14% 0%, rgba(70,104,160,.30), transparent 62%),
    radial-gradient(680px 420px at 92% 100%, rgba(118,70,160,.24), transparent 60%),
    linear-gradient(165deg, #0e141a 0%, #131b23 55%, #101820 100%);
}
html[data-theme="night"] body.auth-page #site-header { background: rgba(20,28,36,.82); }
html[data-theme="night"] .auth-wrap .card {
  background: rgba(24,33,42,.95);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 20px 45px rgba(0,0,0,.5);
}
html[data-theme="night"] .auth-wrap .card::before { background: linear-gradient(90deg, #3fbf8e, #5a8fe0, #a678e0); }
html[data-theme="night"] .auth-wrap .form-item input,
html[data-theme="night"] .auth-wrap .form-item select { background: #141d25; border-color: #2a3843; color: var(--text); }
html[data-theme="night"] .auth-wrap .form-item input:focus,
html[data-theme="night"] .auth-wrap .form-item select:focus { background: #182430; border-color: #4f8ddc; box-shadow: 0 0 0 3px rgba(79,141,220,.2); }
html[data-theme="night"] .auth-wrap h1 { color: #d7e6f2; }
html[data-theme="night"] .auth-wrap::before,
html[data-theme="night"] .auth-wrap::after { opacity: .35; }
@media (max-width: 760px) {
  .theme-sel { font-size: 11px; padding: 3px 20px 3px 8px; background-position: right 6px center; }
}
