/* 果Q甜 · 商品管理后台
   主色 #2D7051 与小程序一致；价格红 #ff4422、加购橙 #FF9300 保留语义色。 */

:root {
  --primary: #2D7051;
  --primary-dark: #245a42;
  --primary-soft: rgba(45, 112, 81, .10);
  --ink: #223029;
  --muted: #7b8a83;
  --line: #e4eae6;
  --bg: #f3f6f4;
  --card: #ffffff;
  --price: #ff4422;
  --danger: #e64340;
  --orange: #FF9300;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  background: linear-gradient(135deg, #2D7051 0%, #357f5d 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  box-shadow: 0 2px 10px rgba(20, 50, 38, .18);
}

.brand { display: flex; align-items: baseline; gap: 12px; }

.brand-mark {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 22px;
}

.topnav-link {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}

.topnav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.topnav-active,
.topnav-active:hover {
  color: #fff;
  background: rgba(255, 255, 255, .20);
  font-weight: 600;
}

/* ---------------------------------------------------------------- 布局 */

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(25, 50, 38, .05);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  padding: 1px 9px;
}

.id-tag {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  width: 190px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 112, 81, .12);
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(45, 112, 81, .25);
}

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

.btn-ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: #f6faf8; }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

.btn-block { width: 100%; height: 42px; font-size: 15px; }

.btn:disabled { opacity: .6; cursor: default; }

/* ---------------------------------------------------------------- 提示条 */

.notice {
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid transparent;
}

.notice-success {
  background: #edf7f1;
  border-color: #c9e6d5;
  color: #1f6747;
}

.notice-error {
  background: #fdf0ef;
  border-color: #f5cfcc;
  color: #b3362f;
}

.notice-warning {
  background: #fff7e6;
  border-color: #f4dfae;
  color: #8a5c00;
}

.form-notice { margin: 14px 18px 0; }

/* ---------------------------------------------------------------- 列表 */

.table-wrap { overflow-x: auto; }

.goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.goods-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  background: #fafcfb;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.goods-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2ef;
  vertical-align: middle;
}

.goods-table tbody tr:last-child td { border-bottom: none; }
.goods-table tbody tr:hover { background: #fbfdfc; }
.goods-table tbody tr.row-active { background: var(--primary-soft); }

.col-pic { width: 56px; }
.col-cat { width: 104px; white-space: nowrap; }
.col-price { white-space: nowrap; color: var(--price); font-weight: 600; }
.col-stores { white-space: nowrap; color: var(--muted); }
.col-status { width: 78px; white-space: nowrap; }
.col-ops { width: 108px; white-space: nowrap; }

.thumb-box {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2ef;
  border: 1px solid var(--line);
}

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #eef2ef;
}

.g-name {
  font-weight: 500;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.pill {
  display: inline-block;
  font-size: 12px;
  border-radius: 20px;
  padding: 1px 9px;
  white-space: nowrap;
}

.pill-on { background: #e8f5ee; color: var(--primary); }
.pill-off { background: #f0f2f1; color: var(--muted); }

.op {
  background: none;
  border: none;
  padding: 3px 5px;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
}

.op:hover { text-decoration: underline; }
.op-del { color: var(--danger); }

.inline-form { display: inline; }

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 46px 0 !important;
}

.table-tip {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 22px 0;
}

/* ---------------------------------------------------------------- 表单 */

.form-card { position: sticky; top: 18px; }

.form-head { align-items: flex-start; }

.goods-form { padding: 16px 18px 20px; }

.field { margin-bottom: 14px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.label {
  display: block;
  font-size: 13px;
  color: #44544c;
  margin-bottom: 6px;
}

.label i {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 112, 81, .12);
}

textarea.input {
  resize: vertical;
  min-height: 108px;
  line-height: 1.6;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237b8a83'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* 图片 */

.pics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pic {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef2ef;
}

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

.pic-cover {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  font-size: 10px;
  text-align: center;
  color: #fff;
  background: rgba(45, 112, 81, .82);
  padding: 1px 0;
  min-height: 0;
}

.pic-cover:empty { display: none; }

.pic-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}

.pic-del:hover { background: var(--danger); }

.pic-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px dashed #b9c9c0;
  background: #f7faf8;
  color: var(--primary);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.pic-add:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.pic-add-icon { font-size: 22px; line-height: 1; }
.pic-add-text { font-size: 11px; }

.tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}

.tip-warn {
  color: #8a5c00;
  background: #fff7e6;
  border: 1px solid #f4dfae;
  border-radius: 7px;
  padding: 6px 9px;
  line-height: 1.5;
}

.upload-tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  min-height: 16px;
}

.upload-tip-error { color: var(--danger); }

/* ---------------------------------------------------------------- 订单列表 */

.orders-head { flex-wrap: wrap; }

.filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  width: 112px;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

.filter-input {
  width: 250px;
  height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.status-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  overflow-x: auto;
  background: #fafcfb;
  border-bottom: 1px solid var(--line);
}

.status-tab {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.status-tab:hover { background: #eef3f0; color: var(--ink); }

.status-tab-active,
.status-tab-active:hover {
  background: var(--primary);
  color: #fff;
}

.order-no {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.buyer-name { font-weight: 500; }

.op-ship { color: var(--orange); }

.ostatus-red { background: #fdeceb; color: #c23a33; }
.ostatus-orange { background: #fff3e0; color: #b46a00; }
.ostatus-blue { background: #e9f2fd; color: #2b6cb0; }
.ostatus-green { background: #e8f5ee; color: var(--primary); }
.ostatus-gray { background: #f0f2f1; color: var(--muted); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 管理员名单 */

.col-no { width: 44px; color: var(--muted); }
.col-remark { width: 160px; }
.col-time { width: 160px; white-space: nowrap; color: var(--muted); font-size: 12px; }

.openid {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: #33544a;
  word-break: break-all;
}

.muted { color: var(--muted); }

/* ---------------------------------------------------------------- 微信用户 */

.users-table .col-user { width: 220px; }
.users-table .col-mobile { width: 122px; white-space: nowrap; }
.users-table .col-area { width: 150px; white-space: nowrap; }
.users-table .col-login {
  width: 178px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.users-table .col-login > div:first-child { color: var(--ink); font-size: 12.5px; }

.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }

.user-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e6efea;
  border: 1px solid var(--line);
}

img.user-avatar { display: block; object-fit: cover; }

span.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}

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

.user-nick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-id {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.pager-info { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- 订单详情 */

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

.detail-back .op { padding-left: 0; }

.orders-table .col-ops { width: 152px; }

.order-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.order-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-hero-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  word-break: break-all;
}

.order-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.order-hero-amount { flex-shrink: 0; text-align: right; }

.hero-amount {
  color: var(--price);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.hero-amount-sub { color: var(--muted); font-size: 12px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.goods-lines { padding: 4px 0; }

.goods-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #eef2ef;
}

.goods-line:last-child { border-bottom: none; }

.goods-line .thumb-box {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.goods-line-main { flex: 1; min-width: 0; }

.goods-line-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goods-line-num {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.goods-line-amount {
  width: 90px;
  text-align: right;
  color: var(--price);
  font-weight: 600;
  white-space: nowrap;
}

.panel-body { padding: 14px 18px; }

.panel-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 18px;
}

.panel-body .panel-empty { padding: 2px 0; }

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  font-size: 13px;
}

.kv-label { color: var(--muted); flex-shrink: 0; }
.kv > span:last-child { text-align: right; word-break: break-all; }

.kv-total {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
}

.total-price {
  color: var(--price);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 14px 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: absolute;
  left: 0;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-title { font-weight: 500; font-size: 13px; }

.timeline-remark {
  margin-top: 2px;
  color: #44544c;
  font-size: 13px;
  word-break: break-all;
}

.ship-form .notice {
  margin-bottom: 12px;
  padding: 8px 10px;
}

.ship-form .field:last-of-type { margin-bottom: 16px; }

/* ---------------------------------------------------------------- 登录页 */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2D7051 0%, #1f523a 100%);
}

.login-card {
  width: 330px;
  background: #fff;
  border-radius: 14px;
  padding: 30px 28px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.login-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 20px;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  margin-bottom: 8px;
}

.login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 112, 81, .12);
}

.login-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .form-card { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding: 14px 12px 40px; }
  .topbar { padding: 12px 16px; }
  .topnav { margin-left: 8px; }
  .topnav-link { padding: 5px 8px; }
  .card-head { flex-wrap: wrap; }
  .head-tools { width: 100%; }
  .search { flex: 1; width: auto; }
  .g-name { max-width: 180px; }
  .col-cat { display: none; }
  .filter-form { width: 100%; }
  .filter-select { width: 96px; }
  .filter-input { flex: 1; width: auto; min-width: 120px; }
  .order-hero { flex-direction: column; align-items: flex-start; }
  .order-hero-amount { text-align: left; }
  .orders-table .col-stores { display: none; }
  .users-table .col-area { display: none; }
  .users-table .col-login { display: none; }
}
