/* ==========================================================
 * v2.0 模块样式补充 - 用户中心 / 登录页 / 聊天 / 客服浮窗等
 * 文件: assets/css/user-modules.css
 *
 * 设计风格：毛玻璃 + 微动效，强化层次感
 * 依赖：user.css 提供变量
 * ========================================================== */

/* ====== 毛玻璃通用类 ====== */
.glass {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(91, 108, 255, 0.10);
}

/* ====== 通用工具 ====== */
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.center { text-align: center; }
.ok-text { color: #38a169; font-weight: 500; }
.expired { color: #e53e3e; font-weight: 500; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.link-soft { color: var(--text-3); font-size: 13px; transition: color .2s; }
.link-soft:hover { color: var(--primary); }

/* ====== 通用背景 orbs（多个页面共用） ====== */
.bg-orbs, .auth-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: -1;
    overflow: hidden;
}
.auth-bg .grid-bg, .bg-orbs .grid-bg {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(91,108,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,108,255,0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 100%);
}

/* ============================================================
 * 登录页（page-login）
 * ============================================================ */
.page-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 30px 16px;
}
.auth-page {
    width: 100%; max-width: 460px;
}
.auth-card.glass {
    border-radius: 24px; padding: 36px 32px;
    background: rgba(255,255,255,0.7);
}
.auth-back { margin-bottom: -8px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo {
    width: 64px; height: 64px; margin: 0 auto 14px;
    background: var(--grad);
    border-radius: 18px; display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    box-shadow: 0 10px 30px rgba(91,108,255,.4);
}
.auth-title { font-size: 22px; color: var(--text); margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text-3); }

/* 密码可见切换 */
.input-pwd { position: relative; }
.input-pwd input { padding-right: 40px !important; }
.pwd-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    cursor: pointer; user-select: none;
    font-size: 16px; opacity: .7; transition: opacity .2s;
}
.pwd-toggle:hover { opacity: 1; }

/* 密码匹配提示 */
#pwdMatchTip.ok { color: #38a169; }
#pwdMatchTip.err { color: #e53e3e; }

/* ============================================================
 * 用户中心（page-user）
 * ============================================================ */
.page-user {
    background: var(--grad-bg); min-height: 100vh;
}

.user-top {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid rgba(226,232,240,.5);
}
.user-top-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.user-top .brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; color: var(--text);
}
.user-top-right {
    display: flex; align-items: center; gap: 12px;
}
.online-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #cbd5e0;
    box-shadow: 0 0 0 0 rgba(56,161,105,0); transition: all .3s;
}
.online-dot.online {
    background: #38a169;
    box-shadow: 0 0 0 4px rgba(56,161,105,.15);
    animation: pulse-online 2s infinite;
}
@keyframes pulse-online {
    0%,100% { box-shadow: 0 0 0 4px rgba(56,161,105,.15); }
    50%     { box-shadow: 0 0 0 8px rgba(56,161,105,.05); }
}
.user-greet {
    font-size: 14px; color: var(--text-2);
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: transparent; border-radius: 8px; font-size: 20px;
    color: var(--text-2);
    cursor: pointer;
    transition: background .2s;
}
.side-toggle:hover { background: rgba(91,108,255,.08); color: var(--primary); }

/* 主布局 */
.user-layout {
    max-width: 1280px; margin: 0 auto;
    padding: 24px;
    display: block;          /* v2.0+: 抽屉模式，主区独占整宽 */
    align-items: flex-start;
}

/* 侧栏 - 抽屉模式（所有屏幕尺寸） */
/* 用属性选择器提高优先级 (0,2,0)，确保即使元素被加 data-anim 也不会被 [data-anim].anim-in {transform:none} 覆盖 */
.user-side[id="userSide"] {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    z-index: 95;
    border-radius: 0 18px 18px 0;
    padding: 80px 14px 16px;
    display: flex; flex-direction: column; gap: 6px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.22,1,.36,1);
    box-shadow: 6px 0 30px rgba(91,108,255,0.10);
    /* 强制覆盖 animations.css 的入场动画样式 */
    opacity: 1 !important;
}
body.side-open .user-side[id="userSide"] {
    transform: translateX(0);
}
/* 遮罩 - 用真实元素而非 ::after，方便绑 click */
.side-mask {
    position: fixed; inset: 0; z-index: 88;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
body.side-open .side-mask {
    opacity: 1; visibility: visible;
    transition: opacity .25s ease, visibility 0s linear 0s;
}
.side-nav {
    display: flex; flex-direction: column; gap: 4px;
}
.side-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px;
    color: var(--text-2); font-size: 14px; cursor: pointer;
    transition: all .2s;
}
.side-item .ico { font-size: 18px; width: 22px; text-align: center; }
.side-item:hover { background: rgba(91,108,255,.06); color: var(--primary); }
.side-item.active {
    background: var(--grad); color: #fff;
    box-shadow: 0 6px 18px rgba(91,108,255,.25);
}
.side-item.active .ico { filter: brightness(1.2); }
.side-buy {
    margin-top: 12px;
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px; border-radius: 10px;
    background: linear-gradient(135deg, #ffd166 0%, #ff9f1c 100%);
    color: #fff; font-weight: 600; font-size: 14px;
    box-shadow: 0 4px 14px rgba(255,159,28,.3);
}
.side-buy:hover { transform: translateY(-2px); }

/* 主区 */
.user-main { min-width: 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pane-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.pane-head h2 { font-size: 22px; color: var(--text); }

/* 概览 hero */
.user-hero {
    border-radius: 18px; padding: 24px;
    margin-bottom: 18px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 18px; flex-wrap: wrap;
}
.uh-left { display: flex; align-items: center; gap: 16px; }
.avatar-lg {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    box-shadow: 0 8px 22px rgba(91,108,255,.35);
}
.uh-left h1 { font-size: 22px; color: var(--text); margin-bottom: 4px; }
.badge-online {
    background: rgba(56,161,105,.12); color: #38a169;
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

.info-grid-4 {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-bottom: 18px;
}
.info-grid-4 .info-box {
    border-radius: 14px; padding: 16px;
}
.info-box .lbl { color: var(--text-3); font-size: 13px; margin-bottom: 6px; }
.info-box .val { color: var(--text); font-size: 18px; font-weight: 600; }

.ov-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.ov-card { border-radius: 16px; padding: 20px; }
.ov-card h3 { font-size: 16px; margin-bottom: 14px; color: var(--text); }
.quick-actions {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.qa {
    background: rgba(91,108,255,.06); color: var(--primary);
    border-radius: 12px; padding: 14px 8px;
    font-size: 13px; line-height: 1.4; transition: all .2s;
}
.qa:hover {
    background: var(--grad); color: #fff; transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(91,108,255,.3);
}
.notice-box {
    background: rgba(255,193,7,.08); border-left: 3px solid #ffc107;
    padding: 12px 14px; border-radius: 8px;
    color: var(--text-2); font-size: 13px; line-height: 1.6;
    max-height: 120px; overflow-y: auto;
}

/* 通用表单卡片 */
.form-card {
    border-radius: 18px; padding: 24px;
    margin-bottom: 18px;
}
.form-card .row { margin-bottom: 14px; }
.form-card label {
    display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px;
}
.form-card .input-wrap {
    display: flex; align-items: center; gap: 8px;
    background: rgba(247,250,252,.7);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 0 12px; transition: all .2s;
}
.form-card .input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,108,255,.12);
}
.form-card .input-wrap .ico { font-size: 16px; color: var(--text-3); }
.form-card .input-wrap input,
.form-card .input-wrap select {
    flex: 1; border: 0; background: transparent; padding: 10px 0; font-size: 14px;
    color: var(--text);
}
.form-card textarea {
    width: 100%; resize: vertical;
    background: rgba(247,250,252,.7);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; color: var(--text);
    transition: all .2s;
}
.form-card textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,108,255,.12);
}
.form-row-btns {
    display: flex; gap: 10px; margin-top: 12px;
}
.btn-code {
    background: var(--grad); color: #fff;
    border-radius: 8px; padding: 8px 14px; font-size: 13px;
    white-space: nowrap;
}
.btn-code:disabled {
    background: var(--muted); cursor: not-allowed;
}
.input-group { padding-right: 6px; }
.input-group .btn-code { margin-left: 4px; }

/* 配置文件列表 */
.config-list, .post-list { border-radius: 18px; padding: 6px; min-height: 80px; }
.cfg-item, .post-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-radius: 12px; margin: 6px;
    background: rgba(255,255,255,.4); border: 1px solid rgba(226,232,240,.5);
    transition: all .2s;
}
.cfg-item:hover, .post-item:hover {
    background: rgba(255,255,255,.7); transform: translateX(2px);
}
.cfg-info { display: flex; flex-direction: column; gap: 4px; }
.cfg-name { font-weight: 600; color: var(--text); font-size: 14px; }
.cfg-meta { font-size: 12px; }
.cfg-acts { display: flex; gap: 6px; }
.btn-ghost.red { color: #e53e3e; border-color: rgba(229,62,62,.3); }
.btn-ghost.red:hover { background: rgba(229,62,62,.08); }

/* 发布列表 */
.post-item { flex-direction: column; align-items: flex-start; gap: 8px; }
.post-row1 {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%;
}
.post-row2 { font-size: 12px; }
.post-title { font-weight: 600; font-size: 15px; color: var(--text); }
.post-status {
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.post-status.pending  { background: rgba(255,193,7,.15); color: #d97706; }
.post-status.passed   { background: rgba(56,161,105,.15); color: #38a169; }
.post-status.rejected { background: rgba(229,62,62,.15); color: #e53e3e; }
.reject-reason {
    font-size: 12px; color: #e53e3e;
    background: rgba(229,62,62,.08); padding: 6px 10px; border-radius: 6px;
    width: 100%;
}
.post-content {
    font-size: 13px; color: var(--text-2); line-height: 1.5;
    width: 100%;
}

/* 聊天 */
.chat-box {
    border-radius: 18px; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    height: 540px;
}
.chat-msgs {
    flex: 1; overflow-y: auto; padding: 8px 4px;
    display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
    max-width: 80%; padding: 10px 14px;
    background: rgba(255,255,255,.6);
    border-radius: 14px;
    align-self: flex-start;
}
.chat-msg.me {
    align-self: flex-end;
    background: var(--grad); color: #fff;
}
.chat-meta {
    display: flex; gap: 10px; align-items: center;
    font-size: 11px; color: var(--text-3); margin-bottom: 4px;
}
.chat-msg.me .chat-meta { color: rgba(255,255,255,.85); }
.chat-name { font-weight: 600; }
.chat-text { font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-input {
    display: flex; gap: 8px;
    padding-top: 8px; border-top: 1px solid rgba(226,232,240,.5);
}
.chat-input input {
    flex: 1; padding: 10px 14px; font-size: 14px;
    background: rgba(247,250,252,.7);
    border: 1px solid var(--border); border-radius: 10px;
}
.chat-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,108,255,.12);
}

/* 个人资料 */
.profile-dl {
    display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px;
}
.profile-dl dt { color: var(--text-3); font-size: 13px; padding: 6px 0; }
.profile-dl dd { color: var(--text); padding: 6px 0; word-break: break-all; font-size: 14px; }
.profile-dl code {
    background: rgba(247,250,252,.7); padding: 2px 6px; border-radius: 4px;
    font-size: 12px;
}

/* 客服浮窗 */
.cs-float {
    position: fixed; right: 20px; bottom: 24px; z-index: 60;
}
.cs-toggle {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--grad); color: #fff; font-size: 26px;
    box-shadow: 0 10px 30px rgba(91,108,255,.4);
    transition: all .3s;
}
.cs-toggle:hover { transform: scale(1.08) rotate(-8deg); }
.cs-panel {
    position: absolute; right: 0; bottom: 70px;
    width: 300px; background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 16px; padding: 14px;
    box-shadow: 0 20px 60px rgba(91,108,255,.2);
    opacity: 0; pointer-events: none; transform: translateY(10px) scale(.96);
    transition: all .25s;
}
.cs-panel.open {
    opacity: 1; pointer-events: auto; transform: translateY(0) scale(1);
}
.cs-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; color: var(--text);
    margin-bottom: 10px;
}
.cs-close { cursor: pointer; color: var(--text-3); padding: 4px 8px; }
.cs-close:hover { color: var(--text); }
.cs-body { display: flex; flex-direction: column; gap: 6px; }
.cs-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: 10px;
    background: rgba(247,250,252,.7);
    transition: all .2s; cursor: pointer;
    color: var(--text);
}
.cs-item:hover { background: rgba(91,108,255,.08); transform: translateX(2px); }
.cs-ico { font-size: 22px; }
.cs-name { font-weight: 600; font-size: 14px; }
.cs-val  { font-size: 12px; word-break: break-all; }

/* CTA Section（主页底部） */
.cta-section { padding: 80px 24px; }
.cta-inner {
    max-width: 800px; margin: 0 auto;
    border-radius: 24px; padding: 48px 32px;
    text-align: center;
}
.cta-inner h2 { font-size: 28px; margin-bottom: 10px; color: var(--text); }
.cta-inner p { color: var(--text-3); margin-bottom: 24px; }
.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 960px) {
    .info-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .ov-row { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .profile-dl { grid-template-columns: 100px 1fr; }
    .uh-right { display: none; }
    .user-greet { display: none; }
}
@media (max-width: 520px) {
    .info-grid-4 { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .auth-card.glass { padding: 28px 22px; }
    .cs-panel { width: 280px; right: -10px; }
}