

:root {
  
  --primary: #ff6a00;
  --primary-dark: #e85d00;
  --primary-light: #fff3e6;
  --accent: #ff4000;
  --accent-light: #fff0e6;

  
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --info: #06aed4;

  
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e4e7ed;
  --text: #1f2329;
  --text-2: #4e5969;
  --text-3: #86909c;
  --text-4: #c9cdd4;

  
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 2px 8px rgba(31, 35, 41, .06);
  --shadow-lg: 0 8px 24px rgba(31, 35, 41, .10);
  --sidebar-w: 220px;
  --header-h: 60px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }


.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }


.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text); font-size: 14px; line-height: 1.4;
  transition: all .2s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; opacity: 1; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #e85d00; color: #fff; opacity: 1; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #d92d20; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 30px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }


.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px;
}
.card-hover { transition: all .25s; }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }


.badge {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 12px; line-height: 20px; font-weight: 500;
}
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-green  { background: #e6f9f0; color: var(--success); }
.badge-orange { background: var(--accent-light); color: var(--accent); }
.badge-red    { background: #feeceb; color: var(--danger); }
.badge-gray   { background: #f2f3f5; color: var(--text-3); }
.badge-blue   { background: #e8f1ff; color: #1E03E9; }
.badge-primary { background: #1E03E9; color: #fff; }


.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th {
  background: #fafbfc; color: var(--text-2); font-weight: 600; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid #f2f3f5; vertical-align: middle; }
.table tr:hover td { background: #fafbfd; }
.table .thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: #f2f3f5; }


.form-item { margin-bottom: 18px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-item .required::before { content: '*'; color: var(--danger); margin-right: 3px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; background: #fff; transition: border .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 106, 0, .14); }
.textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }


.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination .btn { min-width: 34px; padding: 6px 10px; }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }


.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); animation: modal-in .2s ease;
}
.modal.modal-wide { max-width: 860px; width: 94%; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; }
.modal-head .close { cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; }
.modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }


#toast-box { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 10px 20px; border-radius: var(--radius); background: #1f2329; color: #fff;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; max-width: 80vw;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }


.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.loading { text-align: center; padding: 40px; color: var(--text-3); }
.loading::before {
  content: ''; display: inline-block; width: 22px; height: 22px; margin-right: 10px;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  vertical-align: -5px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
}
.stat-card .icon {
  width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0;
}
.stat-card .value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-card .label { font-size: 13px; color: var(--text-3); }


.site-top {
  background: linear-gradient(135deg, #0b1f3a 0%, #123055 55%, #1a3f6e 100%);
  color: #fff; font-size: 13px;
}
.site-top .inner { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.site-top a { color: rgba(255,255,255,.85); margin-left: 16px; }
.site-top a:hover { color: #fff; }

.site-header {
  background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.site-header .inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.logo .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #ff6a00, #ff8f3d); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }

.search-bar { flex: 1; max-width: 560px; display: flex; border: 2px solid var(--primary); border-radius: 22px; overflow: hidden; background: #fff; }
.search-bar input { flex: 1; border: none; outline: none; padding: 10px 18px; font-size: 14px; }
.search-bar .btn { border: none; border-radius: 0 20px 20px 0; padding: 0 26px; font-size: 15px; }

.site-nav { background: #fff; border-bottom: 1px solid var(--border); }
.site-nav .inner { display: flex; align-items: center; height: 44px; gap: 4px; }
.site-nav a { color: var(--text); font-size: 15px; padding: 0 18px; height: 44px; line-height: 44px; position: relative; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { color: var(--primary); font-weight: 600; }
.site-nav a.active::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }


.hero { margin-top: 16px; border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 360px; }
.hero .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; display: flex; align-items: center; padding: 0 60px; }
.hero .slide.active { opacity: 1; }
.hero .slide .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero .slide .mask { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,30,80,.72) 0%, rgba(10,30,80,.35) 55%, rgba(10,30,80,0) 100%); }
.hero .slide .text { position: relative; z-index: 1; color: #fff; max-width: 520px; }
.hero .slide .t1 { font-size: 34px; font-weight: 800; margin-bottom: 10px; line-height: 1.3; }
.hero .slide .t2 { font-size: 16px; opacity: .9; margin-bottom: 24px; }
.hero .dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.hero .dots i { width: 26px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); cursor: pointer; transition: background .2s; }
.hero .dots i.active { background: #fff; }


.cat-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 16px; }
.cat-strip .item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 8px; text-align: center; cursor: pointer; transition: all .2s; }
.cat-strip .item:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cat-strip .icon { font-size: 28px; margin-bottom: 6px; }
.cat-strip .name { font-size: 14px; color: var(--text); font-weight: 500; }
.cat-strip .count { font-size: 12px; color: var(--text-3); }


.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.sec-head .title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sec-head .title::before { content: ''; width: 4px; height: 20px; background: var(--primary); border-radius: 2px; }
.sec-head .more { color: var(--text-3); font-size: 13px; }


.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1024px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .prod-grid { grid-template-columns: repeat(2, 1fr); } }
.prod-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: all .25s; position: relative;
}
.prod-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.prod-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f2f3f5; }
.prod-card .body { padding: 12px 14px 14px; }
.prod-card .name { font-size: 14px; color: var(--text); height: 42px; line-height: 21px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-card .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.prod-card .price { color: var(--accent); font-size: 20px; font-weight: 700; }
.prod-card .price small { font-size: 12px; font-weight: 400; }
.prod-card .market { color: var(--text-4); font-size: 12px; text-decoration: line-through; }
.prod-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.prod-card .tag { position: absolute; top: 10px; left: 10px; z-index: 2; }
.prod-card .sales-tag { position: absolute; top: 10px; right: 10px; z-index: 2; }


.detail-layout { display: grid; grid-template-columns: 480px 1fr; gap: 28px; margin-top: 16px; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.gallery { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.gallery .main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: #f2f3f5; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.gallery .thumbs img.active { border-color: var(--primary); }
.detail-info .title { font-size: 22px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.detail-info .sub { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.price-box { background: linear-gradient(135deg, #fff5ec, #fff); border: 1px solid #ffdfc0; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.price-box .now { color: var(--accent); font-size: 32px; font-weight: 800; }
.price-box .market { color: var(--text-3); text-decoration: line-through; font-size: 14px; }
.price-box .sales { color: var(--text-3); font-size: 13px; }
.info-list { border-top: 1px dashed var(--border); padding-top: 14px; }
.info-list .row { display: flex; gap: 10px; padding: 7px 0; color: var(--text-2); font-size: 14px; }
.info-list .row b { color: var(--text); font-weight: 600; width: 72px; flex-shrink: 0; }
.buy-bar { display: flex; gap: 12px; margin-top: 20px; }
.qty-box { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty-box button { width: 36px; height: 42px; border: none; background: #fafbfc; font-size: 18px; color: var(--text-2); }
.qty-box input { width: 48px; height: 42px; border: none; text-align: center; outline: none; }


.news-list .item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.news-list .item:last-child { border-bottom: none; }
.news-list .cover { width: 160px; height: 100px; object-fit: cover; border-radius: var(--radius); background: #f2f3f5; flex-shrink: 0; }
.news-list .title { font-size: 16px; font-weight: 600; color: var(--text); }
.news-list .summary { color: var(--text-3); font-size: 13px; margin: 6px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-list .meta { color: var(--text-4); font-size: 12px; }


.site-footer { background: #101828; color: #98a2b3; margin-top: 48px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 36px 0 28px; }
@media (max-width: 768px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer a { color: #98a2b3; display: block; margin-bottom: 8px; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.site-footer .copyright { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; text-align: center; font-size: 12px; color: #667085; }


.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
  width: var(--sidebar-w); background: #0e2a47; color: #d0d5dd; flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.admin-side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 17px; font-weight: 700; color: #fff; }
.admin-side .brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #ff6a00, #ff8f3d); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.admin-side .menu { flex: 1; overflow-y: auto; padding: 12px 0; }
.admin-side .menu .group { padding: 10px 20px 4px; font-size: 12px; color: #667085; }
.admin-side .menu a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: #d0d5dd;
  font-size: 14px; border-left: 3px solid transparent; transition: all .15s;
}
.admin-side .menu a:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-side .menu a.active { background: rgba(255,106,0,.16); color: #fff; border-left-color: var(--primary); }
.admin-side .menu a .ico { width: 18px; text-align: center; }
.admin-side .foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #667085; }

.admin-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.admin-header {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
}
.admin-header .title { font-size: 16px; font-weight: 600; }
.admin-header .right { display: flex; align-items: center; gap: 14px; }
.admin-header .user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.admin-header .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.admin-content { padding: 24px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 160px; }


.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f5f7fa; padding: 20px; position: relative; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; border: 1px solid #e6e9f0; box-shadow: 0 10px 34px rgba(20,40,80,.10); padding: 46px 40px 40px; position: relative; z-index: 2; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 14px 14px 0 0; background: linear-gradient(90deg, #ff6a00, #ff9500, #ffb800); }
.login-brand { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: 3px; color: #0b1f3a; }
.login-sub { text-align: center; color: #8a93a6; font-size: 13px; margin: 8px 0 30px; letter-spacing: 1px; }

body.login-mode .admin-side, body.login-mode .admin-header { display: none; }
body.login-mode .admin-wrap { display: block; }
body.login-mode .admin-main { margin: 0; padding: 0; }
body.login-mode .admin-content { min-height: 100vh; padding: 0; }
.login-card .form-item { margin-bottom: 18px; }
.login-card .input { height: 46px; border-radius: 10px; border: 1px solid #e5e8ef; padding: 0 14px; font-size: 14px; width: 100%; box-sizing: border-box; background: #fafbfd; color: #1f2937; transition: border-color .2s, box-shadow .2s, background .2s; }
.login-card .input:focus { outline: none; border-color: #ff9500; box-shadow: 0 0 0 3px rgba(255,149,0,.15); background: #fff; }
.login-card .btn-primary { height: 46px; border-radius: 10px; background: linear-gradient(90deg, #ff6a00, #ff9500); border: none; font-size: 16px; font-weight: 600; box-shadow: 0 8px 20px rgba(255,106,0,.30); color: #fff; width: 100%; }
.login-card .btn-primary:hover { background: linear-gradient(90deg, #f05f00, #ff8a00); box-shadow: 0 10px 24px rgba(255,106,0,.38); }
.login-card .btn-primary:disabled { opacity: .7; }


.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-warn { color: var(--warning); }
.text-accent { color: var(--accent); } .text-primary { color: var(--primary); }
.text-3 { color: var(--text-3); } .text-2 { color: var(--text-2); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-3); }


.admin-side .menu .m-group > .m-title {
  display:flex;align-items:center;gap:10px;padding:11px 20px;color:#d0d5dd;font-size:14px;
  border-left:3px solid transparent;cursor:pointer;user-select:none;
}
.admin-side .menu .m-group > .m-title:hover { background:rgba(255,255,255,.05); color:#fff; }
.admin-side .menu .m-group.open > .m-title { color:#fff; }
.admin-side .menu .m-title .arrow { margin-left:auto;font-size:11px;transition:transform .2s; }
.admin-side .menu .m-group.open > .m-title .arrow { transform:rotate(90deg); }
.admin-side .menu .sub { display:none; }
.admin-side .menu .m-group.open .sub { display:block; }
.admin-side .menu .sub a { padding-left:50px; font-size:13px; }
.admin-side .menu .badge-dot {
  margin-left:auto;min-width:18px;height:18px;line-height:18px;padding:0 5px;border-radius:9px;
  background:var(--danger);color:#fff;font-size:11px;text-align:center;
}


.chat-wrap { display:flex; height:calc(100vh - 60px - 40px); gap:14px; }
.chat-list { width:280px;background:#fff;border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column; }
.chat-list .chat-hd { padding:12px 16px;border-bottom:1px solid var(--border);font-weight:600; }
.chat-list .chat-item { padding:12px 16px;border-bottom:1px solid #f2f3f5;cursor:pointer;display:flex;align-items:center;gap:10px; }
.chat-list .chat-item:hover { background:#fafbfc; }
.chat-list .chat-item.active { background:var(--primary-light); }
.chat-list .chat-item .dot { width:8px;height:8px;border-radius:50%;background:var(--danger);flex-shrink:0; }
.chat-box { flex:1;background:#fff;border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column; }
.chat-msgs { flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px;background:#f7f9fc; }
.bubble { max-width:62%;padding:9px 14px;border-radius:12px;font-size:14px;line-height:1.5; }
.bubble.me { align-self:flex-end;background:var(--primary);color:#fff;border-bottom-right-radius:3px; }
.bubble.other { align-self:flex-start;background:#fff;border:1px solid var(--border);border-bottom-left-radius:3px; }
.bubble .meta { font-size:11px;opacity:.7;margin-top:4px; }
.chat-input { display:flex;gap:10px;padding:12px;border-top:1px solid var(--border); }
.chat-input .input { flex:1; }


.stat-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px; }
@media (max-width:1200px){ .stat-grid{grid-template-columns:repeat(2,1fr);} }
.stat-card { background:#fff;border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;gap:14px;align-items:center; }
.stat-card .icon { width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:22px; }
.stat-card .value { font-size:22px;font-weight:700; }
.stat-card .label { font-size:12px;color:var(--text-3); }
.toolbar { display:flex;gap:10px;align-items:center;margin-bottom:14px;flex-wrap:wrap; }
.toolbar .input,.toolbar .select { width:auto;min-width:160px; }
.kv { display:grid;grid-template-columns:160px 1fr;gap:10px 16px; }
.kv .k { color:var(--text-3); }
.tabs { display:flex;gap:4px;margin-bottom:14px;flex-wrap:wrap; }
.tabs .tab { padding:7px 16px;border-radius:6px;cursor:pointer;font-size:14px;color:var(--text-2); }
.tabs .tab.active { background:var(--primary);color:#fff; }


.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 4px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px;
  background: #fff; transition: all .15s;
}
.opt:hover { border-color: var(--primary); background: var(--primary-light); }
.opt.sel { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.chat-line { padding: 12px 16px; border-bottom: 1px solid #f2f3f5; }
.chat-line .chat-name { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.form-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.text-3 { color: var(--text-3); }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 22px; font-size: 15px; }


.pos-userpicker { position:relative; }
.pos-userdrop { position:absolute; top:100%; left:0; right:0; margin-top:4px; background:#fff; border:1px solid #e6e8eb; border-radius:10px; box-shadow:0 8px 28px rgba(15,23,42,.12); max-height:280px; overflow-y:auto; z-index:50; }
.pos-useropt { display:flex; align-items:center; gap:8px; padding:9px 12px; cursor:pointer; border-bottom:1px solid #f2f3f5; transition:background .12s; font-size:13px; }
.pos-useropt:hover { background:#f0f6ff; }
.pos-useropt.dim { color:var(--text-3); cursor:default; justify-content:center; }
.pos-tag { background:#ff7a45; color:#fff; font-size:11px; border-radius:4px; padding:1px 6px; font-weight:600; flex-shrink:0; }
.pos-uid { color:var(--text-3); font-size:12px; flex-shrink:0; }
.pos-uname { font-weight:600; color:#1f2329; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pos-uemail { color:var(--text-3); font-size:12px; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right; }


.nav-badge { position:absolute; right:3px; top:3px; transform:none; background:#ff3b30; color:#fff; border-radius:9px; font-size:10.5px; min-width:17px; height:17px; line-height:17px; text-align:center; padding:0 4px; font-weight:700; box-shadow:0 2px 6px rgba(255,59,48,.45); animation:navPulse 1.8s ease-in-out infinite; z-index:5; }
@keyframes navPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
a[data-nav] { position:relative; }


.kf-wrap { display:flex; height:calc(100vh - var(--header-h, 64px) - 24px); min-height:520px; background:#fff; border:1px solid #e6e8eb; border-radius:12px; overflow:hidden; box-shadow:0 4px 24px rgba(15,23,42,.06); }
.kf-side { width:300px; flex-shrink:0; border-right:1px solid #eceef1; display:flex; flex-direction:column; background:#f7f8fa; }
.kf-side-head { padding:14px 16px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #eceef1; background:#fff; }
.kf-side-title { font-size:15px; font-weight:700; color:#1f2329; }
.kf-unread { background:#ff4d4f; color:#fff; border-radius:10px; font-size:11px; min-width:20px; height:20px; line-height:20px; text-align:center; padding:0 6px; font-weight:600; }
.kf-search { padding:10px 12px; border-bottom:1px solid #eceef1; }
.kf-search input { width:100%; height:32px; border:1px solid #e0e3e8; border-radius:16px; padding:0 14px; font-size:13px; background:#fff; outline:none; box-sizing:border-box; transition:border-color .15s; }
.kf-search input:focus { border-color:#1e6fff; }
.kf-list { flex:1; overflow-y:auto; }
.kf-item { display:flex; gap:10px; padding:12px 14px; cursor:pointer; border-bottom:1px solid #f2f3f5; background:#fff; transition:background .15s; }
.kf-item:hover { background:#f0f6ff; }
.kf-item.active { background:#e8f1ff; box-shadow:inset 3px 0 0 #1e6fff; }
.kf-av { width:40px; height:40px; border-radius:50%; background:linear-gradient(135deg,#1e6fff,#4d94ff); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; flex-shrink:0; }
.kf-info { flex:1; min-width:0; }
.kf-name { font-size:14px; font-weight:600; color:#1f2329; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kf-last { font-size:12px; color:#86909c; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.kf-right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.kf-time { font-size:11px; color:#c9cdd4; }
.kf-dot { background:#ff4d4f; color:#fff; border-radius:10px; font-size:11px; min-width:18px; height:18px; line-height:18px; text-align:center; padding:0 5px; font-weight:600; }
.kf-empty { padding:30px 10px; text-align:center; color:#86909c; font-size:13px; }
.kf-main { flex:1; display:flex; flex-direction:column; min-width:0; background:#f5f7fa; }
.kf-main-head { display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid #eceef1; font-weight:600; font-size:15px; background:#fff; }
.kf-online-dot { width:8px; height:8px; border-radius:50%; background:#12b76a; box-shadow:0 0 0 3px rgba(18,183,106,.15); }
.kf-msgs { flex:1; overflow-y:auto; padding:18px 20px; display:flex; flex-direction:column; gap:16px; }
.kf-msg { display:flex; gap:10px; max-width:82%; margin-bottom:14px; }
.kf-msg.mine { margin-left:auto; align-self:flex-end; }
.kf-msg.peer { margin-right:auto; align-self:flex-start; }
.kf-msg-body { min-width:0; }
.kf-msg-name { font-size:12px; color:#86909c; margin-bottom:4px; }
.kf-bubble { padding:9px 13px; border-radius:10px; font-size:14px; line-height:1.55; word-break:break-word; white-space:pre-wrap; }
.kf-msg.peer .kf-bubble { background:#fff; color:#1f2329; border:1px solid #e8eaed; border-top-left-radius:2px; box-shadow:0 1px 2px rgba(0,0,0,.03); }
.kf-msg.mine .kf-bubble { background:linear-gradient(135deg,#1677ff,#4096ff); color:#fff; border-top-right-radius:2px; box-shadow:0 2px 8px rgba(22,119,255,.28); }
.kf-msg.peer .kf-msg-name { color:#1f2329; font-weight:600; }
.kf-av-me { background:linear-gradient(135deg,#ff7a45,#ff9c6e); border:2px solid #fff; box-shadow:0 2px 6px rgba(255,122,69,.35); }
.kf-msg-time { font-size:11px; color:#c9cdd4; margin-top:4px; }
.kf-msg.mine .kf-msg-time { text-align:right; }
.kf-welcome { margin:auto; text-align:center; color:#86909c; font-size:14px; }
.kf-welcome-ico { font-size:40px; margin-bottom:8px; }
.kf-input { border-top:1px solid #eceef1; padding:12px 16px; background:#fff; }
.kf-input textarea { width:100%; height:64px; border:1px solid #e0e3e8; border-radius:8px; padding:10px 12px; font-size:14px; resize:none; outline:none; font-family:inherit; box-sizing:border-box; transition:border-color .15s; }
.kf-input textarea:focus { border-color:#1e6fff; }
.kf-input-bar { display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.kf-tips { font-size:12px; color:#c9cdd4; }
.kf-send { background:linear-gradient(135deg,#1e6fff,#3b82ff); color:#fff; border:none; border-radius:6px; padding:7px 22px; font-size:14px; cursor:pointer; transition:opacity .15s; }
.kf-send:hover { opacity:.9; }
@media (max-width: 900px) {
  .kf-wrap { flex-direction:column; height:auto; min-height:0; }
  .kf-side { width:100%; border-right:none; border-bottom:1px solid #eceef1; max-height:280px; }
  .kf-main { min-height:420px; }
}


.admin-side .menu .m-group.flat > a {
  display:flex;align-items:center;gap:10px;padding:11px 20px;color:#d0d5dd;font-size:14px;
  border-left:3px solid transparent;text-decoration:none;transition:background .15s,color .15s;
}
.admin-side .menu .m-group.flat > a:hover { background:rgba(255,255,255,.05); color:#fff; }
.admin-side .menu .m-group.flat > a.active { background:var(--primary); color:#fff; border-left-color:#fff; }
.admin-side .menu .m-group.flat > a .ico { width:22px;text-align:center;font-size:17px; }


.card.prod-form { max-width:none !important; width:100%; }
.prod-form .form-item { margin-bottom:16px; }
.prod-form .form-item > label { display:block; font-size:13px; color:#4b5563; margin-bottom:6px; font-weight:600; }
.prod-form .form-item > label.required::after { content:' *'; color:#f43f5e; }
.prod-form .form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px 24px; }
@media (max-width:900px){ .prod-form .form-row { grid-template-columns:1fr; } }
.editor-tb { border:1px solid #dde1e8; border-bottom:0; border-radius:6px 6px 0 0; background:#f7f8fa; padding:6px 8px; display:flex; flex-wrap:wrap; gap:4px; }
.editor-tb button { border:1px solid #e2e6ec; background:#fff; border-radius:4px; min-width:28px; height:28px; padding:0 8px; font-size:13px; cursor:pointer; color:#333; line-height:1; transition:all .15s; }
.editor-tb button:hover { border-color:var(--primary); color:var(--primary); }
.editor-box { border:1px solid #dde1e8; border-radius:0 0 6px 6px; min-height:220px; max-height:480px; padding:10px 12px; font-size:14px; line-height:1.65; background:#fff; outline:none; overflow-y:auto; }
.editor-box:focus { border-color:var(--primary); }
.editor-box img { max-width:100%; border-radius:4px; }
.editor-box a { color:var(--primary); }


.af-sec { border:1px solid #e5e8ee; border-radius:10px; padding:16px 18px; margin-bottom:14px; background:#fbfcfe; }
.af-sec-title { font-size:15px; font-weight:700; color:#1f2329; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid #eef1f5; }
.af-sec .form-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media (max-width:900px){ .af-sec .form-row { grid-template-columns:1fr; } }
.af-note { font-size:12px; color:#98a2b3; background:#f8fafc; border:1px dashed #dde1e8; border-radius:8px; padding:10px 12px; margin-bottom:14px; }
