/* 班级积分银行管理系统 - 公共样式 */
/* 设计风格: iOS 26 UI + 多邻国App + iCost App + 磨玻璃 + 时尚渐变 + 椭圆形UI */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 - 绿色小清新 */
    --primary-green: #7ED321;
    --secondary-green: #9FE870;
    --accent-yellow: #F5D544;
    --dark-gray: #7fb3e8;
    --light-gray: #F8F9FA;
    
    /* 文字颜色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;
    
    /* 背景渐变 */
    --bg-gradient: linear-gradient(160deg, #f0f7ee 0%, #e6f3e7 100%);
    --btn-gradient: linear-gradient(135deg, #9FE870, #78c08d);
    --btn-gradient-hover: linear-gradient(135deg, #7ED321, #6ab52a);
    
    /* 磨玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: 10px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-btn: 0 4px 12px rgba(126, 211, 33, 0.3);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 50px;
    
    /* 动画时间 */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
    
    /* 字体 */
    --font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gradient);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-green);
}


/* ==================== 磨玻璃效果 ==================== */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

/* ==================== 容器布局 ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== 登录页面布局 ==================== */
.login-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    min-height: 500px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* 左侧Logo区域 */
.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--btn-gradient);
    color: var(--text-white);
    text-align: center;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.login-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 右侧表单区域 */
.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}


/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(126, 211, 33, 0.15);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input.error {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.05);
}

.form-error {
    display: none;
    font-size: 12px;
    color: #ff4757;
    margin-top: 6px;
    padding-left: 18px;
}

.form-error.show {
    display: block;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--btn-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: var(--btn-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 211, 33, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: rgba(126, 211, 33, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* ==================== 角色选择卡片 ==================== */
.role-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: var(--text-primary);
}

.role-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-green);
}

.role-card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    background: var(--btn-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-white);
}

.role-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.role-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}


/* ==================== 动画效果 ==================== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.4s ease-in forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

.slide-out-right {
    animation: slideOutRight 0.4s ease-in forwards;
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

/* ==================== 表单切换容器 ==================== */
.form-container {
    position: relative;
    overflow: hidden;
}

.form-panel {
    width: 100%;
}

.form-panel.hidden {
    display: none;
}

/* ==================== 链接和辅助文字 ==================== */
.form-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-green);
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ==================== 角色选择器 ==================== */
.role-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-option {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
}

.role-option:hover {
    background: rgba(126, 211, 33, 0.1);
    border-color: var(--secondary-green);
}

.role-option.active {
    background: rgba(126, 211, 33, 0.15);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.role-option input {
    display: none;
}

/* ==================== 扩展字段区域 ==================== */
.extend-fields {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.extend-fields.show {
    display: block;
}


/* ==================== 响应式布局 ==================== */
/* 移动端 (<=768px) */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        max-width: 400px;
        min-height: auto;
    }
    
    .login-left {
        padding: 30px 20px;
    }
    
    .login-logo {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .login-right {
        padding: 30px 20px;
    }
    
    .role-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .role-card {
        padding: 24px 16px;
    }
    
    .role-selector {
        flex-direction: column;
    }
    
    .role-option {
        min-width: auto;
    }
    
    .btn-lg {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* 平板 (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-container {
        max-width: 700px;
    }
    
    .login-left, .login-right {
        padding: 30px;
    }
}

/* 桌面端 (>1024px) */
@media (min-width: 1025px) {
    .login-container {
        max-width: 900px;
    }
}

/* ==================== 消息提示 ==================== */
.message {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.message-success {
    background: rgba(126, 211, 33, 0.15);
    color: #5a9f3a;
    border: 1px solid rgba(126, 211, 33, 0.3);
}

.message-error {
    background: rgba(255, 71, 87, 0.1);
    color: #d63031;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.message-info {
    background: rgba(127, 179, 232, 0.15);
    color: #2980b9;
    border: 1px solid rgba(127, 179, 232, 0.3);
}

/* ==================== 加载状态 ==================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 首页特殊样式 ==================== */
.index-header {
    text-align: center;
    margin-bottom: 20px;
}

.index-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: var(--btn-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: var(--text-white);
    box-shadow: var(--shadow-lg);
}

.index-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.index-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }
.visible { display: block !important; }
