/* ClassPet Pro - 手机管理端样式 v4 - 现代化设计 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* 顶部 */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(15px, 4vw, 25px) 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.admin-header h1 {
    font-size: 20px;
    margin-bottom: 10px;
}

.header-info {
    display: flex;
    gap: 15px;
    font-size: 14px;
    opacity: 0.9;
}

.btn-back {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.btn-back:active {
    background: rgba(255,255,255,0.3);
}

/* 快捷操作 */
.quick-actions {
    background: rgba(255, 255, 255, 0.95);
    margin: 15px;
    padding: clamp(15px, 3vw, 25px);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.quick-actions h2 {
    font-size: clamp(16px, 2vw, 18px);
    margin-bottom: clamp(12px, 2vw, 18px);
    color: #333;
    font-weight: 700;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(8px, 2vw, 12px);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(15px, 3vw, 20px) 10px;
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
    width: 200px;
    height: 200px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    background: white;
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn .icon {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: clamp(6px, 1.5vw, 10px);
}

.action-btn .label {
    font-size: clamp(11px, 1.5vw, 13px);
    color: #666;
    font-weight: 600;
}

/* 统计报表 */
.stats-section {
    background: white;
    margin: 15px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stats-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stats-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 12px;
}

.stats-icon {
    width: clamp(45px, 6vw, 55px);
    height: clamp(45px, 6vw, 55px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    font-size: clamp(22px, 3.5vw, 28px);
    margin-right: clamp(10px, 2vw, 14px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stats-info {
    flex:1;
}

.stats-value {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    font-size: clamp(10px, 1.5vw, 12px);
    color: #666;
    margin-top: 2px;
    font-weight: 500;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.chart-container h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.chart-canvas {
    width: 100%;
    height: 250px;
    border-radius: 8px;
}

.top-students-section {
    margin-top: 20px;
}

.top-students-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.top-students-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-student-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.student-rank {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    margin-right: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.top-student-item:nth-child(1) .student-rank {
    background: #ffd700;
}

.top-student-item:nth-child(2) .student-rank {
    background: #c0c0c0;
}

.top-student-item:nth-child(3) .student-rank {
    background: #cd7f32;
}

.top-student-item .student-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
    margin-right: 12px;
}

.top-student-item .student-info {
    flex: 1;
}

.top-student-item .student-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.top-student-item .student-stage {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.top-student-item .student-score {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

/* 响应式 - 大屏设备 */
@media (min-width: 768px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 学生列表 */
.student-list-section {
    background: white;
    margin: 15px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.section-header h2 {
    font-size: 16px;
    color: #333;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    width: 120px;
}

.search-box button {
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* 学生列表项 */
.student-list {
    max-height: 400px;
    overflow-y: auto;
}

.student-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.student-item:last-child {
    border-bottom: none;
}

.student-item:active {
    background: #f8f9fa;
}

.student-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 12px;
}

.student-info {
    flex: 1;
}

.student-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.student-meta {
    font-size: 13px;
    color: #999;
}

.student-score {
    text-align: right;
}

.score-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.stage-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

.stage-egg { background: #FFE4B5; color: #8B6914; }
.stage-baby { background: #98FB98; color: #228B22; }
.stage-young { background: #87CEEB; color: #1E90FF; }
.stage-adult { background: #DDA0DD; color: #8B008B; }

/* 弹窗 */
.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: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
    overflow-y: auto;
}

.modal-large {
    max-height: 95vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    font-size: 28px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.stage-display {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

/* 批量选择 */
.student-select-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.select-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.select-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.select-all {
    padding: 12px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.select-all input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* 分数输入 */
.score-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-score-preset {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.btn-score-preset.active {
    background: #667eea;
    color: white;
}

.score-input-group input {
    width: 100px;
    text-align: center;
}

/* 设置标签页 */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 阶段设置 */
.stage-setting-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.stage-emoji {
    font-size: 32px;
    margin-right: 12px;
}

.stage-info {
    flex: 1;
}

.stage-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.stage-threshold {
    font-size: 13px;
    color: #999;
}

.stage-setting-item input {
    width: 80px;
    text-align: center;
}

/* 奖励设置 */
.reward-setting-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.reward-info {
    flex: 1;
}

.reward-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.reward-cost {
    font-size: 13px;
    color: #667eea;
}

.btn-add {
    width: 100%;
    padding: 14px;
    border: 2px dashed #ddd;
    background: white;
    color: #666;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* 导出选项 */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.export-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn .icon {
    font-size: 32px;
    margin-right: 15px;
}

.export-btn span:last-child {
    font-size: 16px;
    color: #333;
}

.export-btn:active {
    background: #e9ecef;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
