/* ==========================================================================
   颜值研究所 · 管理后台样式（本地资源，无任何外网 CDN 依赖）
   ========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f7f5fb;
    color: #4a4257;
    font-size: 14px;
}
a { color: #ff7eb3; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 210px;
    background: linear-gradient(160deg, #ffd6ec 0%, #d9e4ff 100%);
    color: #5b4b6e;
    padding: 18px 0;
    flex-shrink: 0;
}
.sidebar .logo {
    font-size: 18px; font-weight: 700; text-align: center;
    margin-bottom: 22px; color: #ff5fa2; letter-spacing: 1px;
}
.sidebar .logo small { display: block; font-size: 11px; color: #9b8aa8; font-weight: 400; margin-top: 4px; }
.sidebar a {
    display: block; padding: 11px 22px; color: #5b4b6e; font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(255,255,255,.45); text-decoration: none; }
.sidebar a.active { background: rgba(255,255,255,.75); border-left-color: #ff5fa2; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 54px; background: #fff; border-bottom: 1px solid #eeeaf3;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { font-size: 13px; color: #8a7d99; }
.topbar .user b { color: #ff5fa2; }
.content { padding: 20px 22px; flex: 1; overflow-x: auto; }

/* ---------- 组件 ---------- */
.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(120,100,150,.06); margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; color: #5b4b6e; }

.btn {
    display: inline-block; padding: 7px 14px; border-radius: 8px; border: none;
    background: #ff7eb3; color: #fff; cursor: pointer; font-size: 13px; line-height: 1.4;
}
.btn:hover { background: #ff5fa2; }
.btn.ghost { background: #fff; color: #ff5fa2; border: 1px solid #ffc4dd; }
.btn.ghost:hover { background: #fff3f9; }
.btn.gray { background: #eceaf3; color: #6b6178; }
.btn.gray:hover { background: #dedbe8; }
.btn.danger { background: #ff6b6b; }
.btn.danger:hover { background: #f45050; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #f0edf6; text-align: left; vertical-align: middle; }
th { background: #faf8fd; color: #7c6f8c; font-weight: 600; }
tr:hover td { background: #fcfbfe; }
td .nowrap { white-space: nowrap; }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.form-row label { width: 92px; color: #7c6f8c; font-size: 13px; text-align: right; }
input[type=text], input[type=password], input[type=number], select, textarea {
    padding: 7px 10px; border: 1px solid #e5e0ee; border-radius: 8px; font-size: 13px;
    outline: none; color: #4a4257; background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: #ffb3d4; }
input.w200 { width: 200px; }
input.w300 { width: 300px; }
textarea { width: 100%; min-height: 130px; resize: vertical; line-height: 1.7; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #f0eaff; color: #8b6fc0; }
.tag.on { background: #e4f8ee; color: #26a269; }
.tag.off { background: #fdeaea; color: #d9534f; }

.tips { background: #fff8e6; border-left: 3px solid #ffc857; padding: 10px 14px; border-radius: 6px; font-size: 12px; color: #8a6d3b; margin-bottom: 14px; line-height: 1.7; }
.disclaimer-bar { text-align: center; font-size: 12px; color: #a99db5; padding: 12px 0 20px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: #8a7d99; }
.empty { text-align: center; color: #b3a9c0; padding: 30px 0; font-size: 13px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat-box { background: linear-gradient(135deg, #ffe3f1, #e7ecff); border-radius: 12px; padding: 16px; }
.stat-box .num { font-size: 24px; font-weight: 700; color: #ff5fa2; }
.stat-box .lab { font-size: 12px; color: #8a7d99; margin-top: 4px; }

/* 登录页 */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #ffd6ec 0%, #d9e4ff 60%, #e6f9f1 100%);
}
.login-box {
    width: 340px; background: #fff; border-radius: 16px; padding: 30px 28px;
    box-shadow: 0 10px 30px rgba(150,120,180,.15);
}
.login-box h2 { margin: 0 0 6px; text-align: center; color: #ff5fa2; }
.login-box .sub { text-align: center; font-size: 12px; color: #a99db5; margin-bottom: 20px; }
.login-box .field { margin-bottom: 12px; }
.login-box input { width: 100%; }
.login-box .btn { width: 100%; padding: 10px; font-size: 15px; margin-top: 6px; }
.login-box .foot { text-align: center; font-size: 12px; color: #b3a9c0; margin-top: 16px; line-height: 1.6; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(60,45,75,.35); display: flex;
    align-items: center; justify-content: center; z-index: 999;
}
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 520px; max-width: 92vw; max-height: 86vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; font-size: 15px; }
.modal .foot { text-align: right; margin-top: 16px; }

/* Toast */
#yz-toast {
    position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
    background: rgba(60,45,75,.9); color: #fff; padding: 9px 18px; border-radius: 20px;
    font-size: 13px; z-index: 9999; display: none;
}

@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar .logo small { display: none; }
    .sidebar a { padding: 11px 10px; text-align: center; font-size: 12px; }
    .content { padding: 14px; }
}

/* ==========================================================================
   协议文档编辑页（用户协议 / 隐私政策）
   ========================================================================== */
.tips-box { background:#fff8e6; border:1px solid #ffe3a8; color:#8a6d3b; border-radius:10px;
    padding:12px 14px; font-size:13px; line-height:1.9; margin-bottom:14px; }
.tips-box code { background:#fff; border:1px solid #ffe3a8; border-radius:4px; padding:0 4px; }
.panel { background:#fff; border-radius:12px; padding:16px; box-shadow:0 2px 10px rgba(120,100,150,.06); margin-bottom:16px; }
.panel-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; flex-wrap:wrap; gap:10px; }
.tabs { display:flex; gap:8px; }
.tab-item { padding:6px 16px; border-radius:20px; background:#f3eef9; color:#7c6f8c; cursor:pointer; font-size:13px; }
.tab-item.on { background:linear-gradient(120deg,#ff9ec4,#b79cff); color:#fff; }
.btn-sm { padding:6px 14px; border:none; border-radius:8px; background:#f3eef9; color:#7c6f8c; cursor:pointer; font-size:13px; }
.btn-sm.primary { background:linear-gradient(120deg,#ff8fb8,#9d7bff); color:#fff; }
textarea.w-full { width:100%; box-sizing:border-box; border:1px solid #e6dfef; border-radius:8px;
    padding:10px; font-size:13px; line-height:1.9; font-family:inherit; resize:vertical; }
.form-row .mini, .mini { font-size:12px; color:#a99db5; }
input.w300 { width:300px; }
.doc-preview { max-height:560px; overflow:auto; background:#fdfcff; border:1px solid #efe8f7;
    border-radius:10px; padding:16px 18px; font-size:13px; line-height:2; color:#5b4b6e; }
.doc-preview h4 { margin:0 0 12px; font-size:16px; color:#ff5fa2; }
.doc-preview p { margin:0 0 10px; }
