/* 学生积分管理系统 - 移动端样式 */
:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --success: #52C41A;
    --danger: #FF4D4F;
    --warning: #FAAD14;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-light: #999999;
    --border: #E8E8E8;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

html {
    background: var(--primary);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

/* 页面头部 */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.page-header .back-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页面内容 */
.page-content {
    padding: 16px;
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* 标签按钮组 */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 分项选中态：保留原有颜色，用粗边框+阴影突出 */
.tag.item-active {
    border: 2px solid #333 !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.2);
    transform: scale(1.05);
    font-weight: 700;
}

.tag.selected {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* 输入框 */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: var(--primary);
}

/* 列表 */
.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:active {
    background: #f0f0f0;
}

.list-item .name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.list-item .score {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.list-item .score.positive {
    color: var(--success);
}

.list-item .score.zero {
    color: #999;
}

.list-item .score.negative {
    color: var(--danger);
}

.list-item .arrow {
    color: var(--text-light);
    margin-left: 8px;
}

/* 操作路径 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 0;
    flex-wrap: wrap;
}

.breadcrumb span {
    background: rgba(74, 144, 217, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary);
}

/* 已选学生列表 */
.selected-bar {
    position: sticky;
    top: 60px;
    z-index: 50;
    background: #E6F7FF;
    border: 1px solid #91D5FF;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.selected-bar .count {
    font-weight: 600;
    color: var(--primary);
}

.selected-students {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.selected-students .student-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    gap: 4px;
}

.selected-students .student-chip .remove {
    cursor: pointer;
    font-weight: bold;
}

/* 流水记录 */
.log-item {
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
}

.log-item.add {
    border-left-color: var(--success);
}

.log-item.deduct {
    border-left-color: var(--danger);
}

.log-item .log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-item .log-name {
    font-weight: 500;
}

.log-item .log-value {
    font-weight: 700;
    font-size: 16px;
}

.log-item .log-value.positive { color: var(--success); }
.log-item .log-value.negative { color: var(--danger); }

.log-item .log-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-bar .input {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* 登录页特殊样式 */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    padding-top: calc(40px + env(safe-area-inset-top));
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-page .login-box {
    background: white;
    border-radius: 20px;
    padding: 40px 28px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-page .login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 12px;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-item .nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* 分数大字 */
.score-big {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    padding: 20px 0;
}

/* 操作按钮组 */
.action-group {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.action-group .btn {
    flex: 1;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* 安全区域适配 */
.safe-bottom {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* 分项卡片 */
.score-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.score-item-card .item-info {
    flex: 1;
}

.score-item-card .item-name {
    font-weight: 500;
    font-size: 15px;
}

.score-item-card .item-value {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.score-item-card .item-actions {
    display: flex;
    gap: 8px;
}

.score-item-card .item-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 首页快速入口 */
.quick-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.quick-entry .entry-card {
    background: white;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.quick-entry .entry-card:active {
    transform: scale(0.96);
}

.quick-entry .entry-card .entry-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.quick-entry .entry-card .entry-text {
    font-size: 14px;
    font-weight: 500;
}

/* 选择模式的学生列表 */
.student-select-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.student-select-item.selected {
    border-color: var(--success);
    background: #f6ffed;
}

.student-select-item .checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.student-select-item.selected .checkbox {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.student-select-item .stu-name {
    flex: 1;
    font-size: 15px;
}

.student-select-item .stu-score {
    font-size: 14px;
    color: var(--text-light);
}

