/* 学生端样式 - 薄荷绿主色调,圆角,轻量游戏化 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    font-size: 14px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e8ecef;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    position: sticky; top: 0; height: 100vh;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .logo-name,
.sidebar.collapsed .menu-item a span:not([class^="icon-"]),
.sidebar.collapsed .sidebar-footer span { display: none; }

.logo {
    padding: 20px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid #f0f2f5;
}
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.logo-text {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 16px;
}
.logo-name { font-size: 16px; font-weight: 600; color: #1f2937; }

.menu { flex: 1; padding: 8px; }
.menu-item { margin: 2px 0; }
.menu-item a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: #4b5563; font-size: 14px;
    transition: all 0.2s;
}
.menu-item a:hover { background: #f0fdf4; color: #16a34a; }
.menu-item.active a { background: #dcfce7; color: #15803d; font-weight: 500; }

.sidebar-footer {
    padding: 12px; text-align: center;
    color: #9ca3af; font-size: 12px;
    cursor: pointer; border-top: 1px solid #f0f2f5;
}

/* 顶栏 */
.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    height: 56px; background: #fff;
    border-bottom: 1px solid #e8ecef;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.breadcrumb { color: #6b7280; font-size: 14px; }
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #16a34a; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-menu {
    position: relative; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 8px;
}
.user-menu:hover { background: #f3f4f6; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
}
.dropdown {
    position: absolute; top: 100%; right: 0;
    background: #fff; border: 1px solid #e8ecef;
    border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 160px; padding: 4px 0; margin-top: 4px;
}
.dropdown a {
    display: block; padding: 8px 16px;
    color: #4b5563; font-size: 14px;
}
.dropdown a:hover { background: #f0fdf4; color: #16a34a; }

/* 内容区 */
.content { flex: 1; padding: 24px; }

/* 卡片 */
.card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f0f2f5;
    padding: 20px; margin-bottom: 16px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; color: #1f2937; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    border: none; cursor: pointer;
    font-size: 14px; transition: all 0.2s;
}
.btn-primary { background: #22c55e; color: #fff; }
.btn-primary:hover { background: #16a34a; }
.btn-outline { background: #fff; color: #22c55e; border: 1px solid #22c55e; }
.btn-outline:hover { background: #f0fdf4; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn:disabled { background: #d1d5db; cursor: not-allowed; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; color: #4b5563; font-size: 14px; }
.form-label .required { color: #ef4444; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 8px 12px;
    border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; transition: border 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: #22c55e;
}
.form-textarea { min-height: 80px; resize: vertical; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid #f0f2f5; font-size: 14px;
}
.table th { background: #fafbfc; color: #6b7280; font-weight: 500; }
.table tr:hover td { background: #fafbfc; }

/* 标签 */
.tag {
    display: inline-block; padding: 2px 8px;
    border-radius: 4px; font-size: 12px;
    background: #f0fdf4; color: #16a34a;
}
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-orange { background: #fff7ed; color: #ea580c; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-red { background: #fef2f2; color: #dc2626; }

/* 分页 */
.pagination { display: flex; gap: 4px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 6px 12px; border: 1px solid #e8ecef;
    border-radius: 4px; color: #4b5563; font-size: 14px;
}
.pagination .active { background: #22c55e; color: #fff; border-color: #22c55e; }

/* 登录页 */
.login-container {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.login-box {
    display: flex; max-width: 900px; min-height: 480px;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.login-left {
    flex: 1; background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center;
}
.login-left h1 { font-size: 28px; margin-bottom: 16px; }
.login-right { flex: 1; padding: 48px; }

/* Dashboard 卡片 */
.welcome-card {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff; border-radius: 12px; padding: 24px;
    margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 16px;
    border: 1px solid #f0f2f5;
}
.stat-card .label { color: #6b7280; font-size: 12px; margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 600; color: #1f2937; }

/* 答题页 */
.exam-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.question-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.question-nav button {
    width: 36px; height: 36px; border: 1px solid #e8ecef;
    background: #fff; border-radius: 6px; cursor: pointer;
}
.question-nav button.answered { background: #dcfce7; border-color: #22c55e; color: #16a34a; }
.question-nav button.current { background: #22c55e; color: #fff; border-color: #22c55e; }

/* 代码编辑器区域 */
.code-editor-container { display: flex; gap: 16px; }
.code-editor-left { flex: 1; }
.code-editor-right { width: 360px; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 100; transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .login-box { flex-direction: column; max-width: 400px; }
    .login-left { padding: 24px; min-height: 120px; }
}
