/* ============================================================
   账号中心 · 全站样式
   浅色系中式简约美学：宣纸底、墨色字、青玉主色、朱砂点缀
   ============================================================ */
:root {
    --bg: #f6f4ee;
    --card: #ffffff;
    --ink: #2f3437;
    --muted: #98a09a;
    --jade: #5f8c7b;
    --jade-d: #49715f;
    --accent: #c05b4d;
    --line: #e9e5da;
    --shadow: 0 12px 36px rgba(75, 80, 70, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--jade-d); }

/* ---------- 登录 / 注册 / 忘记密码 公共布局 ---------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(1100px 560px at 85% -10%, #edf2ec 0%, transparent 60%),
        radial-gradient(900px 500px at 0% 110%, #f2eee3 0%, transparent 55%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 38px 32px 28px;
    animation: rise .5s ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* 品牌区 */
.brand { text-align: center; margin-bottom: 26px; }
.seal {
    width: 52px; height: 52px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c05b4d, #a8493d);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 26px;
    box-shadow: 0 6px 16px rgba(192, 91, 77, .28);
    transform: rotate(-3deg);
    user-select: none;
}
.brand-name {
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 22px; font-weight: 600;
    letter-spacing: 6px;
}
.brand-sub { margin-top: 8px; color: var(--muted); font-size: 12.5px; letter-spacing: 2px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #6b726c; margin-bottom: 7px; }
.field input {
    width: 100%; height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    background: #fcfbf8;
    color: var(--ink);
    outline: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.field input:focus {
    border-color: var(--jade);
    box-shadow: 0 0 0 3px rgba(95, 140, 123, .15);
    background: #fff;
}
.field.error input { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192, 91, 77, .10); }
.err-text { display: none; font-size: 12px; color: var(--accent); margin-top: 6px; }
.field.error .err-text { display: block; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }

/* 按钮 */
.btn {
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--jade);
    color: #fff;
    font-size: 15px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { background: var(--jade-d); box-shadow: 0 8px 20px rgba(95, 140, 123, .30); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; margin-top: 8px; }

/* 链接行 */
.link-row { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; }
.link-row a { text-decoration: none; }
.link-row a:hover { text-decoration: underline; }
.admin-entry { display: block; text-align: center; margin-top: 24px; font-size: 12px; color: var(--muted); text-decoration: none; transition: color .2s; }
.admin-entry:hover { color: var(--jade-d); }

/* 验证码输入行 */
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; }
.btn-code {
    flex: none; width: 126px; height: 44px;
    border-radius: 10px;
    border: 1px solid var(--jade);
    background: #fff;
    color: var(--jade-d);
    font-size: 13px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.btn-code:hover:not(:disabled) { background: var(--jade); color: #fff; }
.btn-code:disabled { color: var(--muted); border-color: var(--line); background: #f5f3ec; cursor: not-allowed; }

/* ---------- 滑块人机验证 ---------- */
.slider-captcha {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fcfbf8;
}
.cap-canvas-wrap { position: relative; }
.cap-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.cap-refresh {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px;
    border: none; border-radius: 8px;
    background: rgba(255, 255, 255, .88);
    color: #6b726c; font-size: 15px;
    cursor: pointer;
    transition: transform .2s;
}
.cap-refresh:hover { transform: rotate(60deg); }
.slider-track { position: relative; height: 42px; border-top: 1px solid var(--line); background: #f7f5ef; }
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(95, 140, 123, .18); }
.slider-btn {
    position: absolute; left: 0; top: 1px;
    width: 46px; height: 40px;
    border-radius: 9px;
    background: var(--jade);
    color: #fff; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(95, 140, 123, .35);
}
.slider-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; color: var(--muted);
    pointer-events: none;
}
.slider-captcha.passed .slider-fill { background: rgba(95, 140, 123, .28); }
.slider-captcha.passed .slider-btn { background: var(--jade-d); }
.shake { animation: shake .35s; }
@keyframes shake {
    20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

/* ---------- Toast 轻提示 ---------- */
.toast-wrap {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    display: flex; flex-direction: column; gap: 10px; align-items: center;
    pointer-events: none;
}
.toast {
    padding: 10px 22px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    animation: toastIn .3s ease;
    max-width: 86vw;
}
.toast.success { border-color: rgba(95, 140, 123, .45); color: var(--jade-d); }
.toast.error   { border-color: rgba(192, 91, 77, .45);  color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* 已登录提示 */
.logged-tip {
    background: #f3f6f2;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 13.5px;
    margin-bottom: 16px;
    text-align: center;
}
.link-quiet { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.link-quiet:hover { color: var(--jade-d); }

/* ---------- 后台管理（侧边栏布局） ---------- */
.admin-layout { display: flex; min-height: 100vh; }

/* 左侧边栏 */
.admin-sidebar {
    flex: none;
    width: 230px;
    background: linear-gradient(180deg, #2f3437 0%, #3a4045 100%);
    color: #c8ccc6;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease;
}

/* 品牌区 */
.sidebar-brand {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex: none;
}
.sidebar-brand .seal {
    margin: 0;
    width: 38px; height: 38px;
    font-size: 18px;
    border-radius: 9px;
    transform: rotate(-3deg);
    flex: none;
}
.sidebar-brand-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-brand-text { font-family: "Songti SC","STSong","SimSun",serif; font-size: 16px; letter-spacing: 3px; color: #fff; line-height: 1.2; }
.sidebar-brand-sub { font-size: 9.5px; color: #7a807a; letter-spacing: 2px; line-height: 1.2; }

/* 导航菜单 */
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-nav .nav-label {
    font-size: 10px; color: #6a706a;
    letter-spacing: 2px;
    padding: 14px 12px 6px;
    text-transform: uppercase;
}
.sidebar-nav .nav-label:first-child { padding-top: 4px; }
.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    color: #b8bcb6;
    text-decoration: none;
    transition: background .2s, color .2s;
    margin-bottom: 3px;
    overflow: hidden;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(95,140,123,.25); color: #fff; }
.sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    border-radius: 0 2px 2px 0;
    background: var(--jade);
}
.sidebar-nav .nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: .7; flex: none; }
.sidebar-nav a.active .nav-icon { opacity: 1; }

/* 底部用户区 */
.sidebar-foot {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex: none;
}
.sidebar-foot .admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sidebar-foot .admin-user .seal { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; margin: 0; flex: none; }
.sidebar-foot .admin-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar-foot .admin-user-info .au-name { color: #d8dcd6; font-size: 13px; line-height: 1.3; }
.sidebar-foot .admin-user-info .au-role { color: #7a807a; font-size: 11px; line-height: 1.3; }
.sidebar-foot .logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #7a807a;
    font-size: 12.5px;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.sidebar-foot .logout-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-foot .logout-link .nav-icon { width: 16px; text-align: center; font-size: 14px; }

/* 移动端汉堡按钮 */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 101;
    width: 40px; height: 40px;
    border: none; border-radius: 10px;
    background: #2f3437;
    color: #fff; font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

/* 右侧主区域 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-content-header {
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 16px 28px;
}
.admin-content-header h1 {
    font-size: 18px; font-weight: 600; color: var(--ink);
    font-family: "Songti SC","STSong","SimSun",serif; letter-spacing: 2px;
}
.admin-content-header .breadcrumb { font-size: 12px; color: var(--muted); margin-top: 2px; }

.admin-wrap {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 60px;
    display: grid;
    gap: 18px;
    animation: rise .4s ease both;
}
.panel { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.panel h2 { font-size: 15.5px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--jade); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card {
    background: linear-gradient(135deg, #f3f6f2, #edf3ee);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--jade-d); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.url-row { display: flex; gap: 10px; flex-wrap: wrap; }
.url-row input {
    flex: 1; min-width: 220px; height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    background: #fcfbf8;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.url-row input:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(95, 140, 123, .15); background: #fff; }
.btn-save { padding: 0 24px; letter-spacing: 2px; }
.tip-soft { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.8; }

.info-list { list-style: none; }
.info-list li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}
.info-list li:last-child { border-bottom: none; }
.info-list li span { color: var(--muted); flex: none; }
.info-list li b { font-weight: 500; word-break: break-all; text-align: right; }

/* 用户列表表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #faf8f2; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: #faf9f4; }
.empty-row td { text-align: center; color: var(--muted); padding: 36px 0; }

.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 6px 13px;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-size: 13px;
    color: #6b726c;
    text-decoration: none;
}
.pager a:hover { border-color: var(--jade); color: var(--jade-d); }
.pager span { background: var(--jade); color: #fff; border-color: var(--jade); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 480px) {
    .auth-card { padding: 30px 22px 24px; border-radius: 16px; }
    .btn-code { width: 110px; font-size: 12.5px; }
    .modal-card { width: calc(100vw - 32px); padding: 24px 20px; }
}
@media (max-width: 768px) {
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .admin-sidebar {
        position: fixed;
        left: 0; top: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0,0,0,.15);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content-header { padding: 14px 16px 14px 64px; }
    .admin-wrap { padding: 16px 16px 48px; }
    .panel { padding: 18px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .search-box { max-width: none; }
    .toolbar .btn { width: 100%; }
    .act-btns { flex-direction: column; }
    th, td { padding: 10px 8px; font-size: 12px; }
}

/* ============================================================
   v2 新增样式：徽标、操作按钮、弹窗、表单组件
   ============================================================ */

/* 角色与状态徽标 */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 1.6;
}
.badge-admin  { background: rgba(95,140,123,.14); color: var(--jade-d); }
.badge-user   { background: rgba(152,160,154,.16); color: #6b726c; }
.badge-normal { background: rgba(95,140,123,.12); color: var(--jade-d); }
.badge-banned { background: rgba(192,91,77,.12);  color: var(--accent); }

/* 操作按钮 */
.act-btns { display: flex; gap: 6px; flex-wrap: nowrap; }
.act-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: #6b726c;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.act-btn:hover { border-color: var(--jade); color: var(--jade-d); background: #f6f9f5; }
.act-btn.danger:hover { border-color: var(--accent); color: var(--accent); background: #fdf5f3; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .btn { height: 40px; padding: 0 20px; }
.search-box {
    height: 40px; flex: 1; max-width: 260px; min-width: 160px;
    border: 1px solid var(--line); border-radius: 10px;
    padding: 0 14px; font-size: 13.5px;
    background: #fcfbf8; outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.search-box:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(95,140,123,.15); background: #fff; }

/* 弹窗（Modal） */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(47,52,55,.32);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-card {
    width: 440px; max-width: 90vw;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(47,52,55,.20);
    padding: 32px 28px 24px;
    transform: translateY(12px) scale(.98);
    transition: transform .25s;
}
.modal-overlay.show .modal-card { transform: none; }
.modal-title {
    font-size: 17px; font-weight: 600; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.modal-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--jade); }

/* 表单选择器（Select） */
.field select {
    width: 100%; height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    background: #fcfbf8;
    color: var(--ink);
    outline: none;
    cursor: pointer;
    transition: border-color .25s, box-shadow .25s;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2398a09a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}
.field select:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(95,140,123,.15); background-color: #fff; }

/* 单选/复选开关 */
.field-switch {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px;
}
.field-switch input[type=checkbox] {
    width: 18px; height: 18px;
    accent-color: var(--jade);
    cursor: pointer;
}
.field-switch label { font-size: 13.5px; color: #6b726c; cursor: pointer; }

/* 弹窗底部按钮行 */
.modal-foot { display: flex; gap: 10px; margin-top: 22px; }
.modal-foot .btn { flex: 1; }
.btn-ghost {
    background: #fff;
    color: #6b726c;
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: #f5f3ec; box-shadow: none; transform: none; }

/* 跳转信息小标签 */
.redirect-info {
    font-size: 12px; color: var(--muted);
    margin-top: 4px; max-width: 200px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.redirect-info.has-custom { color: var(--jade-d); }
