:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.navbar-brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.back-btn {
    position: absolute;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}
.back-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateX(-2px);
}
.back-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.container { max-width: 1000px; margin: 0 auto; padding: 1rem; }
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.icon-blue { background: #eef2ff; color: #4f46e5; }
.icon-green { background: #ecfdf5; color: #10b981; }
.icon-orange { background: #fffbeb; color: #f59e0b; }
.icon-purple { background: #f5f3ff; color: #8b5cf6; }
.icon-red { background: #fef2f2; color: #ef4444; }
.card-title .icon {
    width: 26px; height: 26px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
}
.server-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.server-info-item { background: var(--bg); border-radius: 8px; padding: 0.75rem; text-align: center; }
.server-info-item .label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 2px; }
.server-info-item .value { font-size: 1.1rem; font-weight: 700; word-break: break-word; }
.status-open { color: var(--success); }
.status-closed { color: var(--danger); }
.status-waiting { color: var(--warning); }
.invite-count {
    display: flex; align-items: center; justify-content: center;
    gap: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: 8px; flex-wrap: wrap;
}
.invite-count .number { font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.invite-count .label-text { font-size: 0.8rem; color: var(--text-secondary); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 8px; border: none;
    font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: 0.2s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #c7d2fe; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.announcement-list { display: flex; flex-direction: column; gap: 0.6rem; }
.announcement-item {
    padding: 0.9rem; background: var(--bg); border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; transition: 0.2s;
}
.announcement-item:hover { border-color: var(--primary); background: #f8faff; }
.announcement-item .ann-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.announcement-item .ann-preview {
    font-size: 0.8rem; color: var(--text-secondary);
    white-space: pre-wrap; word-break: break-word; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.announcement-item .ann-date { font-size: 0.7rem; color: #94a3b8; margin-top: 4px; }
.vote-options { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.vote-option {
    display: flex; align-items: center; gap: 10px; padding: 0.7rem 0.9rem;
    background: var(--bg); border-radius: 8px; cursor: pointer; transition: 0.2s;
    border: 2px solid transparent; user-select: none;
}
.vote-option:hover { border-color: var(--primary); }
.vote-option.selected { border-color: var(--primary); background: #eef2ff; }
.vote-option input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; cursor: pointer; }
.vote-option .option-text { flex: 1; font-size: 0.9rem; }
.vote-option .option-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; min-width: 60px; }
.vote-option .option-bar .fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.5s ease; }
.vote-option .option-percent { font-size: 0.75rem; color: var(--text-secondary); min-width: 35px; text-align: right; }
.vote-result .vote-option { cursor: default; }
.vote-result .vote-option:hover { border-color: transparent; }
.vote-status { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.4rem; }

/* 公告详情弹窗 */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.modal-announcement {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.ann-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}
.ann-modal-icon { font-size: 1.6rem; }
.ann-modal-title { flex: 1; font-size: 1.2rem; font-weight: 700; margin: 0; color: white; }
.ann-modal-close {
    background: rgba(255,255,255,0.2); border: none; color: white; font-size: 1.4rem;
    cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.ann-modal-close:hover { background: rgba(255,255,255,0.4); }
.ann-modal-body {
    padding: 24px; overflow-y: auto; flex: 1;
    font-size: 0.95rem; line-height: 1.7; color: #1e293b; word-break: break-word;
}
.ann-modal-date {
    display: inline-block; font-size: 0.8rem; color: #94a3b8; margin-bottom: 16px;
    background: #f1f5f9; padding: 4px 12px; border-radius: 20px;
}
.ann-modal-footer {
    padding: 16px 24px; border-top: 1px solid #e2e8f0;
    display: flex; justify-content: flex-end; background: #f8fafc;
}

/* 邀请码确认弹窗 */
.modal-invite {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.invite-modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    flex-shrink: 0;
}
.invite-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.invite-modal-body {
    padding: 20px 24px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.invite-announcement-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.invite-announcement {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
    flex-shrink: 0;
}
.invite-announcement summary {
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    font-size: 0.95rem;
    color: var(--text);
}
.invite-announcement summary::before {
    content: '▸';
    transition: transform 0.2s;
    color: var(--primary);
}
.invite-announcement[open] summary::before { transform: rotate(90deg); }
.invite-announcement .ann-content {
    padding: 16px;
    font-size: 0.9rem;
    white-space: pre-wrap;
    border-top: 1px solid var(--border);
    word-break: break-word;
    color: var(--text);
}
.invite-announcement .ann-read-confirm {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    font-size: 0.85rem;
}
.checkbox-confirm {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f8fafc;
    flex-shrink: 0;
}

.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 10px 20px; border-radius: 8px;
    font-size: 0.85rem; z-index: 2000; opacity: 0; transition: opacity 0.3s;
    pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
.loading-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
    border-top-color: white; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* 制作者信息 */
.footer-credit {
    text-align: center;
    padding: 20px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}
.footer-credit a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.footer-credit a:hover {
    text-decoration: underline;
}

/* ========== 违规玩家公示 ========== */
.violation-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.violation-item {
    display: flex;
    gap: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 0.9rem;
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.2s;
}
.violation-item:hover {
    background: #fee2e2;
}
.violation-info {
    flex: 1;
    min-width: 0;
}
.violation-player {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.player-name {
    font-weight: 700;
    color: #dc2626;
}
.player-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: #fff;
    padding: 2px 8px;
    border-radius: 20px;
}
.violation-desc {
    font-size: 0.9rem;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.2rem;
}
.violation-desc-clamp {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.violation-date {
    font-size: 0.75rem;
    color: #94a3b8;
}
.violation-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #fecaca;
}
.violation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 查看更多按钮 */
.violation-more-wrapper {
    text-align: center;
    margin-top: 0.5rem;
}
.violation-more-wrapper .btn {
    font-size: 0.8rem;
    padding: 6px 16px;
}

/* 全部违规公示模态框 */
.modal-violation-all {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.violation-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    flex-shrink: 0;
}
.violation-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #dc2626;
    font-weight: 700;
}
.violation-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.violation-modal-close:hover {
    background: #fee2e2;
}
.violation-modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* 单条违规详情模态框 */
.modal-violation-detail {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.violation-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    flex-shrink: 0;
}
.violation-detail-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #dc2626;
    font-weight: 700;
}
.violation-detail-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.violation-detail-close:hover {
    background: #fee2e2;
}
.violation-detail-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}
.violation-detail-player {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.violation-detail-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    margin-bottom: 1rem;
}
.violation-detail-image img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #fecaca;
}
.violation-detail-date {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1rem;
}

/* 图片预览模态框 */
.modal-violation-image {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 10px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease;
}
.modal-violation-image img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}
.violation-image-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 10;
}
.violation-image-close:hover {
    background: #f1f5f9;
}

@media (max-width: 768px) {
    .container { padding: 0.75rem; }
    .card { padding: 1rem; }
    .server-info-grid { grid-template-columns: 1fr; }
    .invite-count { flex-direction: column; gap: 0.4rem; text-align: center; }
    .btn { width: 100%; max-width: 400px; margin: 0 auto; }
    .modal-invite, .modal-announcement, .modal-violation-all, .modal-violation-detail { max-width: 95%; }
    .invite-modal-header, .ann-modal-header, .violation-modal-header, .violation-detail-header { padding: 14px 16px; }
    .invite-modal-body, .ann-modal-body, .violation-modal-body, .violation-detail-body { padding: 16px; }
    .modal-footer, .ann-modal-footer { padding: 12px 16px; }
    .invite-announcement-list { max-height: none; }
    .back-btn { left: 8px; padding: 4px 8px; font-size: 0.8rem; }
}

/* 违规标签徽章 */
.violation-tag {
    font-size: 0.75rem;
    background: #fecaca;
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
    margin-left: 2px;
}