/* ============================================================
   韩风聊天室 · 渐变液态玻璃 UI
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --grad-main: linear-gradient(135deg, #8e7bff 0%, #5ec6ff 45%, #ff7ecd 100%);
    --grad-btn: linear-gradient(135deg, #7c6cff, #4fb8ff 55%, #ff6ec7);
    --grad-bubble: linear-gradient(135deg, rgba(124,108,255,.92), rgba(79,184,255,.92));
    --glass: rgba(255,255,255,.12);
    --glass-strong: rgba(255,255,255,.18);
    --glass-border: rgba(255,255,255,.35);
    --text: #f4f6ff;
    --text-dim: rgba(244,246,255,.68);
    --radius: 20px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: #1b1740;
    overflow: hidden;
}

.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 10px; }

/* ---------- 动态背景 ---------- */
.bg-aurora {
    position: fixed; inset: 0; z-index: 0;
    background: linear-gradient(135deg, #241b57 0%, #1d2a63 30%, #33205e 60%, #4a2158 100%);
    overflow: hidden;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(70px); opacity: .55;
    animation: floatBlob 18s ease-in-out infinite alternate;
}
.b1 { width: 42vmax; height: 42vmax; left: -12vmax; top: -10vmax; background: #7c5cff; }
.b2 { width: 36vmax; height: 36vmax; right: -10vmax; top: 8vmax; background: #38b6ff; animation-delay: -4s; }
.b3 { width: 34vmax; height: 34vmax; left: 12vmax; bottom: -14vmax; background: #ff5fbf; animation-delay: -9s; }
.b4 { width: 26vmax; height: 26vmax; right: 6vmax; bottom: -8vmax; background: #55ffd6; opacity: .35; animation-delay: -13s; }

@keyframes floatBlob {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(6vmax, 4vmax) scale(1.12); }
    100% { transform: translate(-5vmax, -3vmax) scale(.95); }
}

/* 白色流星雨 */
.meteors { position: absolute; inset: 0; }
.meteors::before, .meteors::after {
    content: ''; position: absolute; inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.9), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,.7), transparent),
        radial-gradient(2px 2px at 80% 60%, rgba(255,255,255,.8), transparent),
        radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,.6), transparent),
        radial-gradient(1.5px 1.5px at 90% 85%, rgba(255,255,255,.8), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,.5), transparent);
    animation: starFall 9s linear infinite;
}
.meteors::after { animation-delay: -4.5s; opacity: .6; }
@keyframes starFall {
    0% { transform: translateY(-3%); opacity: .4; }
    50% { opacity: 1; }
    100% { transform: translateY(3%); opacity: .4; }
}

/* ---------- 玻璃通用 ---------- */
.glass {
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(20, 12, 60, .35), inset 0 1px 0 rgba(255,255,255,.25);
}

/* ---------- 登录页 ---------- */
.auth-wrap {
    position: relative; z-index: 1;
    min-height: 100%; display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 420px; border-radius: 28px; padding: 36px 28px 26px;
    animation: popIn .6s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes popIn { from { opacity: 0; transform: translateY(26px) scale(.96); } }
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo {
    width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-style: italic; font-size: 26px; letter-spacing: 1px;
    background: var(--grad-btn);
    box-shadow: 0 10px 30px rgba(124,108,255,.5);
}
.brand-title { font-size: 26px; font-style: italic; font-weight: 900; letter-spacing: 2px; }
.brand-sub { margin-top: 6px; font-size: 12px; color: var(--text-dim); }

.auth-tabs { display: flex; gap: 8px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 5px; margin-bottom: 20px; }
.auth-tab {
    flex: 1; padding: 10px 0; border-radius: 10px; font-size: 14px; font-weight: 700;
    color: var(--text-dim); transition: .3s;
}
.auth-tab.active { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 18px rgba(124,108,255,.45); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px; padding: 13px 14px; transition: .25s;
}
.field:focus-within { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.16); }
.field-ico { font-size: 16px; }
.field input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 14px; }
.field input::placeholder { color: rgba(255,255,255,.45); }

.btn-gradient {
    padding: 14px; border-radius: 14px; font-size: 15px; font-weight: 800; letter-spacing: 2px;
    background: var(--grad-btn); color: #fff;
    box-shadow: 0 10px 26px rgba(124,108,255,.5);
    transition: transform .15s, box-shadow .25s;
}
.btn-gradient:active { transform: scale(.97); }
.auth-tip { margin-top: 16px; text-align: center; font-size: 11px; color: var(--text-dim); line-height: 1.8; }

/* ---------- 主应用布局 ---------- */
.app-wrap {
    position: relative; z-index: 1;
    height: 100%; max-width: 520px; margin: 0 auto;
    display: flex; flex-direction: column;
}

.topbar {
    flex: 0 0 auto;
    margin: 10px 12px 0; border-radius: 18px; padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-logo {
    width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-style: italic; background: var(--grad-btn);
}
.topbar-titles { min-width: 0; }
.topbar-titles strong { display: block; font-size: 15px; font-style: italic; white-space: nowrap; }
.topbar-titles small { display: block; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.icon-btn { font-size: 18px; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.1); transition: .2s; }
.icon-btn:active { transform: scale(.92); }

.view { flex: 1; overflow-y: auto; padding: 14px 12px 16px; }

/* 底部导航 */
.tabbar {
    flex: 0 0 auto;
    margin: 0 12px 10px; border-radius: 20px;
    display: flex; padding: 8px 4px;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; color: var(--text-dim); transition: .25s; }
.tab-ico { font-size: 19px; transition: transform .25s; }
.tab-label { font-size: 10.5px; font-weight: 600; }
.tab.active { color: #fff; background: var(--grad-btn); box-shadow: 0 6px 16px rgba(124,108,255,.45); }
.tab.active .tab-ico { transform: translateY(-1px) scale(1.12); }

/* ---------- 通用列表卡片 ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; font-style: italic; font-weight: 900; }
.section-head .head-actions { display: flex; gap: 8px; }
.pill-btn {
    padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: var(--grad-btn); box-shadow: 0 5px 14px rgba(124,108,255,.4);
}
.pill-btn.ghost { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); box-shadow: none; }

.list-card { border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; transition: transform .15s; }
.list-card:active { transform: scale(.98); }
.list-ico {
    width: 50px; height: 50px; border-radius: 15px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    background: var(--grad-btn);
}
.list-main { flex: 1; min-width: 0; }
.list-main h3 { font-size: 15px; font-weight: 800; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main p { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 11px; color: var(--text-dim); text-align: right; flex: 0 0 auto; }
.badge {
    display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
    border-radius: 999px; background: #ff4d8d; color: #fff; font-size: 11px; font-weight: 800;
}
.tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.15); margin-right: 4px; }
.tag.hot { background: rgba(255,110,199,.35); }

/* 头像 */
.avatar {
    width: 50px; height: 50px; border-radius: 15px; flex: 0 0 auto; object-fit: cover;
    background: var(--grad-btn); display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px; overflow: hidden;
}
.avatar.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
.avatar.lg { width: 76px; height: 76px; border-radius: 24px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 搜索框 */
.search-bar {
    display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px; padding: 11px 14px;
}
.search-bar input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 13px; }
.search-bar input::placeholder { color: rgba(255,255,255,.45); }

/* ---------- 聊天页 ---------- */
.chat-page { display: flex; flex-direction: column; height: 100%; }
.chat-head {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    margin: 10px 12px 0; border-radius: 18px; padding: 11px 14px;
}
.chat-head .back-btn { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.12); font-size: 16px; }
.chat-head-titles { flex: 1; min-width: 0; }
.chat-head-titles strong { display: block; font-size: 15px; font-style: italic; }
.chat-head-titles small { font-size: 11px; color: var(--text-dim); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; }

.msg-row { display: flex; gap: 8px; align-items: flex-end; animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg-row.mine { flex-direction: row-reverse; }
.msg-sender { text-align: center; margin-bottom: 4px; }
.msg-sender small { font-size: 10px; color: var(--text-dim); }
.msg-bubble {
    max-width: 72%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.55;
    word-break: break-word; background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.2);
}
.msg-row.mine .msg-bubble { background: var(--grad-bubble); border-color: transparent; box-shadow: 0 6px 18px rgba(124,108,255,.35); }
.msg-bubble img { max-width: 100%; border-radius: 12px; display: block; cursor: pointer; }
.msg-file {
    display: flex; align-items: center; gap: 10px; min-width: 170px;
}
.msg-file .file-ico { font-size: 28px; }
.msg-file .file-info b { font-size: 13px; display: block; margin-bottom: 2px; }
.msg-file .file-info small { font-size: 11px; opacity: .8; }
.msg-meta { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.msg-row.mine .msg-meta { text-align: right; }
.recall-tip { text-align: center; font-size: 12px; color: var(--text-dim); padding: 4px 0; }
.recall-tip span { background: rgba(255,255,255,.08); padding: 4px 14px; border-radius: 999px; }
.date-tip { text-align: center; font-size: 11px; color: var(--text-dim); }
.date-tip span { background: rgba(255,255,255,.1); padding: 3px 12px; border-radius: 999px; }

.chat-input-bar {
    flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px;
    margin: 0 12px 10px; border-radius: 20px; padding: 10px;
}
.chat-input-bar textarea {
    flex: 1; resize: none; border: none; outline: none; background: none; color: #fff;
    font-size: 14px; max-height: 90px; line-height: 1.4; padding: 6px 4px;
}
.chat-input-bar textarea::placeholder { color: rgba(255,255,255,.45); }
.chat-tool { width: 40px; height: 40px; border-radius: 13px; background: rgba(255,255,255,.12); font-size: 17px; flex: 0 0 auto; }
.chat-send {
    height: 40px; padding: 0 18px; border-radius: 13px; flex: 0 0 auto;
    background: var(--grad-btn); font-weight: 800; font-size: 13px;
    box-shadow: 0 6px 16px rgba(124,108,255,.45);
}
.chat-send:disabled { opacity: .5; }

/* ---------- 个人主页 / 我的 ---------- */
.profile-hero { border-radius: 24px; padding: 26px 20px; text-align: center; margin-bottom: 14px; }
.profile-hero .avatar { margin: 0 auto 12px; }
.profile-hero h2 { font-size: 20px; font-style: italic; font-weight: 900; }
.profile-hero .profile-id { font-size: 11px; color: var(--text-dim); margin: 5px 0 8px; }
.profile-hero .profile-bio { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }
.profile-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 16px; }
.profile-stats div b { font-size: 20px; display: block; }
.profile-stats div small { font-size: 11px; color: var(--text-dim); }
.profile-actions { display: flex; gap: 10px; justify-content: center; }
.profile-actions button { flex: 1; max-width: 150px; padding: 11px; border-radius: 13px; font-weight: 700; font-size: 13px; }

.menu-list { border-radius: var(--radius); overflow: hidden; }
.menu-row {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1); text-align: left;
}
.menu-row:last-child { border-bottom: none; }
.menu-row .m-ico { font-size: 18px; width: 24px; text-align: center; }
.menu-row .m-label { flex: 1; font-size: 14px; font-weight: 600; }
.menu-row .m-arrow { color: var(--text-dim); font-size: 14px; }

/* ---------- 弹层 ---------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(15,10,40,.55); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal { width: 100%; max-width: 400px; border-radius: 24px; padding: 22px; max-height: 82vh; overflow-y: auto; animation: popIn .35s cubic-bezier(.2,.9,.3,1.2); }
.modal h3 { font-size: 17px; font-style: italic; margin-bottom: 16px; }
.modal .form-row { margin-bottom: 13px; }
.modal .form-row label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.modal .form-row input, .modal .form-row textarea, .modal .form-row select {
    width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px; padding: 11px 13px; color: #fff; outline: none; font-size: 13px;
}
.modal .form-row textarea { resize: vertical; min-height: 64px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; font-size: 13px; }
.btn-ghost { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.switch { position: relative; width: 48px; height: 27px; background: rgba(255,255,255,.2); border-radius: 999px; transition: .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: .25s; }
.switch.on { background: var(--grad-btn); }
.switch.on::after { left: 24px; }

/* 群成员管理小行 */
.manage-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.manage-row:last-child { border-bottom: none; }
.manage-row .m-info { flex: 1; min-width: 0; }
.manage-row .m-info b { font-size: 13px; display: block; }
.manage-row .m-info small { font-size: 11px; color: var(--text-dim); }
.manage-row .mini-btns { display: flex; gap: 6px; }
.manage-row .mini-btns button { padding: 6px 10px; border-radius: 9px; font-size: 11px; background: rgba(255,255,255,.14); }
.manage-row .mini-btns button.danger { background: rgba(255,77,141,.35); }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
    z-index: 99; background: rgba(30,22,70,.85); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.25); border-radius: 14px;
    padding: 11px 20px; font-size: 13px; opacity: 0; pointer-events: none;
    transition: .3s; max-width: 84%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 后台布局 ---------- */
.admin-wrap { position: relative; z-index: 1; height: 100%; display: flex; }
.admin-side {
    flex: 0 0 210px; margin: 12px 0 12px 12px; border-radius: 22px; padding: 18px 14px;
    display: flex; flex-direction: column; gap: 6px;
}
.admin-brand { font-size: 16px; font-weight: 900; font-style: italic; padding: 6px 8px 16px; display: flex; align-items: center; gap: 8px; }
.admin-brand span {
    width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    background: var(--grad-btn); font-style: italic;
}
.menu-item {
    text-align: left; padding: 11px 13px; border-radius: 12px; font-size: 13px; font-weight: 600;
    color: var(--text-dim); transition: .2s;
}
.menu-item.active { color: #fff; background: var(--grad-btn); box-shadow: 0 5px 15px rgba(124,108,255,.4); }
.admin-side .btn-ghost { margin-top: auto; padding: 10px; border-radius: 12px; font-size: 12px; }

.admin-content { flex: 1; overflow: hidden; padding: 12px; }
.admin-view { height: 100%; overflow-y: auto; }
.admin-view h2 { font-size: 20px; font-style: italic; margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { border-radius: 18px; padding: 18px 16px; }
.stat-card .s-ico { font-size: 22px; }
.stat-card b { display: block; font-size: 26px; margin: 8px 0 2px; font-style: italic; }
.stat-card small { font-size: 11px; color: var(--text-dim); }

.panel { border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.panel h3 { font-size: 14px; font-style: italic; margin-bottom: 14px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; padding: 10px 8px; color: var(--text-dim); font-size: 11px; border-bottom: 1px solid rgba(255,255,255,.15); white-space: nowrap; }
.admin-table td { padding: 11px 8px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.admin-table .row-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.admin-table .row-btns button { padding: 6px 10px; border-radius: 9px; font-size: 11px; background: rgba(255,255,255,.14); white-space: nowrap; }
.admin-table .row-btns button.danger { background: rgba(255,77,141,.35); }
.admin-table .row-btns button.warn { background: rgba(255,180,60,.3); }
.table-wrap { overflow-x: auto; }
.role-tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(124,108,255,.4); }
.role-tag.admin { background: var(--grad-btn); }
.status-dot { font-size: 11px; }
.status-dot.ok { color: #7dffc8; }
.status-dot.no { color: #ff7d9d; }

/* 迷你柱状图 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar {
    width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px;
    background: var(--grad-btn); min-height: 3px; transition: height .6s ease;
}
.bars .bar-col small { font-size: 10px; color: var(--text-dim); white-space: nowrap; }

/* 响应式 */
@media (max-width: 720px) {
    .admin-wrap { flex-direction: column; }
    .admin-side {
        flex: 0 0 auto; margin: 10px; flex-direction: row; overflow-x: auto; gap: 6px;
        padding: 8px;
    }
    .admin-brand { padding: 4px 8px; white-space: nowrap; }
    .menu-item { white-space: nowrap; text-align: center; }
    .admin-side .btn-ghost { margin-top: 0; white-space: nowrap; }
    .admin-content { padding: 0 10px 10px; }
}
