/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4f46e5;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --error: #ef4444;
    --radius: 12px;
    --shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    backdrop-filter: blur(10px);
}

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

.system-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.role-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.role-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    color: #64748b;
}

.role-tab.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: var(--primary);
    font-weight: 600;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #334155;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon span {
    position: absolute;
    left: 15px;
    font-size: 1.1rem;
}

.input-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(79,70,229,0.5);
}

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

.alert-error {
    background: #fef2f2;
    color: var(--error);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

/* 管理后台布局 */
.admin-body {
    margin: 0;
    padding: 0;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    font-size: 2rem;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    gap: 10px;
    position: relative;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
}

.sidebar-nav li.active > a {
    background: var(--sidebar-active);
    font-weight: 500;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.has-submenu.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.has-submenu.open .submenu {
    max-height: 200px;
}

.submenu a {
    padding-left: 55px;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

/* 内容区域 */
.admin-content {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
    min-height: 100vh;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.content-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    color: #64748b;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.content-placeholder h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #334155;
}

/* 教师/学生面板 */
.user-body {
    background: #f8fafc;
}

.user-panel {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-outline {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #334155;
    transition: var(--transition);
}

.btn-outline:hover {
    background: #f1f5f9;
}