/* 学生端样式 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

#student-app {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    min-width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    margin: 0;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* 确保水平居中 */
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.login-header h1 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
}

.login-header p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

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

.form-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fcc;
    font-size: 14px;
    text-align: center;
}

/* 主应用样式 */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    min-width: 100vw;
    background: #f8f9fa;
    overflow-y: auto;
    margin: 0;
    position: relative;
}

/* 顶部导航 */
.student-header {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 32px;
    height: 32px;
}

.header-left h1 {
    color: #333;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.header-subtitle {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-info {
    color: #666;
    font-size: 14px;
}

.logout-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

/* 侧边导航 */
.student-nav {
    background: white;
    border-right: 1px solid #e1e5e9;
    width: 200px;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #333;
}

.nav-link.active {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
}

/* 主内容区域 */
.student-main {
    margin-left: 200px;
    padding: 30px;
    width: calc(100% - 200px);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    box-sizing: border-box;
    max-width: calc(100vw - 200px);
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.page-content h2 {
    color: #333;
    margin: 0 0 30px 0;
    font-size: 24px;
    font-weight: 600;
}

/* 仪表板样式 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-item .label {
    color: #666;
    font-weight: 500;
}

.score-value {
    font-weight: 600;
    color: #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item.violation .stat-number {
    color: #dc3545;
}

.stat-item.merit .stat-number {
    color: #28a745;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.recent-records {
    max-height: 300px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
}

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

.record-info {
    flex: 1;
}

.record-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.record-content {
    font-size: 12px;
    color: #666;
}

.record-score {
    font-weight: 600;
    margin-left: 10px;
}

.record-score.positive {
    color: #28a745;
}

.record-score.negative {
    color: #dc3545;
}

/* 个人信息样式 */
.profile-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-section {
    margin-bottom: 30px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* 操行记录样式 */
.records-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.records-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.btn-primary:hover {
    background: #5a6fd8;
}

.records-list {
    margin-bottom: 20px;
}

.record-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #ddd;
}

.record-card.violation {
    border-left-color: #dc3545;
}

.record-card.merit {
    border-left-color: #28a745;
}

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

.record-title {
    font-weight: 600;
    color: #333;
}

.record-score {
    font-weight: 700;
}

.record-score.positive {
    color: #28a745;
}

.record-score.negative {
    color: #dc3545;
}

.record-content {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.record-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 统计分析样式 */
.statistics-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.stat-card h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-content .stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* 加载样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .student-nav {
        width: 100%;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        height: auto;
        top: auto;
        bottom: auto;
    }
    
    .student-main {
        margin-left: 0;
        padding: 20px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .nav-menu {
        display: flex;
        padding: 10px 0;
        overflow-x: auto;
        margin: 0;
    }
    
    .nav-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 100px;
        text-align: center;
    }
    
    .nav-link.active {
        border-left: none;
        border-bottom-color: #667eea;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .records-filters {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .header-content {
        flex-direction: column;
        height: auto;
        gap: 10px;
        padding: 15px 0;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .student-info {
        font-size: 12px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .student-main {
        padding: 15px;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .header-subtitle {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .nav-menu {
        padding: 5px 0;
    }
    
    .nav-link {
        padding: 8px 15px;
        font-size: 12px;
        min-width: 80px;
    }
}
