/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.class-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-name span {
    font-size: 18px;
    font-weight: bold;
    color: #5a67d8;
}

.btn-batch {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-batch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: #718096;
}

#searchInput {
    padding: 10px 10px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    width: 250px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f7fafc;
}

#searchInput:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.nav-right {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* 主内容区域 */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 学生网格布局 */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 学生卡片 */
.student-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.student-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
}

.student-info {
    text-align: center;
    margin-bottom: 15px;
}

.student-name {
    font-size: 18px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.student-id {
    font-size: 12px;
    color: #718096;
}

/* 宠物容器 */
.pet-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    position: relative;
}

.pet-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.pet-image:hover {
    transform: scale(1.1) rotate(5deg);
}

.pet-mood {
    position: absolute;
    top: -5px;
    right: 20px;
    font-size: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 宠物状态栏 */
.pet-status {
    margin-top: 15px;
}

.status-bar {
    margin-bottom: 10px;
}

.status-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.status-label span:first-child {
    color: #4a5568;
    font-weight: 600;
}

.status-label span:last-child {
    color: #718096;
}

.status-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    transition: all 0.5s ease;
    border-radius: 10px;
}

.happiness-fill {
    background: linear-gradient(90deg, #FF6B6B, #FFD166);
}

.hunger-fill {
    background: linear-gradient(90deg, #06D6A0, #118AB2);
}

.health-fill {
    background: linear-gradient(90deg, #EF476F, #FF9A9E);
}

/* 操作按钮 */
.pet-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.feed-btn {
    background: linear-gradient(45deg, #06D6A0, #118AB2);
    color: white;
}

.play-btn {
    background: linear-gradient(45deg, #FF6B6B, #FFD166);
    color: white;
}

.heal-btn {
    background: linear-gradient(45deg, #EF476F, #FF9A9E);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    margin: 50px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 24px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #718096;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #e53e3e;
    transform: scale(1.1);
}

/* 小卖部样式 */
.store-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 25px;
}

.store-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.store-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.store-item:active {
    transform: scale(0.95);
}

.item-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.item-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.item-price {
    font-size: 14px;
    opacity: 0.9;
}

/* 光荣榜样式 */
.ranking-list {
    padding: 25px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 15px;
    background: linear-gradient(45deg, #f7fafc, #edf2f7);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateX(10px);
}

.rank-number {
    font-size: 24px;
    font-weight: bold;
    color: #5a67d8;
    margin-right: 15px;
}

.rank-number.top3 {
    color: #ffd700;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.rank-score {
    font-size: 14px;
    color: #718096;
}

.rank-pet {
    font-size: 30px;
}

/* 设置样式 */
.settings-content {
    padding: 25px;
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group h3 {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #5a67d8, #667eea);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2d3748;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* 宠物选择器 */
.pet-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pet-option {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pet-option:hover {
    transform: scale(1.05);
}

.pet-option.selected {
    box-shadow: 0 0 0 3px #5a67d8;
}

.pet-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* 宠物详情样式 */
.pet-detail-content {
    max-width: 500px;
}

.pet-detail {
    padding: 25px;
    text-align: center;
}

.detail-pet-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 0 auto 20px;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.detail-stats {
    text-align: left;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-label {
    font-weight: 600;
    color: #4a5568;
}

.stat-value {
    font-weight: bold;
    color: #5a67d8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    #searchInput {
        width: 100%;
    }

    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .modal-content {
        margin: 20px auto;
    }

    .store-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .students-grid {
        grid-template-columns: 1fr;
    }

    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn .btn-text {
        display: none;
    }

    .pet-actions {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    font-weight: bold;
}

.notification.success {
    border-left: 5px solid #06D6A0;
    color: #06D6A0;
}

.notification.error {
    border-left: 5px solid #EF476F;
    color: #EF476F;
}

.notification.info {
    border-left: 5px solid #5a67d8;
    color: #5a67d8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
