/* ============================================================
   轻随记 - 管理后台样式（晴空蓝主题，与前台一致）
   ============================================================ */
:root {
    --p: #087eb9;
    --p-dark: #007ab7;
    --p-light: #e1f0f9;
    --accent: #dd137b;
    --text: #24333f;
    --muted: #8496a5;
    --border: #dce9f2;
    --bg: #f2f6fa;
    --card: #fff;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(8, 126, 185, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body, body.login-body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65;
}
a { color: var(--p-dark); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }

/* ---------------- 布局 ---------------- */
.admin-body { display: flex; min-height: 100vh; }
.a-side {
    width: 200px; flex: 0 0 200px; background: #12283a; color: #b9cbda;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.a-brand { display: flex; align-items: baseline; gap: 8px; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.a-brand b { color: #fff; font-size: 18px; }
.a-brand em { font-style: normal; font-size: 12px; color: #6f8ba1; }
.a-badge {
    width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--p), #3aa5d8);
    color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
    align-self: center; flex: 0 0 26px;
}
.a-nav { flex: 1; padding: 10px 0; }
.a-nav a { display: block; padding: 9px 20px; color: #b9cbda; font-size: 14.5px; border-left: 3px solid transparent; transition: all .15s; }
.a-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.a-nav a.on { background: rgba(8,126,185,.28); color: #fff; border-left-color: var(--p); }
.a-group { padding: 12px 20px 4px; font-size: 12px; color: #5f7d95; letter-spacing: 2px; }
.a-side-foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; font-size: 13.5px; }
.a-side-foot a { color: #8fb3cc; }

.a-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-topbar {
    background: #fff; padding: 14px 26px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.a-topbar h1 { font-size: 18px; }
.a-user { color: var(--muted); font-size: 14px; }
.a-content { flex: 1; padding: 22px 26px; }
.a-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }

/* ---------------- 卡片 / 表格 ---------------- */
.a-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.a-card h2 { font-size: 16.5px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.a-card h2 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }

table.a-table { width: 100%; border-collapse: collapse; }
.a-table th, .a-table td { padding: 10px 10px; border-bottom: 1px solid #eef4f9; text-align: left; font-size: 14.5px; vertical-align: middle; }
.a-table th { color: #66809a; font-weight: 600; font-size: 13.5px; background: #f8fbfd; white-space: nowrap; }
.a-table tr:hover td { background: #f8fbfd; }
.a-table .t-cover { width: 76px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.a-table .ops { white-space: nowrap; }
.a-table .ops a, .a-table .ops button { margin-right: 8px; font-size: 13.5px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.badge.blue { background: var(--p-light); color: var(--p-dark); }
.badge.pink { background: #fbe4f1; color: var(--accent); }
.badge.green { background: #e5f6ef; color: #12805c; }
.badge.gray { background: #eef2f6; color: #6b7f92; }
.badge.orange { background: #fff3e0; color: #b06b0a; }
.badge.red { background: #fdecec; color: #c0392b; }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
    font-size: 14.5px; font-family: inherit; color: var(--text); background: #fbfdfe; outline: none;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--p); background: #fff; }
textarea { min-height: 80px; resize: vertical; }
label.f-label { display: block; font-size: 14px; color: #4c637a; margin: 14px 0 6px; font-weight: 600; }
label.f-label:first-child { margin-top: 0; }
label.f-label small { font-weight: 400; color: var(--muted); }
.f-row { display: flex; gap: 12px; }
.f-row > * { flex: 1; }
.f-inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; margin-right: 16px; cursor: pointer; }
.f-inline-check input { width: auto; }
.f-tip { font-size: 13px; color: var(--muted); margin-top: 5px; }

.btn {
    display: inline-block; background: var(--p); color: #fff; border: none; cursor: pointer;
    padding: 8px 20px; border-radius: 9px; font-size: 14.5px; font-family: inherit; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--p-dark); color: #fff; }
.btn:active { transform: scale(.98); }
.btn.plain { background: var(--p-light); color: var(--p-dark); }
.btn.plain:hover { background: #d3e9f7; }
.btn.danger { background: #e74c3c; }
.btn.danger:hover { background: #c0392b; }
.btn.sm { padding: 4px 12px; font-size: 13.5px; border-radius: 7px; }
.btn.block { display: block; width: 100%; text-align: center; }

/* ---------------- 仪表盘统计 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
    border-top: 3px solid var(--p);
}
.stat-card b { font-size: 27px; font-family: Georgia, "Noto Serif SC", serif; }
.stat-card span { color: var(--muted); font-size: 13.5px; }
.stat-card.pink { border-top-color: var(--accent); }
.stat-card.pink b { color: var(--accent); }
.stat-card b { color: var(--p-dark); }
.stat-card a { font-size: 13px; color: var(--muted); }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }

/* ---------------- Tabs ---------------- */
.a-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.a-tabs a {
    padding: 6px 16px; border-radius: 999px; background: #fff; color: #556b7e;
    border: 1px solid var(--border); font-size: 14px;
}
.a-tabs a.on { background: var(--p); border-color: var(--p); color: #fff; }
.a-tabs a .n { opacity: .75; margin-left: 3px; font-size: 13px; }

/* ---------------- 分页 ---------------- */
.a-pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.a-pager a, .a-pager span { padding: 5px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--border); font-size: 14px; color: #556b7e; }
.a-pager span.on { background: var(--p); border-color: var(--p); color: #fff; }

/* ---------------- 图片预览 ---------------- */
.img-prev { margin-top: 8px; }
.img-prev img { max-height: 130px; border-radius: 10px; border: 1px solid var(--border); }
.spec-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.spec-row input { flex: 1; }
.spec-row .w-name { flex: 2; }
.spec-row .w-price, .spec-row .w-stock { flex: 1; }
.spec-row button { flex: 0 0 auto; }

/* ---------------- 登录页 ---------------- */
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, #dfeef8 0%, #f4e9f2 100%); }
.login-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(8, 60, 100, .16); padding: 34px 36px 26px; width: 360px; max-width: 92vw; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-brand .a-badge { width: 38px; height: 38px; flex-basis: 38px; font-size: 19px; border-radius: 11px; }
.login-brand b { font-size: 21px; color: #1f2d3a; }
.login-brand em { font-style: normal; color: var(--muted); font-size: 13px; margin-left: auto; }
.login-card input { margin-bottom: 14px; }
.login-card button {
    width: 100%; padding: 11px 0; font-size: 16px; letter-spacing: 6px;
    background: linear-gradient(135deg, var(--p), #2f97cf); color: #fff; border: none; border-radius: 9px; cursor: pointer;
    transition: background .15s;
}
.login-card button:hover { background: var(--p-dark); }
.login-err { background: #fdecec; color: #c0392b; border-radius: 9px; padding: 9px 14px; font-size: 14px; margin-bottom: 14px; }
.login-tip { font-size: 13px; color: var(--muted); margin-top: 14px; text-align: center; }
.login-back { text-align: center; margin-top: 8px; font-size: 13.5px; }

/* ---------------- 留言/评论管理 ---------------- */
.gb-admin-item { border-bottom: 1px dashed var(--border); padding: 14px 2px; }
.gb-admin-item:last-child { border-bottom: none; }
.gb-admin-item .g-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gb-admin-item .g-head b { font-size: 15px; }
.gb-admin-item .g-head time, .gb-admin-item .g-head span { color: var(--muted); font-size: 13px; }
.gb-admin-item .g-content { margin: 6px 0; font-size: 14.5px; word-break: break-word; }
.gb-admin-item .g-reply { background: var(--p-light); border-radius: 9px; padding: 10px 14px; margin: 8px 0; font-size: 14.5px; }
.gb-admin-item .g-ops { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reply-box { display: none; margin-top: 10px; }
.reply-box.open { display: block; }
.reply-box textarea { min-height: 64px; }
.reply-box .btn { margin-top: 8px; }

/* wangEditor 容器 */
#we-editor { border: 1px solid var(--border); border-radius: 10px; background: #fff; z-index: 10; }
#we-editor .w-e-text-container { background: #fff; z-index: 10; }

/* toast */
.a-toast {
    position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
    background: rgba(21, 38, 53, .92); color: #fff; font-size: 15px;
    padding: 11px 22px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
    opacity: 0; transition: all .3s; z-index: 999; max-width: 86vw; text-align: center;
}
.a-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.a-toast.err { background: rgba(190, 60, 60, .95); }

/* 响应式 */
@media (max-width: 860px) {
    .a-side { position: fixed; left: -200px; z-index: 100; transition: left .25s; }
    .a-side.open { left: 0; }
    .admin-body.side-open::before {
        content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 90;
    }
    .a-content { padding: 14px; }
    .f-row { flex-direction: column; gap: 0; }
    .a-table { font-size: 13.5px; }
}
.a-menu-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
@media (max-width: 860px) { .a-menu-btn { display: block; } }
