/* 支付权益系统 - 管理后台样式 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f7; color: #333; font-size: 14px;
}
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }
code { background: #f0f0f5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.flex-spacer { flex: 1; }

/* ==================== 布局 ==================== */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side { width: 210px; background: #252836; color: #aab; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-logo { display: flex; align-items: center; gap: 8px; padding: 20px 18px; color: #fff; font-size: 15px; font-weight: 600; }
.side-logo-icon { display: flex; color: #8f82f8; }
.side-menu { padding: 8px 0; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #9aa0b5; font-size: 14px; }
.side-item:hover { color: #fff; }
.side-item.active { background: #6C5CE7; color: #fff; }
.side-icon { display: flex; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: 0 1px 4px rgba(0, 0, 0, .05); position: sticky; top: 0; z-index: 50; }
.top-title { font-size: 16px; font-weight: 600; }
.top-user { font-size: 13px; color: #666; display: flex; gap: 14px; }
.top-user a { color: #6C5CE7; }
.admin-body { padding: 20px 24px; flex: 1; }

/* ==================== 登录 ==================== */
.login-body { background: linear-gradient(135deg, #534AB8, #6C5CE7); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border-radius: 16px; padding: 44px 40px; width: 380px; box-shadow: 0 16px 48px rgba(0, 0, 0, .22); }
.login-logo { color: #6C5CE7; display: flex; justify-content: center; margin-bottom: 14px; }
.login-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 30px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }

/* ==================== 通用组件 ==================== */
.btn-main {
    display: inline-block; background: #6C5CE7; color: #fff; border: none;
    border-radius: 8px; padding: 9px 20px; font-size: 14px; cursor: pointer;
}
.btn-main:hover { background: #5d4dd8; }
.btn-ghost {
    display: inline-block; background: #fff; color: #555; border: 1px solid #dcdfe6;
    border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { color: #6C5CE7; border-color: #c9c2f0; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 12px 40px; font-size: 15px; }
.btn-loading { opacity: .6; pointer-events: none; }
.btn-link { border: none; background: none; color: #6C5CE7; font-size: 13px; cursor: pointer; padding: 2px 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #e54d42; }

.input-admin {
    border: 1px solid #dcdfe6; border-radius: 8px; padding: 9px 12px; font-size: 14px;
    outline: none; background: #fff; color: #333; font-family: inherit;
}
.input-admin:focus { border-color: #6C5CE7; }
textarea.input-admin { resize: vertical; line-height: 1.6; }

/* Toast / 确认框（与移动端同实现） */
.app-toast {
    position: fixed; left: 50%; top: 36px; transform: translateX(-50%);
    background: rgba(30, 30, 40, .9); color: #fff; padding: 10px 22px;
    border-radius: 8px; font-size: 14px; z-index: 9999; max-width: 60%;
    text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.app-toast.show { opacity: 1; }
.app-confirm-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.app-confirm { background: #fff; border-radius: 12px; width: 340px; overflow: hidden; }
.ac-msg { padding: 26px 24px; font-size: 14px; text-align: center; line-height: 1.7; }
.ac-btns { display: flex; border-top: 1px solid #f0f0f0; }
.ac-btn { flex: 1; border: none; background: #fff; padding: 13px 0; font-size: 14px; cursor: pointer; }
.ac-cancel { color: #888; border-right: 1px solid #f0f0f0; }
.ac-ok { color: #6C5CE7; font-weight: 600; }

/* ==================== 面板 / 工具条 / 表格 ==================== */
.panel { background: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: #888; font-weight: 500; padding: 10px 8px; border-bottom: 1px solid #eee; white-space: nowrap; }
.table td { padding: 11px 8px; border-bottom: 1px solid #f5f5f7; vertical-align: middle; }
.table tr:hover td { background: #fafaff; }

.tag { display: inline-block; font-size: 12px; border-radius: 10px; padding: 2px 10px; }
.tag-ok { background: #e7f8ef; color: #16b978; }
.tag-wait { background: #fff5e6; color: #e8930c; }
.tag-confirm { background: #e8f4ff; color: #2b8ce6; }
.tag-fail { background: #fdecec; color: #e54d42; }
.tag-theme-blue { background: #e8efff; color: #3E6BD6; }
.tag-theme-gold { background: #fdf3e0; color: #C98F2B; }
.tag-theme-black { background: #ececf0; color: #3a3a44; }
.tag-theme-gray { background: #f0f0f3; color: #888; }

.text-muted { color: #aaa; font-size: 12px; }
.text-ok { color: #16b978; font-weight: 600; }
.text-fail { color: #e54d42; }

/* ==================== 看板 ==================== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { border-radius: 12px; padding: 18px 20px; color: #fff; }
.sc-purple { background: linear-gradient(135deg, #8577F0, #6C5CE7); }
.sc-blue { background: linear-gradient(135deg, #5B8DEF, #3E6BD6); }
.sc-gold { background: linear-gradient(135deg, #E9B958, #C98F2B); }
.sc-red { background: linear-gradient(135deg, #f0716a, #d64545); }
.stat-label { font-size: 13px; opacity: .9; }
.stat-value { font-size: 26px; font-weight: 700; margin: 8px 0; }
.stat-sub { font-size: 12px; opacity: .85; }
.stat-sub b { font-weight: 600; }

.chart-box-lg { height: 300px; }
.chart-box-lg canvas { width: 100%; height: 300px; display: block; }

/* ==================== 表单 ==================== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-row .input-admin { width: 100%; max-width: 560px; }
.form-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==================== 弹窗 ==================== */
.modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 900; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; width: 480px; max-width: 92%; max-height: 86vh; overflow-y: auto; padding: 22px 24px; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.code-tip { font-size: 13px; color: #666; margin-bottom: 12px; }
.code-show {
    font-size: 28px; font-weight: 700; letter-spacing: 4px; text-align: center;
    color: #6C5CE7; background: #f4f2ff; border-radius: 10px; padding: 18px;
}

.audit-info { background: #f8f8fb; border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.9; margin-bottom: 14px; }

/* ==================== 其他 ==================== */
.settings-tip { background: #fff8e8; color: #8a6d1a; border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px; line-height: 1.8; }
.settings-save { text-align: center; padding: 6px 0 24px; }
.sync-result { margin-top: 12px; background: #f8f8fb; border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.9; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; }

/* 响应式：窄屏侧栏收起 */
@media (max-width: 960px) {
    .admin-wrap { flex-direction: column; }
    .admin-side { width: 100%; height: auto; position: static; }
    .side-menu { display: flex; flex-wrap: wrap; padding: 4px; }
    .side-item { padding: 8px 12px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .admin-body { padding: 14px; overflow-x: auto; }
}
