/* ==================== 班级宠物养成 - 样式表 ==================== */

/* CSS Variables - 亮色主题 (默认) */
:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd1;
    --success: #00b894;
    --success-light: #55efc4;
    --warning: #fdcb6e;
    --warning-dark: #f39c12;
    --danger: #e17055;
    --danger-light: #fab1a0;
    --info: #74b9ff;
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-dark: #2d3436;
    --bg-input: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #dfe6e9;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --font-main: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --splash-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --scrollbar-track: #f0f2f5;
    --scrollbar-thumb: #b2bec3;
    --modal-overlay: rgba(0,0,0,0.5);
    --code-bg: #f5f5f5;
}

/* 暗色主题 */
[data-theme="dark"] {
    --primary: #8b7cf7;
    --primary-light: #b8b0ff;
    --primary-dark: #7c6ce0;
    --success: #00d2a0;
    --success-light: #55efc4;
    --warning: #fdd982;
    --warning-dark: #f0a500;
    --danger: #ff7b6b;
    --danger-light: #ff9f95;
    --info: #82c4ff;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-dark: #0a0a14;
    --bg-input: #16162a;
    --text: #e4e4f0;
    --text-light: #a0a0b8;
    --text-muted: #5a5a74;
    --border: #2a2a44;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
    --splash-gradient: linear-gradient(135deg, #1a1a3e 0%, #2a1a4e 100%);
    --hero-gradient: linear-gradient(135deg, #2a1a5e 0%, #3a1a6e 100%);
    --scrollbar-track: #0f0f1a;
    --scrollbar-thumb: #3a3a54;
    --modal-overlay: rgba(0,0,0,0.7);
    --code-bg: #1e1e30;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== Splash Screen ==================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-pet {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.splash-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.splash-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.splash-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.splash-buttons .btn-outline {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.6);
    color: white;
    backdrop-filter: blur(4px);
}

.splash-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning-dark);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-light);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 1.1rem;
    border-radius: var(--radius);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.2rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    gap: 12px;
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: var(--transition);
    background: var(--bg-card);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

textarea {
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 12px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ==================== Setup Steps ==================== */
.setup-step {
    display: none;
}

.setup-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.setup-step h3 {
    margin-bottom: 16px;
    color: var(--primary);
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Pet Type Selection */
.pet-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.pet-type-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.pet-type-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.pet-type-card.selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.pet-emoji {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.pet-type-card h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.pet-type-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.group-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.group-preview-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.group-preview-item h4 {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.group-preview-item p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==================== App Container ==================== */
.app-container {
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    background: white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-main);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: var(--text-light);
    white-space: nowrap;
}

.nav-tab:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-teacher {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.card-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 1rem;
}

/* ==================== Dashboard ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card-hero {
    grid-column: 1 / -1;
}

/* Pet Display */
.pet-display {
    text-align: center;
    padding: 20px 0;
}

.pet-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    border-radius: 50%;
    background: transparent;
}

.pet-avatar.large {
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
}

.pet-avatar-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    border-radius: 0;
    animation: eggWobble 3s ease-in-out infinite;
}

.pet-avatar.large .pet-avatar-img {
    width: 85%;
    height: 85%;
}

.pet-avatar.xlarge .pet-avatar-img {
    width: 85%;
    height: 85%;
}

.pet-avatar.xlarge {
    width: 140px;
    height: 140px;
    font-size: 5rem;
    background: transparent;
}

.pet-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 8px;
}

.pet-type-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* Pet Stats */
.pet-stats {
    max-width: 500px;
    margin: 0 auto;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.85rem;
    min-width: 80px;
}

.progress {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: hidden;
}

.card:not(.card-hero) .progress {
    background: var(--bg);
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-bar.hp {
    background: linear-gradient(90deg, #e17055, #fd79a8);
}

.progress-bar.exp {
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
}

.progress-bar.food {
    background: linear-gradient(90deg, #fdcb6e, #f39c12);
}

.stat-value {
    font-size: 0.8rem;
    min-width: 60px;
    text-align: right;
}

/* Pet Actions */
.pet-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.pet-actions .btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.pet-actions .btn:hover {
    background: rgba(255,255,255,0.35);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: center;
}

.stat-item {
    padding: 12px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Quick Ops */
.quick-ops {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.quick-op-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text);
}

.quick-op-btn:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
    transform: translateY(-2px);
}

.quick-icon {
    font-size: 1.5rem;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.2rem;
}

.activity-text {
    flex: 1;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

/* ==================== Section Headers ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* ==================== Students ==================== */
.students-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.students-toolbar select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-main);
    background: white;
}

.students-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: rgba(108, 92, 231, 0.03);
}

.data-table .actions-cell {
    display: flex;
    gap: 6px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning-dark);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* ==================== Pet Detail ==================== */
.pet-detail-card {
    display: flex;
    gap: 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
}

.pet-detail-left {
    text-align: center;
    flex-shrink: 0;
}

.pet-mood {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pet-detail-right {
    flex: 1;
}

.pet-detail-right h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.pet-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pet-info-item {
    background: var(--bg);
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
}

.pet-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Evolution Path */
.evolution-path {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
    overflow-x: auto;
    justify-content: center;
}

.evo-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    min-width: 100px;
    transition: var(--transition);
}

.evo-stage.current {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.evo-stage.completed {
    border-color: var(--success);
    background: rgba(0, 184, 148, 0.05);
}

.evo-stage.locked {
    opacity: 0.5;
}

.evo-emoji {
    font-size: 2rem;
}

.evo-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.evo-level {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.evo-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Pet Gallery */
.pet-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.pet-gallery-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.pet-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.pet-gallery-item .pet-avatar {
    margin-bottom: 8px;
}

.pet-gallery-item .pet-name {
    font-size: 1rem;
}

.pet-gallery-item .pet-owner {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== Tasks ==================== */
.task-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-cat-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-main);
    transition: var(--transition);
}

.task-cat-btn:hover {
    border-color: var(--primary);
}

.task-cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.task-list {
    display: grid;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.task-item:hover {
    background: rgba(108, 92, 231, 0.05);
}

.task-icon {
    font-size: 1.5rem;
}

.task-info {
    flex: 1;
}

.task-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.task-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.task-reward {
    text-align: right;
}

.task-points {
    font-weight: 700;
    color: var(--warning-dark);
    font-size: 0.95rem;
}

.task-food {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-actions {
    display: flex;
    gap: 6px;
}

/* ==================== Ranking ==================== */
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.ranking-tab {
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition);
}

.ranking-tab:hover {
    border-color: var(--primary);
}

.ranking-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.ranking-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 30px;
    padding: 20px;
}

.podium-item {
    text-align: center;
    border-radius: var(--radius);
    padding: 20px 24px;
    min-width: 120px;
}

.podium-item.gold {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: white;
    transform: translateY(-20px);
}

.podium-item.silver {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: white;
}

.podium-item.bronze {
    background: linear-gradient(135deg, #cd7f32, #b8722e);
    color: white;
}

.podium-rank {
    font-size: 2rem;
    font-weight: 700;
}

.podium-avatar {
    font-size: 2.5rem;
    margin: 8px 0;
}

.podium-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.podium-score {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 4px;
}

.ranking-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ranking-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.ranking-row:hover {
    background: rgba(108, 92, 231, 0.03);
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-num {
    width: 40px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ranking-num.top {
    color: var(--warning-dark);
}

.ranking-name {
    flex: 1;
    font-weight: 500;
}

.ranking-score {
    font-weight: 700;
    color: var(--primary);
    min-width: 80px;
    text-align: right;
}

.ranking-badge {
    min-width: 60px;
    text-align: center;
}

/* ==================== Teams ==================== */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.team-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

.team-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.team-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.team-pet {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.team-pet-avatar {
    font-size: 2rem;
}

.team-pet-info {
    flex: 1;
}

.team-pet-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.team-pet-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.team-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.member-tag {
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.team-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--warning-dark);
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.warning {
    border-left-color: var(--warning-dark);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast-icon {
    font-size: 1.3rem;
}

.toast-message {
    font-size: 0.9rem;
    flex: 1;
}

/* ==================== Particles ==================== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.particle {
    position: absolute;
    font-size: 1.5rem;
    animation: particleFloat 1.5s ease-out forwards;
    pointer-events: none;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0.3);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(108, 92, 231, 0.3); }
    50% { box-shadow: 0 0 20px rgba(108, 92, 231, 0.6); }
}

@keyframes levelUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.animate-bounce {
    animation: bounce 0.5s ease;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.animate-glow {
    animation: glow 1s ease infinite;
}

.animate-levelup {
    animation: levelUp 0.6s ease;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .pet-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-ops {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .nav-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pet-detail-card {
        flex-direction: column;
        align-items: center;
    }

    .pet-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-item.gold {
        transform: none;
        order: -1;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .pet-selection {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-ops {
        grid-template-columns: repeat(2, 1fr);
    }

    .splash-content h1 {
        font-size: 1.8rem;
    }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ==================== Print Styles ==================== */
@media print {
    .top-nav, .pet-actions, .section-actions, .quick-ops, .btn {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}

/* ==================== Utility ==================== */
.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* Student point change animation */
.point-change {
    position: absolute;
    font-weight: 700;
    font-size: 1.1rem;
    animation: pointFloat 1s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

.point-change.positive {
    color: var(--success);
}

.point-change.negative {
    color: var(--danger);
}

@keyframes pointFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

/* Evolution animation overlay */
.evolution-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    flex-direction: column;
    gap: 20px;
}

.evolution-overlay .evo-text {
    color: #ffd700;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: glow 1s ease infinite;
}

.evolution-overlay .evo-pet {
    font-size: 6rem;
    animation: bounce 1s ease infinite;
}

.evolution-overlay .evo-subtitle {
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* PK Mode */
.pk-panel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px;
}

.pk-player {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
}

.pk-vs {
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger);
}

.pk-player-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 8px;
}

.pk-player-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* Checkin calendar */
.checkin-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.checkin-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.checkin-day.checked {
    background: var(--success);
    color: white;
}

.checkin-day.missed {
    background: var(--bg);
    color: var(--text-muted);
}

.checkin-day.today {
    border: 2px solid var(--primary);
}

/* Student selector */
.student-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.student-select-item {
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.student-select-item:hover {
    border-color: var(--primary);
}

.student-select-item.selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
}

/* ==================== Random Rolling Animation ==================== */
.random-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    gap: 24px;
}

.random-overlay .random-title {
    color: #ffd700;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation: glow 1s ease infinite;
}

.random-slot-container {
    width: 360px;
    height: 120px;
    border-radius: var(--radius);
    border: 3px solid var(--primary-light);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(108,92,231,0.3), inset 0 0 20px rgba(108,92,231,0.1);
}

.random-display-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: opacity 0.05s ease;
    user-select: none;
}

.random-display-name.name-pop {
    animation: nameFlip 0.12s ease;
}

@keyframes nameFlip {
    0% { transform: translateY(-8px); opacity: 0.3; }
    50% { transform: translateY(2px); opacity: 0.9; }
    100% { transform: translateY(0); opacity: 1; }
}

.random-stop-btn {
    padding: 12px 48px;
    font-size: 1.1rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #e17055, #d63031);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4);
    animation: pulseStop 1.5s ease infinite;
}

.random-stop-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(214, 48, 49, 0.6);
}

@keyframes pulseStop {
    0%, 100% { box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(214, 48, 49, 0.7); }
}

.random-result {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: resultBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.random-result .result-name {
    background: linear-gradient(135deg, #ffd700, #ffec8b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.random-result .result-emoji {
    font-size: 3.5rem;
}

.random-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    letter-spacing: 1px;
}

@keyframes resultBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.random-close-btn {
    margin-top: 16px;
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    transition: var(--transition);
}

.random-close-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ==================== Compact Table for 60 Students ==================== */
.data-table.compact td {
    padding: 8px 12px;
    font-size: 0.82rem;
}

.data-table.compact th {
    padding: 8px 12px;
    font-size: 0.8rem;
}

.data-table.compact .actions-cell .btn {
    padding: 3px 8px;
    font-size: 0.75rem;
}

.students-table-container.compact {
    max-height: 70vh;
    overflow-y: auto;
}

/* ==================== Search Highlight ==================== */
.search-highlight {
    background: rgba(253, 203, 110, 0.4);
    border-radius: 2px;
    padding: 0 2px;
}

/* ==================== Compact Student Selector for 60 ==================== */
.student-selector.compact {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    max-height: 400px;
}

.student-selector.compact .student-select-item {
    padding: 6px 4px;
    font-size: 0.78rem;
}

/* ==================== Manual Grouping ==================== */
.manual-group-unassigned {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
}
.manual-group-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}
.manual-student-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.manual-student-tag:hover {
    border-color: var(--primary);
}
.manual-student-tag.selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}
.manual-student-tag.assigned {
    background: rgba(108, 92, 231, 0.08);
    border-color: var(--primary-light);
}
.manual-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.manual-group-zone {
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-height: 80px;
    cursor: pointer;
    transition: var(--transition);
}
.manual-group-zone:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.03);
}
.manual-group-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--primary);
}
.manual-group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ==================== Data Import/Export Modal ==================== */
.import-export-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin: 16px 0;
}

.import-export-area:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.03);
}

.import-export-area .ie-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.import-export-area .ie-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.import-export-area .ie-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 6px;
}

/* ==================== Member Tags Compact ==================== */
.team-members.compact .member-tag {
    padding: 2px 8px;
    font-size: 0.72rem;
}

/* ==================== Ranking Compact for 60 ==================== */
.ranking-row.compact {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.ranking-row.compact .ranking-num {
    width: 30px;
    font-size: 0.8rem;
}

.ranking-list.compact {
    max-height: 60vh;
    overflow-y: auto;
}

/* ==================== 暗色主题组件覆盖 ==================== */
[data-theme="dark"] .splash-screen {
    background: linear-gradient(135deg, #1a1a3e 0%, #2a1a5e 50%, #1a2a4e 100%);
}

[data-theme="dark"] .splash-content h1 {
    text-shadow: 0 0 30px rgba(139, 124, 247, 0.4);
}

[data-theme="dark"] .top-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .card-hero {
    background: linear-gradient(135deg, #2a1a5e 0%, #3a1a6e 50%, #1a2a5e 100%);
}

[data-theme="dark"] .pet-avatar.xlarge {
    background: transparent;
}

[data-theme="dark"] .modal {
    background: var(--modal-overlay);
}

[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="number"],
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 124, 247, 0.15);
}

[data-theme="dark"] .search-input {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .students-toolbar select {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .data-table tr:hover td {
    background: rgba(139, 124, 247, 0.06);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--border);
    color: var(--text-light);
}

[data-theme="dark"] .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 124, 247, 0.08);
}

[data-theme="dark"] .task-item:hover {
    background: rgba(139, 124, 247, 0.06);
}

[data-theme="dark"] .ranking-row:hover {
    background: rgba(139, 124, 247, 0.06);
}

[data-theme="dark"] .quick-op-btn {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .quick-op-btn:hover {
    border-color: var(--primary);
    background: rgba(139, 124, 247, 0.08);
}

[data-theme="dark"] .pet-type-card {
    border-color: var(--border);
    background: transparent;
}

[data-theme="dark"] .pet-type-card.selected {
    border-color: var(--primary);
    background: rgba(139, 124, 247, 0.08);
    box-shadow: 0 0 0 3px rgba(139, 124, 247, 0.15);
}

[data-theme="dark"] .pet-type-card:hover {
    border-color: var(--primary-light);
}

[data-theme="dark"] .modal-close {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .toast {
    background: var(--bg-card);
    color: var(--text);
}

[data-theme="dark"] .import-export-area:hover {
    background: rgba(139, 124, 247, 0.05);
}

[data-theme="dark"] .manual-group-zone:hover {
    background: rgba(139, 124, 247, 0.05);
}

[data-theme="dark"] .student-select-item {
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .student-select-item.selected {
    border-color: var(--primary);
    background: rgba(139, 124, 247, 0.12);
}

[data-theme="dark"] .evo-stage {
    border-color: var(--border);
}

[data-theme="dark"] .evo-stage.current {
    background: rgba(139, 124, 247, 0.08);
}

[data-theme="dark"] .manual-student-tag {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .search-highlight {
    background: rgba(253, 217, 130, 0.3);
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    transform: rotate(30deg);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

/* 主题切换下拉菜单 */
.theme-dropdown {
    position: relative;
    display: inline-flex;
}

.theme-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 200;
    overflow: hidden;
    animation: fadeIn 0.15s ease;
}

.theme-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    font-family: var(--font-main);
    text-align: left;
}

.theme-dropdown-item:hover {
    background: rgba(108, 92, 231, 0.06);
}

.theme-dropdown-item.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(108, 92, 231, 0.06);
}

.theme-dropdown-item .check-icon {
    margin-left: auto;
    font-size: 0.8rem;
}

/* ==================== 重构版新增样式 ==================== */

/* 班级宠物统计摘要 */
.pet-stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 16px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stat-mini {
    text-align: center;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
}

.stat-mini-val {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-mini-label {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 2px;
}

/* Top3 宠物展示 */
.top-pets-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.top-pet-card {
    text-align: center;
    padding: 14px 18px;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    min-width: 100px;
}

.top-pet-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.top-pet-rank {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.top-pet-img {
    width: 64px;
    height: 64px;
    border-radius: 0;
    object-fit: contain;
    margin-bottom: 6px;
    border: none;
    background: transparent;
}

.top-pet-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.top-pet-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 学生宠物缩略图 */
.student-pet-thumb {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    object-fit: contain;
    vertical-align: middle;
    border: none;
}

/* 宠物画廊增强 */
.pet-gallery-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.pet-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.pet-gallery-img {
    width: 96px;
    height: 96px;
    border-radius: 0;
    object-fit: contain;
    margin-bottom: 8px;
    border: none;
    background: transparent;
}

.pet-gallery-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.pet-gallery-type {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

.pet-gallery-level {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
}

.pet-gallery-mood {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.pet-gallery-exp-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.pet-gallery-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 小组宠物迷你展示 */
.team-pets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.team-pet-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.team-pet-mini:hover {
    background: rgba(108, 92, 231, 0.08);
}

.team-pet-mini img {
    width: 22px;
    height: 22px;
    border-radius: 2px;
    object-fit: contain;
}

.team-pet-lv {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.7rem;
}

/* 神秘蛋样式 */
.pet-gallery-egg {
    border: 2px dashed var(--primary-light);
    background: linear-gradient(135deg, var(--bg) 0%, rgba(108, 92, 231, 0.05) 100%);
    animation: eggWobble 3s ease-in-out infinite;
}

.pet-gallery-egg:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    animation: none;
    transform: translateY(-3px) scale(1.03);
}

.pet-gallery-egg .pet-gallery-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    animation: eggGlow 2s ease-in-out infinite alternate;
}

@keyframes eggWobble {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

@keyframes eggGlow {
    0% { box-shadow: 0 0 4px rgba(108, 92, 231, 0.15); }
    100% { box-shadow: 0 0 12px rgba(108, 92, 231, 0.35); }
}

/* 破壳动画 */
@keyframes hatchCrack {
    0% { transform: scale(1); }
    20% { transform: scale(1.15) rotate(-5deg); }
    40% { transform: scale(0.95) rotate(5deg); }
    60% { transform: scale(1.1) rotate(-3deg); }
    80% { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0); }
}

.animate-hatch {
    animation: hatchCrack 0.8s ease;
}

/* 响应式补充 */
@media (max-width: 768px) {
    .pet-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-pets-row {
        flex-direction: column;
        align-items: center;
    }

    .pet-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
