/* ========================================
   7. 排行榜 / 搜索 / 标签 / 通知
======================================== */

/* 7.1 搜索结果与通知 */
.search-results {
    width: 100%;
    max-width: 900px;
    margin: 10px auto 0;
    background: rgba(255,255,255,0.9);
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 8px;
    display: none;
}

.search-item {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.search-item:hover {
    background: #f3fbe6;
}

.search-type {
    font-size: 11px;
    color: #555;
    margin-right: 8px;
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 8px;
}

.notify-bar {
    background: rgba(255, 251, 230, 0.6);
    border: 1px solid rgba(255, 229, 143, 0.4);
    padding: 10px 14px;
    border-radius: 12px;
    margin: 0 auto 15px;
    max-width: 1000px;
    display: none;
}

/* 7.2 标签筛选 */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.tag-filter {
    background: #f1f3f5;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
}

.tag-filter.active {
    background: #e8f5e9;
    color: #2f7d32;
    font-weight: bold;
}

.tag-filter-actions {
    display: flex;
    gap: 6px;
}

/* 7.3 排行榜 */
.rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin: 10px 0 20px;
}

.rank-card {
    background: var(--glass);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 8px 28px rgba(66, 165, 245, 0.1);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.rank-tabs {
    display: flex;
    gap: 8px;
    margin: 6px 0;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    align-items: center;
}

    .feedback-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 18px;
        align-items: center;
    }

    .feedback-toolbar select {
        min-width: 120px;
        border: 1px solid #eef2e6;
        border-radius: 10px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.8);
        color: #333;
        font-size: 14px;
        outline: none;
    }

    .feedback-badge {
        display: inline-block;
        padding: 4px 12px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        color: white;
    }

    .feedback-badge.category {
        background: #4dabf7;
    }

    .feedback-badge.status {
        background: #7cb329;
    }

    .feedback-badge.status-unresolved {
        background: #ffb703;
    }

    /* 意见卡片样式 */
    .feedback-card {
        background: linear-gradient(180deg, #ffffff, #fbfffb);
        border-radius: 14px;
        padding: 14px;
        box-shadow: 0 8px 22px rgba(0,0,0,0.06);
        border: 1px solid #f0f6ea;
    }

    /* 防止溢出：表单元素在卡片内正确计算宽度 */
    .rank-card textarea,
    .feedback-card textarea {
        box-sizing: border-box;
        max-width: 100%;
        width: 100%;
        overflow-wrap: break-word;
    }

    .feedback-meta {
        display:flex;
        gap:10px;
        align-items:center;
        font-size:13px;
        color:#666;
        margin-bottom:8px;
    }

    .feedback-content {
        font-size:14px;
        color:#333;
        line-height:1.6;
        white-space:pre-wrap;
    }

    /* 消息线程 */
    .feedback-thread {
        margin-top:12px;
        display:flex;
        flex-direction:column;
        gap:8px;
    }

    .msg-bubble {
        max-width:78%;
        padding:10px 12px;
        border-radius:12px;
        font-size:13px;
        line-height:1.4;
        box-shadow: 0 6px 14px rgba(0,0,0,0.04);
        transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .msg-bubble.user {
        background: #f0fff4;
        align-self:flex-start;
        border: 1px solid #e6f4e8;
    }

    .msg-bubble.admin {
        background: #eef6ff;
        align-self:flex-end;
        border: 1px solid #e3eefb;
    }

    .feedback-card .feedback-card-actions {
        margin-top:12px;
        display:flex;
        gap:8px;
        flex-wrap:wrap;
    }

    /* 列表布局：多列自适应 */
    .feedback-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 14px;
        align-items: start;
    }

    /* 徽章微调 */
    .feedback-badge.category { background: linear-gradient(90deg,#4dabf7,#6fb5ff); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.06); }
    .feedback-badge.status { background: linear-gradient(90deg,#7cb329,#9dd63b); }

    /* 消息元信息 */
    .msg-meta { font-size:11px; color:#8a8a8a; margin-top:4px; }

    .msg-bubble.user::after, .msg-bubble.admin::after {
        content: '';
        display: block;
        height: 4px;
        opacity: 0.02;
    }

    /* 小屏适配：卡片与气泡全宽 */
    @media (max-width:600px) {
        .msg-bubble { max-width:100%; }
        .feedback-card { padding:12px; }
    }

    .feedback-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 14px;
    }

.rank-reason-text {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.rank-reason-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.rank-like-btn {
    background: rgba(255, 224, 130, 0.3);
    color: #d9480f;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
}


/* ========================================
   9. 弹窗模块
======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: var(--glass, rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.85));
    border-radius: 28px;
    width: 95%;
    max-width: 1100px;
    padding: 25px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.modal-content textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #eef2e6;
    border-radius: 12px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
}

.modal-scroll-area {
    overflow-y: auto;
    flex: 1;
    margin: 15px 0;
    padding-right: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}


/* ========================================
   10. 聊天小窗 — 黄绿蓝渐变玻璃态
======================================== */
.chat-widget {
    position: fixed;
    right: 15px;
    bottom: 15px;
    z-index: 10002;
    width: 320px;
}

/* 收起态：渐变胶囊 */
.chat-mini {
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid var(--glass-border);
    border-radius: 24px;
    padding: 10px 18px;
    box-shadow: 0 4px 18px rgba(66, 165, 245, 0.12), 0 1px 4px rgba(255, 213, 79, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3a5f6a;
    font-weight: 600;
    transition: all 0.25s;
}
.chat-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(66, 165, 245, 0.2), 0 2px 8px rgba(129, 199, 132, 0.12);
    border-color: rgba(255, 255, 255, 0.95);
}
.chat-mini-icon {
    font-size: 18px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.chat-unread {
    background: var(--gradient-brand);
    color: #1a3a4a;
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 8px;
    font-weight: 700;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(255, 213, 79, 0.3);
}

/* 展开态：毛玻璃面板 */
.chat-expand {
    display: none;
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(66, 165, 245, 0.16), 0 4px 12px rgba(129, 199, 132, 0.08);
    overflow: hidden;
}

/* 顶栏：渐变底色 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255,248,225,0.6), rgba(227,242,253,0.6));
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.chat-header-title {
    font-weight: 700;
    font-size: 14px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.chat-header-actions {
    display: flex;
    gap: 4px;
}
.chat-btn-icon {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #5a7a86;
    backdrop-filter: blur(6px);
    transition: all 0.18s;
}
.chat-btn-icon:hover {
    background: var(--gradient-brand-soft);
    color: #2e5f6e;
    transform: translateY(-1px);
}

/* 消息列表：柔和底色 */
.chat-messages {
    height: 340px;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 13px;
    scroll-behavior: smooth;
    background:
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(255, 248, 225, 0.3), transparent),
        radial-gradient(ellipse 50% 50% at 100% 100%, rgba(227, 242, 253, 0.3), transparent),
        rgba(240, 247, 255, 0.45);
}
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 213, 79, 0.4), rgba(100, 181, 246, 0.4));
    border-radius: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* 消息气泡 */
.chat-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.06);
    word-break: break-all;
    line-height: 1.55;
    transition: transform 0.15s;
}
.chat-msg:hover {
    transform: translateY(-1px);
}
.chat-msg-time {
    color: #9ab0b8;
    font-size: 11px;
    margin-right: 6px;
}
.chat-msg-name {
    color: var(--green-mid);
    font-weight: 600;
    margin-right: 4px;
}
.chat-msg-text {
    color: #2c3e50;
}
.chat-msg-system {
    color: #8fa3a8;
    font-style: italic;
    background: rgba(255, 248, 225, 0.45);
    border-color: rgba(255, 224, 130, 0.3);
}

/* 自己发的消息靠右 */
.chat-msg-self {
    background: linear-gradient(135deg, rgba(255, 248, 225, 0.7), rgba(227, 242, 253, 0.7));
    border-color: rgba(255, 255, 255, 0.7);
    margin-left: 28px;
}
.chat-msg-self .chat-msg-name {
    color: var(--blue-deep);
}

.chat-loading {
    text-align: center;
    padding: 8px;
    color: #9ab0b8;
    font-size: 12px;
}

/* 输入栏 */
.chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(90deg, rgba(255,248,225,0.4), rgba(227,242,253,0.4));
}
.chat-input input {
    margin: 0;
    flex: 1;
    border-radius: 20px;
    padding: 9px 16px;
    border: 1.5px solid rgba(238, 242, 230, 0.7);
    background: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input input:focus {
    border-color: rgba(66, 165, 245, 0.5);
    box-shadow: 0 4px 16px rgba(100, 181, 246, 0.12);
}
.chat-send-btn {
    background: var(--gradient-brand);
    color: #1a3a4a;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(66, 165, 245, 0.18);
    transition: all 0.22s;
}
.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 165, 245, 0.28);
    filter: brightness(1.04);
}

@media (max-width: 600px) {
    .chat-widget {
        width: calc(100vw - 30px);
        right: 15px;
    }
    .chat-messages {
        height: 260px;
    }
}


/* ========================================
   11. 音乐控件
======================================== */
#musicCtrl {
    display: none !important;
}


/* ========================================
   12. 响应式适配
======================================== */

/* 12.1 平板及中等屏幕 */
@media (max-width: 900px) {
    .modal-content {
        max-width: 95vw;
    }
}

/* 12.2 手机端 */
@media (max-width: 600px) {
    .rank-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .rank-grid .rank-card {
        padding: 10px;
        min-width: 0;
        font-size: 12px;
    }

    .rank-grid .rank-item {
        font-size: 11px;
        padding: 5px 0;
    }


    .chat-widget {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .chat-mini {
        margin: 0 12px 10px;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 12px;
        text-align: center;
    }

    .chat-expand {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: min(52vh, 420px);
        border-radius: 16px 16px 0 0;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 24px rgba(0,0,0,0.12);
        box-sizing: border-box;
        z-index: 10003;
    }

    .chat-messages {
        max-height: min(200px, 32vh);
        overflow-y: auto;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 90vh;
        border-radius: 16px;
        padding: 16px;
    }

    #adminBtnS {
        width: 100% !important;
        max-width: none;
        box-sizing: border-box;
    }
}