:root {
    --theme-color: #fe2c55;
    --bg-color: #161823;
    --card-bg: #252732;
    --hover-bg: #333645;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --border-color: #3a3a4a;
}

body { margin: 0; padding: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--bg-color); color: var(--text-primary); }
.hidden { display: none !important; }
.loading { text-align: center; color: var(--text-secondary); padding: 15px; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
#nav-container { margin-bottom: 20px; }
.view-container { max-width: 1100px; margin: 0 auto 15px auto; background: var(--card-bg); padding: 12px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.nav-tabs { display: flex; gap: 8px; overflow-x: auto; white-space: nowrap; flex: 1; }
.nav-tab { background: transparent; border: none; color: var(--text-secondary); font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 10px; border-radius: 4px; transition: 0.2s; flex-shrink: 0; }
.nav-tab.active { background: var(--theme-color); color: #fff; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; padding: 8px 4px; color: var(--text-secondary); font-size: 11px; border-bottom: 1px solid var(--border-color); }
td { padding: 8px 4px; border-bottom: 1px solid var(--border-color); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
#search-view table { font-size: 10px; }
#search-view td, #search-view th { padding: 4px 2px; }
#search-view td:last-child { white-space: normal; word-break: break-all; line-height: 1.1; }
.rank-row { cursor: pointer; }
.rank-row:hover { background-color: var(--hover-bg); }
.anchor-info { display: flex; align-items: center; gap: 6px; }
.score { color: var(--theme-color); font-weight: bold; font-family: monospace; font-size: 11px; }
.live-tag { background: linear-gradient(45deg, #ff0050, #00f2ea); color: #fff; font-size: 9px; padding: 1px 3px; border-radius: 3px; font-weight: bold; }
.header-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.action-group { display: flex; flex-direction: column; gap: 5px; }
.back-btn, .bottom-btn { background: #3a3a4a; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: bold; }
.bottom-btn { background: var(--theme-color); }
.pk-btn { background: #ff4500; color: #fff; border: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: bold; transition: 0.2s; }
.pk-btn:active { transform: scale(0.9); }
.pk-clear-btn { background: #555; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: bold; }
.search-inner-box { flex: 1; min-width: 150px; }
.inner-input { width: 100%; background: #333645; border: 1px solid var(--border-color); color: white; padding: 8px; border-radius: 6px; font-size: 12px; outline: none; box-sizing: border-box; }
.detail-sub-tabs { display: flex; gap: 10px; margin-bottom: 12px; }
.sub-tab { flex: 1; background: #1c1e2a; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 8px 0; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; transition: 0.2s; text-align: center; }
.sub-tab.active { background: var(--theme-color); color: #fff; border-color: var(--theme-color); }
.detail-section { display: none; background: #1c1e2a; padding: 10px; border-radius: 8px; }
.detail-section.active { display: block; }
.section-title { font-size: 13px; font-weight: bold; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--theme-color); }
.user-card { display: flex; align-items: center; gap: 8px; padding: 6px; margin-bottom: 4px; background: var(--card-bg); border-radius: 6px; cursor: pointer; }
.rank-badge { margin-left: auto; background: rgba(255,255,255,0.05); padding: 2px 4px; border-radius: 3px; font-size: 10px; color: #ffd700; }
.db-search-box { display: flex; gap: 5px; margin-bottom: 10px; background: #1c1e2a; padding: 8px; border-radius: 6px; }
.db-input { background: #333645; border: 1px solid var(--border-color); color: white; padding: 8px; border-radius: 4px; font-size: 12px; flex: 1; outline: none; }
.db-btn { background: var(--theme-color); color: white; border: none; padding: 0 12px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 12px; white-space: nowrap; }
.level-badge { font-size: 8px; padding: 1px 2px; border-radius: 2px; margin-right: 1px; display: inline-block; vertical-align: middle; }
.level-fans { background: #ff9f00; color: #000; }
.level-pay { background: #1e90ff; color: #fff; }
#floating-tools { position: fixed; bottom: 20px; right: 15px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; opacity: 0; visibility: hidden; transition: 0.3s; }
#floating-tools.show { opacity: 1; visibility: visible; }
.float-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--theme-color); color: white; border: none; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.logout-btn { background: #ff4500; font-size: 12px; font-weight: bold; letter-spacing: 1px;}
#pk-arena-view { background: #0D0D0D; max-width: 1200px; }
.pk-scoreboard { text-align: center; background: #161618; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #333; }
.pk-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
.pk-card { background: #151F28; width: 120px; padding: 15px 10px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; border: 2px solid transparent; position: relative; transition: all 0.3s ease; box-shadow: 0 4px 8px rgba(0,0,0,0.4); }
.pk-card.team-blue { border-color: #00BFFF; background: #0a1118; }
.pk-card.team-red { border-color: #FF4500; background: #1a0808; }
.pk-avatar { width: 60px; height: 60px; border-radius: 50%; margin-bottom: 10px; border: 2px solid rgba(255,255,255,0.2); object-fit: cover; }
.pk-nickname { font-size: 13px; color: #fff; font-weight: bold; width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
.pk-score { font-size: 20px; color: #FFD700; font-family: Impact, monospace; font-weight: normal; margin-top: 5px;}
.pk-match-status { font-size: 12px; font-weight: bold; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-left: 10px;}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.soc-btn { background: rgba(255,255,255,0.08); border: 1px solid var(--border-color); color: var(--text-secondary); border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);}
.soc-btn:active { transform: scale(0.95); }
.soc-btn.liked { background: rgba(254,44,85,0.15); color: var(--theme-color); border-color: var(--theme-color); }
.soc-btn.liked .heart-icon { text-shadow: 0 0 4px var(--theme-color); }

/* 🔥 修复弹窗跑出来的核心代码 🔥 */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); z-index: 10000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal-mask.show { display: flex; animation: fadeIn 0.2s ease-out; }
.comment-panel { background: var(--card-bg); width: 90%; max-width: 450px; border-radius: 12px; display: flex; flex-direction: column; max-height: 80vh; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--border-color); }
.cp-header { padding: 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #1c1e2a; }
.cp-body { padding: 15px; overflow-y: auto; flex: 1; min-height: 200px; display: flex; flex-direction: column; gap: 12px;}
.cp-footer { padding: 12px 15px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; background: #1c1e2a; }
.cp-input { flex: 1; background: #333645; border: 1px solid var(--border-color); color: white; padding: 10px 15px; border-radius: 20px; font-size: 13px; outline: none; }
.chat-bubble { display: flex; gap: 10px; margin-bottom: 5px; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(45deg, #ff7b00, var(--theme-color)); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; color: white; flex-shrink: 0; }
.chat-content-box { display: flex; flex-direction: column; gap: 4px; }
.chat-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #888; }
.chat-name { font-weight: bold; color: #ccc; }
.chat-text { background: #333645; padding: 8px 12px; border-radius: 0 12px 12px 12px; font-size: 13px; line-height: 1.4; word-break: break-all; color: #fff;}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.user-panel { 
    display: flex; flex-direction: column; gap: 4px; 
    padding-top: 12px; border-top: 1px solid var(--border-color); 
}
.btn-action { background: #333645; color: #fff; border: 1px solid var(--border-color); padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.btn-action:hover { background: #44485c; }
.btn-action:active { transform: scale(0.95); }
.btn-action.disabled { opacity: 0.4; cursor: not-allowed; }
.btn-action.active-reward { background: linear-gradient(45deg, #ff7b00, #ff4500); color: #fff; border: none; box-shadow: 0 2px 8px rgba(255,69,0,0.4); opacity: 1; animation: pulseGlow 2s infinite; }
.btn-feedback { background: #2a2d3d; border-color: #4a4d5d; color: #00f2ea; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(255, 69, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 69, 0, 0); } }

.announcement-panel { 
    display: flex; flex-direction: column; gap: 8px; align-items: stretch; 
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-color); 
}

.notice-box { 
    background: rgba(255, 179, 0, 0.1); color: #ffb300; 
    padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: bold; 
    white-space: normal; 
    word-break: break-word; 
    line-height: 1.5; 
    border: 1px solid rgba(255, 179, 0, 0.2); transition: 0.2s; 
}
.notice-box.admin-editable:hover { 
    background: rgba(255, 179, 0, 0.2); cursor: pointer; border-color: #ffb300; 
}

.btn-leaderboard { background: #ff9f00; border-color: #e68a00; color: #fff; }
.btn-leaderboard:hover { background: #ffb333; }

.backpack-item {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, #2a2d3e 0%, #1e1f29 100%);
    border: 1px solid rgba(255,107,129, 0.3); border-radius: 8px;
    padding: 12px 15px; margin-bottom: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.bp-info { display: flex; flex-direction: column; gap: 4px; }
.bp-title { font-size: 14px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px #000; }
.bp-desc { font-size: 11px; color: #aaa; }
.bp-count { color: #ffb300; font-weight: 900; font-size: 16px; margin-left: 5px; }
.btn-use-item { 
    background: #ff4757; color: #fff; border: none; padding: 6px 14px; 
    border-radius: 20px; font-weight: bold; font-size: 12px; cursor: pointer; transition: 0.2s;
}
.btn-use-item:hover { background: #ff6b81; transform: scale(1.05); }
@keyframes highlight {
    0% { background-color: rgba(24, 144, 255, 0.1); }
    100% { background-color: transparent; }
}