/* style.css — 前台样式（原创实现） */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #ff7a45;
  --primary-dark: #e85d25;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #333;
  --muted: #999;
  --border: #eee;
  --green: #52c41a;
  --blue: #1890ff;
  --red: #f5222d;
}
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 12px; }

/* 顶栏 */
.topbar { background: linear-gradient(90deg, #ff7a45, #ff9a6c); color: #fff; font-size: 12px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #fff; opacity: .9; }
.navbar { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; align-items: center; height: 56px; gap: 24px; }
.logo { font-size: 20px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.logo .cart-badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; margin-left: 2px; }
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a { padding: 6px 10px; border-radius: 4px; color: #555; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); background: #fff4ef; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 4px; padding: 8px 18px; font-size: 14px; background: var(--primary); color: #fff; text-align: center; transition: .15s; }
.btn:hover { background: var(--primary-dark); }
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-plain:hover { background: #fff4ef; }
.btn-green { background: var(--green); } .btn-green:hover { background: #44a30f; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 横幅 */
.banner { background: linear-gradient(120deg, #2b3a55, #4a5f8a); color: #fff; padding: 34px 0; margin-bottom: 16px; }
.banner h1 { font-size: 26px; margin-bottom: 8px; }
.banner p { opacity: .85; }
.banner .tips { margin-top: 12px; font-size: 12px; opacity: .75; }

/* 公告 */
.notice { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800; padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }

/* 分类 tabs */
.section-title { font-size: 18px; font-weight: 700; margin: 20px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-tab { padding: 7px 16px; background: #fff; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 13px; color: #666; }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 商品网格 */
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.goods-card { background: var(--card); border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); display: flex; flex-direction: column; gap: 10px; transition: .15s; }
.goods-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.goods-title { font-size: 14px; font-weight: 600; line-height: 1.5; min-height: 42px; }
.goods-meta { display: flex; justify-content: space-between; align-items: baseline; }
.goods-price { color: var(--primary); font-size: 20px; font-weight: 700; }
.goods-price small { font-size: 12px; }
.goods-orig { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-left: 6px; }
.goods-info { color: var(--muted); font-size: 12px; display: flex; gap: 14px; }
.goods-info .hot { color: var(--red); }
.goods-btn { align-self: flex-end; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 200; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: min(480px, 92vw); max-height: 86vh; overflow: auto; padding: 20px; }
.modal h3 { margin-bottom: 14px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal .close { cursor: pointer; color: var(--muted); font-size: 20px; font-weight: 400; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; }
.form-item input:focus, .form-item select:focus { border-color: var(--primary); }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.stock-line { font-size: 13px; color: #666; margin-bottom: 10px; }
.total-line { font-size: 15px; margin: 12px 0; }
.total-line b { color: var(--red); font-size: 22px; }
.muted { color: var(--muted); font-size: 12px; }

/* 卡片/面板 */
.panel { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.page-title { font-size: 20px; font-weight: 700; margin: 20px 0 14px; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.tbl th { color: #888; font-weight: 500; background: #fafafa; }
.status { padding: 2px 8px; border-radius: 10px; font-size: 12px; display: inline-block; }
.st-pending { background: #fff7e6; color: #d48806; }
.st-paid { background: #e6f7ff; color: #1890ff; }
.st-completed { background: #f6ffed; color: #52c41a; }
.st-refund_req { background: #fff1f0; color: #f5222d; }
.st-refunded { background: #f9f0ff; color: #722ed1; }
.st-cancelled { background: #f5f5f5; color: #999; }

/* 客服页 */
.kf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.kf-item { text-align: center; padding: 26px 16px; }
.kf-item .ico { font-size: 34px; margin-bottom: 10px; }
.kf-item .val { font-size: 16px; font-weight: 700; margin: 6px 0; }

footer { margin-top: 40px; padding: 20px 0; text-align: center; color: var(--muted); font-size: 12px; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 10px 20px; border-radius: 4px; z-index: 999; display: none; max-width: 80vw; }
@media (max-width: 640px) {
  .nav-links { display: none; }
  .goods-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   可选界面风格（后台「站点设置 → 界面风格」一键切换）
   ========================================================== */

/* 风格二：活动站风格 —— 红橙配色、卡片更立体、按钮渐变 */
[data-theme="cf"] {
  --primary: #e23442;
  --primary-dark: #c81f2c;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #9a9a9a;
  --border: #ededed;
}
[data-theme="cf"] .topbar { background: linear-gradient(90deg, #e23442, #ff6f06); }
[data-theme="cf"] .navbar { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
[data-theme="cf"] .banner { background: linear-gradient(120deg, #e23442, #ff8a3d); }
[data-theme="cf"] .btn { border-radius: 6px; background: linear-gradient(90deg, #e23442, #ff6f06); }
[data-theme="cf"] .btn:hover { background: linear-gradient(90deg, #c81f2c, #f06000); }
[data-theme="cf"] .btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
[data-theme="cf"] .btn-plain:hover { background: #fff1f0; }
[data-theme="cf"] .cat-tab.active { background: linear-gradient(90deg, #e23442, #ff6f06); border-color: transparent; color: #fff; }
[data-theme="cf"] .goods-card { border-radius: 10px; border: 1px solid #f0f0f0; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
[data-theme="cf"] .goods-card:hover { box-shadow: 0 6px 18px rgba(226,52,66,.18); transform: translateY(-2px); }
[data-theme="cf"] .goods-price { font-size: 22px; }
[data-theme="cf"] .notice { background: #fff1f0; border-color: #ffccc7; color: #c81f2c; }
[data-theme="cf"] .section-title::before { height: 20px; border-radius: 3px; }

/* 风格三：夜间模式 —— 深底浅字，晚上看不刺眼 */
[data-theme="dark"] {
  --bg: #16181d;
  --card: #1f232b;
  --text: #e6e6e6;
  --muted: #8b8f98;
  --border: #2c313a;
}
[data-theme="dark"] .navbar,
[data-theme="dark"] .panel,
[data-theme="dark"] .goods-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .cat-tab { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .cat-tab { color: #bbb; }
[data-theme="dark"] .tbl th { background: #23272f; color: #bbb; }
[data-theme="dark"] .tbl td { border-bottom: 1px solid var(--border); }
[data-theme="dark"] .form-item input,
[data-theme="dark"] .form-item select,
[data-theme="dark"] .form-item textarea { background: #23272f; color: #e6e6e6; border-color: #333a44; }
[data-theme="dark"] .form-item label { color: #aaa; }
[data-theme="dark"] .btn-plain { background: var(--card); color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .goods-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.5); }
[data-theme="dark"] .topbar { background: linear-gradient(90deg, #2b2f38, #3a3f4a); }
[data-theme="dark"] .notice { background: #2a2418; border-color: #4a3f22; color: #e8c477; }
[data-theme="dark"] .modal { color: var(--text); }
[data-theme="dark"] .inline-input { background: #23272f; color: #e6e6e6; border-color: #333a44; }

/* ==========================================================
   风格四：简洁面板风（dash）
   首页改成「左用户面板 + 分类列表 / 右公告 + 商品分区」两栏卡片布局
   ========================================================== */
html[data-theme="dash"] {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a94a6;
  --border: #ebeff5;
  --primary: #ff4d2e;
  --primary-dark: #e63d20;
  --blue: #2f6bff;
}
/* Logo 图片 */
.logo-img { width: 26px; height: 26px; object-fit: contain; display: block; }

/* 布局切换：默认显示经典布局，选「简洁面板风」时只显示两栏面板 */
.dash-wrap { display: none; }
html[data-theme="dash"] .classic-only { display: none; }
html[data-theme="dash"] .dash-wrap {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-top: 14px;
}

/* 面板风顶部更清淡 */
html[data-theme="dash"] .topbar { background: #e9edf3; color: #7b8798; }
html[data-theme="dash"] .topbar a { color: #7b8798; }
html[data-theme="dash"] .navbar { box-shadow: none; border-bottom: 1px solid var(--border); }
html[data-theme="dash"] .btn { border-radius: 8px; font-weight: 500; }
html[data-theme="dash"] .btn-sm { padding: 5px 14px; font-size: 12.5px; }
html[data-theme="dash"] .nav-links a.active,
html[data-theme="dash"] .nav-links a:hover { background: #fff1ee; }

/* 卡片 */
.dcard { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.dash-side .dcard + .dcard,
.dash-main .dcard + * { margin-top: 14px; }
.dcard-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.dcard-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--bar, var(--primary)); }
.dsec-count { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* 左侧：用户面板 */
.du-head { display: flex; align-items: center; gap: 10px; }
.du-avatar { width: 44px; height: 44px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex: none; }
.du-idbox { flex: 1; min-width: 0; }
.du-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.du-badge { font-size: 10px; background: #fff0eb; color: #ff6a2b; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.du-badge.gray { background: #f0f2f5; color: #8a94a6; }
.du-uid { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.du-logout { font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.du-logout:hover { color: var(--primary); border-color: var(--primary); }
.du-bal { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.du-bal-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.du-charge { font-size: 12px; color: #fff; background: var(--blue); padding: 3px 12px; border-radius: 20px; font-weight: 500; }
.du-charge:hover { background: #1f56e0; }
.du-bal-num { font-size: 26px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -.5px; }
.du-today { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); background: #f7f9fc; padding: 7px 10px; border-radius: 8px; }
.du-today b { color: var(--text); font-weight: 600; }
.du-login { display: flex; gap: 8px; margin-top: 12px; }
.du-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.du-q { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 2px; border-radius: 8px; color: #5c6675; font-size: 11.5px; transition: .15s; }
.du-q svg { width: 20px; height: 20px; }
.du-q:hover { background: #f3f6fb; color: var(--primary); }

/* 左侧：分类列表 */
.dcat-list { list-style: none; margin: 0; padding: 0; }
.dcat-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #4a5261; transition: .15s; }
.dcat-item:hover { background: #f5f8fc; }
.dcat-item.active { background: #fff1ee; color: var(--primary); font-weight: 600; }
.dcat-ico { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: none; }
.dcat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcat-num { font-size: 11px; color: #aab2be; }

/* 右侧：公告栏 */
.dnotice { padding: 16px 18px; }
.dnotice-title { text-align: center; font-size: 15px; font-weight: 600; letter-spacing: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dnotice-body { font-size: 13.5px; line-height: 1.9; color: #3c4553; }
.dnotice-hint { font-size: 13px; line-height: 1.8; color: #5a6270; margin-top: 8px; }
.dnotice-warn { margin-top: 10px; font-size: 12.5px; color: var(--primary); background: #fff5f2; border-radius: 8px; padding: 8px 12px; }
.dnotice-links { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dnotice-links a { flex: 1; min-width: 108px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: #5a6270; padding: 9px 6px; border-radius: 8px; background: #f7f9fc; }
.dnotice-links a:hover { color: var(--primary); background: #fff5f2; }
.dnotice-links svg { width: 16px; height: 16px; }

/* 右侧：商品分区 */
.dlist { display: flex; flex-direction: column; }
.ditem { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 8px; cursor: pointer; transition: .15s; }
.ditem + .ditem { border-top: 1px solid #f3f6fa; }
.ditem:hover { background: #f8fafd; }
.ditem-ico { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex: none; }
.ditem-main { flex: 1; min-width: 0; }
.ditem-title { font-size: 13.5px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ditem-meta { margin-top: 4px; display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.dprice { color: var(--primary); font-size: 17px; font-weight: 700; }
.dprice small { font-size: 11px; margin-right: 1px; }
.dorig { text-decoration: line-through; color: #b6bdc9; }
.dsep { color: #dfe4ec; }
.ditem-right { display: flex; align-items: center; gap: 10px; flex: none; }
.dstock { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: #eef3ff; color: var(--blue); white-space: nowrap; }
.dstock.off { background: #f2f3f5; color: #a3aab6; }

/* 窄屏：面板风改为单栏 */
@media (max-width: 900px) {
  html[data-theme="dash"] .dash-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ditem { align-items: flex-start; }
  .ditem-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ditem-right { flex-direction: column; align-items: flex-end; gap: 6px; }
  .dnotice-links a { min-width: 44%; }
}
