/* ========== 经典红黑主题 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #000000;
    padding: 1rem;
    border-bottom: 2px solid #cc0000;
    box-shadow: 0 2px 10px rgba(204, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.active {
    background: #cc0000;
    color: #000;
    box-shadow: 0 0 8px #cc0000;
}

main {
    flex: 1;
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    width: 100%;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #fff;
}
h1 {
    font-size: 2rem;
    border-left: 4px solid #cc0000;
    padding-left: 1rem;
}

.hero {
    background: linear-gradient(135deg, #1a0000 0%, #000000 100%);
    border: 1px solid #cc0000;
    color: #fff;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(204,0,0,0.2);
}
.hero h1 {
    border-left: none;
    font-size: 2rem;
    text-shadow: 0 0 5px #cc0000;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.card {
    background: #111111;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #2a2a2a;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.card:hover {
    transform: translateY(-5px);
    border-color: #cc0000;
    box-shadow: 0 8px 24px rgba(204,0,0,0.2);
}
.card h2 {
    color: #cc0000;
}

.btn, #submit-btn, #send-btn, button:not(.like-btn) {
    display: inline-block;
    background: #cc0000;
    color: #000;
    font-weight: bold;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn:hover, #submit-btn:hover, #send-btn:hover, button:not(.like-btn):hover {
    background: #ff3333;
    box-shadow: 0 0 10px #cc0000;
    transform: scale(1.02);
}

.problem-list, .post-list {
    background: #0f0f0f;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}
.problem-item, .post-item {
    padding: 1rem;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
}
.problem-item:hover, .post-item:hover {
    background: #1a1a1a;
}
.problem-item a, .post-item a {
    color: #cc0000;
    text-decoration: none;
    font-weight: 500;
}
.problem-item a:hover, .post-item a:hover {
    text-decoration: underline;
    color: #ff6666;
}

.difficulty-star {
    color: #ffaa33;
}
.difficulty {
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.difficulty.简单 { background: #2ecc71; color: #000; }
.difficulty.中等 { background: #f39c12; color: #000; }
.difficulty.困难 { background: #e74c3c; color: #fff; }

.description {
    background: #111;
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 3px solid #cc0000;
}
pre {
    background: #000;
    color: #cc0000;
    padding: 0.8rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #2a2a2a;
    font-family: monospace;
}

.submit-section {
    margin-top: 2rem;
    background: #111;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
}
#code-editor {
    width: 100%;
    font-family: monospace;
    background: #000;
    color: #cc0000;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.8rem;
}
.result {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
}
.result.accepted { background: #1e3a2f; color: #2ecc71; border-left: 4px solid #2ecc71; }
.result.wrong { background: #3a1e1e; color: #ff5a5a; border-left: 4px solid #ff5a5a; }

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.post-meta, .reply-meta {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.post-content {
    margin: 1rem 0;
    line-height: 1.6;
}
.reply-section {
    margin-top: 2rem;
    background: #111;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
}
.reply {
    border-top: 1px solid #2a2a2a;
    padding: 1rem 0;
}

.chat-container {
    max-width: 800px;
    margin: 20px auto;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
}
.chat-header {
    background: #000;
    padding: 15px;
    border-bottom: 1px solid #2a2a3a;
}
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #0a0a0a;
}
.message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #1a1a1a;
    max-width: 80%;
}
.message .nickname {
    font-weight: bold;
    color: #cc0000;
    margin-right: 10px;
}
.message .text {
    color: #ddd;
}
.message .time {
    font-size: 0.7rem;
    color: #888;
    margin-left: 10px;
}
.chat-input {
    display: flex;
    padding: 15px;
    background: #000;
    border-top: 1px solid #2a2a3a;
}
#message-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #1a1a1a;
    color: white;
    margin-right: 10px;
}
#send-btn {
    background: #cc0000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
.nickname-set {
    padding: 15px;
    text-align: center;
    background: #000;
    border-bottom: 1px solid #2a2a3a;
}
#nickname-input {
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: #1a1a1a;
    color: white;
    margin-right: 10px;
}

.friends-container { display: flex; gap: 20px; }
.sidebar { width: 250px; background: #111; border-radius: 16px; padding: 15px; border: 1px solid #2a2a2a; }
.chat-area { flex: 1; background: #111; border-radius: 16px; display: flex; flex-direction: column; height: 500px; border: 1px solid #2a2a2a; }
.messages { flex: 1; overflow-y: auto; padding: 15px; }
.input-area { display: flex; padding: 15px; border-top: 1px solid #2a2a2a; }
.input-area input { flex: 1; padding: 8px; background: #1a1a1a; border: none; color: white; border-radius: 8px; margin-right: 10px; }
.friend-item { padding: 10px; cursor: pointer; border-radius: 8px; margin-bottom: 5px; background: #1a1a1a; }
.friend-item:hover, .friend-item.active { background: #cc0000; color: #000; }
.search-box { margin-bottom: 15px; display: flex; gap: 5px; }
.search-box input { flex: 1; padding: 8px; background: #1a1a1a; border: none; color: white; border-radius: 8px; }
.request-item { padding: 8px; background: #1a1a1a; margin-bottom: 5px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.search-result-item { padding: 8px; background: #1a1a1a; margin-bottom: 5px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
button { background: #cc0000; border: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-weight: bold; color: #000; }

.profile-container { max-width: 800px; margin: 0 auto; }
.stat-card { background: #111; padding: 20px; border-radius: 16px; margin-bottom: 20px; border: 1px solid #2a2a2a; }
.submission-item { background: #111; padding: 15px; border-radius: 12px; margin-bottom: 10px; border: 1px solid #2a2a2a; }
.accepted { color: #2ecc71; }
.wrong { color: #e74c3c; }
.bio-edit textarea { width: 100%; padding: 8px; background: #1a1a1a; border: 1px solid #2a2a2a; color: white; border-radius: 8px; }

.version-list { max-width: 800px; margin: 0 auto; }
.version-item { background: #111; margin-bottom: 20px; padding: 20px; border-radius: 16px; border-left: 4px solid #cc0000; }
.version-number { font-size: 1.5rem; font-weight: bold; color: #cc0000; }
.version-date { color: #aaa; margin-left: 10px; }

footer {
    text-align: center;
    padding: 1.5rem;
    background: #000;
    border-top: 1px solid #2a2a2a;
    margin-top: auto;
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 768px) {
    nav { gap: 0.8rem; }
    nav a { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
    .hero { padding: 1.5rem; }
    .features { grid-template-columns: 1fr; }
}

/* 聊天气泡样式 */
.bubble-red .message { background: #ff4d4d; border-radius: 20px; }
.bubble-blue .message { background: #4da6ff; border-radius: 30px; }
.bubble-green .message { background: #4dff4d; border-radius: 10px; }
.bubble-purple .message { background: #b84dff; border-radius: 40px; }
/* 头像框样式 */
.frame-gold .avatar { border: 3px solid gold; border-radius: 50%; }
.frame-silver .avatar { border: 3px solid silver; border-radius: 50%; }
/* 名字颜色 */
.color-red .nickname { color: #ff4d4d !important; }
.color-blue .nickname { color: #4da6ff !important; }
.color-green .nickname { color: #4dff4d !important; }
.color-purple .nickname { color: #b84dff !important; }
.color-rainbow .nickname { background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* 缩小页面元素，增加留白 */
main {
    max-width: 1000px !important;
    margin: 1rem auto !important;
    padding: 0 1rem !important;
}
.card, .problem-item, .post-item, .stat-card, .submission-item, .rank-item, .message-item, .shop-item {
    padding: 0.8rem !important;
    margin-bottom: 0.8rem !important;
}
.hero {
    padding: 1.5rem !important;
    margin-bottom: 1rem !important;
}
.features {
    gap: 1rem !important;
}
.btn, button, .buy-btn {
    padding: 0.4rem 1rem !important;
    font-size: 0.9rem !important;
}
h1 {
    font-size: 1.8rem !important;
}
/* 缩小导航栏指引区域 */
nav {
    gap: 0.8rem !important;
}
nav a {
    padding: 0.3rem 0.7rem !important;
    font-size: 0.9rem !important;
}
/* 其他UI不变 */
/* 缩小指引文字（如.hero p, .card p等） */
.hero p, .card p, .btn, button, .buy-btn, .equip-btn {
    font-size: 0.85rem !important;
}
.hero h1 {
    font-size: 1.8rem !important;
}
.features .card h2 {
    font-size: 1.2rem !important;
}
