/* ============ 后台管理样式 ============ */
:root { --sb: #241E19; --sb-active: #B7402F; --primary: #B7402F; --bg: #F7F5F1; --border: #EAE5DD; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC","Microsoft YaHei",sans-serif; background: var(--bg); color: #211C17; font-size: 14px; }
a { text-decoration: none; color: inherit; }
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 230px; background: var(--sb); color: #cbd5e1; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 50; transition: transform .3s; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 20px 22px; border-bottom: 1px solid #352A23; color: #fff; font-weight: 700; font-size: 17px; }
.sidebar .logo img { height: 30px; }
.sidebar-menu { padding: 14px 10px; }
.sidebar-menu .group { font-size: 11px; color: #64748b; letter-spacing: 2px; padding: 14px 14px 6px; }
.sidebar-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px; margin-bottom: 2px; transition: all .2s; }
.sidebar-menu a:hover { background: #352A23; color: #fff; }
.sidebar-menu a.active { background: var(--sb-active); color: #fff; font-weight: 600; }
.sidebar-menu a .badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; }

/* 主区 */
.admin-main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40; }
.topbar .left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }
.content { padding: 26px 28px; flex: 1; }

/* 卡片/表格 */
.panel { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(15,23,42,.05); padding: 24px; margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.wrap { white-space: normal; min-width: 200px; }
th { color: #64748b; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: #f8fafc; }
.table-img { width: 72px; height: 46px; object-fit: cover; border-radius: 8px; }

/* 统计卡 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(15,23,42,.05); display: flex; align-items: center; gap: 16px; }
.stat-card .ic { width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: #FAEFEC; }
.stat-card b { font-size: 26px; display: block; }
.stat-card span { color: #64748b; font-size: 13px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.fg label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.fg input[type=text], .fg input[type=password], .fg input[type=email], .fg input[type=number], .fg input[type=url], .fg input[type=file], .fg select, .fg textarea { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 14px; font-family: inherit; }
.fg textarea { min-height: 110px; resize: vertical; }
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--primary); }
.fg .hint { color: #94a3b8; font-size: 12.5px; margin-top: 4px; }
.fg-cb { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 9px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #96301F; }
.btn-light { background: #eef2f7; color: #334155; }
.btn-light:hover { background: #EAE5DD; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 14px; }

/* 状态标签 */
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-ok { background: #dcfce7; color: #15803d; }
.tag-off { background: #F7F5F1; color: #64748b; }
.tag-hot { background: #fef3c7; color: #b45309; }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 登录页 */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #241E19, #3A2A22 58%, #6B3229); }
.admin-login-card { width: min(400px, 92%); background: #fff; border-radius: 20px; padding: 44px 38px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.admin-login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.admin-login-card .sub { text-align: center; color: #64748b; font-size: 13px; margin-bottom: 28px; }

.toast { position: fixed; top: 20px; right: 20px; z-index: 999; padding: 13px 22px; border-radius: 10px; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: tin .3s; }
.toast.ok { background: #16a34a; } .toast.err { background: #dc2626; }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: block; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

/* ============ v2 SVG 图标版 ============ */
.icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.sidebar .logo { gap: 10px; }
.logo-mark { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,#C0483A,#B7402F); align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.logo-text { font-size: 16px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-menu a { gap: 11px; }
.sidebar-menu a .icon { opacity: .8; }
.sidebar-menu a:hover .icon, .sidebar-menu a.active .icon { opacity: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-name { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 14px; }
.menu-toggle { color: #334155; display: none; align-items: center; }
@media (max-width: 900px) { .menu-toggle { display: inline-flex; } .topbar-right .admin-name, .topbar-right .btn-light { display: none; } }
