* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Comic Neue', 'Comic Sans MS', 'Poppins', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 导航栏 */
.nav-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-title h1 {
    font-size: 1.5rem;
    color: #333;
}

.nav-title p {
    font-size: 0.8rem;
    color: #666;
}

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 8px 18px;
    background: #f0f0f0;
    border-radius: 25px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .nav-bar {
        flex-direction: column;
        text-align: center;
    }
    .nav-links {
        justify-content: center;
    }
}

/* 卡片 */
.card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 金字塔网格 */
.pyramid-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.pyramid-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 小组卡片 */
.group-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-radius: 20px;
    padding: 18px;
    width: 280px;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    position: relative;
    cursor: pointer;
}

@media (max-width: 768px) {
    .group-card {
        width: 100%;
        max-width: 320px;
    }
}

.group-card.rank-1 {
    border: 3px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.group-card.rank-2, .group-card.rank-3 {
    border: 2px solid #c0c0c0;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

.group-card.rank-4, .group-card.rank-5, .group-card.rank-6 {
    border: 2px solid #cd7f32;
}

.group-avatar {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 10px;
}

.group-name {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    color: #333;
}

.group-type-badge {
    display: inline-block;
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    margin-left: 8px;
    vertical-align: middle;
}

.group-score {
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.7rem;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

.weekly-score {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin: 8px 0;
}

.medals {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.medal-icon {
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.medal-icon:hover {
    transform: scale(1.1);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-success {
    background: #51cf66;
    color: white;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* 加载和消息 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: #888;
}

.empty-state div {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* 宠物图片样式 */
.pet-image {
    width: 70px;
    height: auto;
    border-radius: 15px;
    transition: transform 0.3s;
    background: #f5f5f5;
}

.pet-image:hover {
    transform: scale(1.05);
}

.pet-image-small {
    width: 40px;
    height: auto;
    border-radius: 10px;
}

.pet-image-large {
    width: 100px;
    height: auto;
    border-radius: 20px;
}

/* 进化名称样式 */
.evolution-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-top: 5px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f0f0ff, #fff);
    border-radius: 20px;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}