/* 后台管理样式 */

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

/* 登录页 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.login-box h2 {
    font-size: 16px;
    color: #666;
    margin-bottom: 32px;
    font-weight: normal;
}

.login-box input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar .logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo h3 {
    font-size: 20px;
    margin: 0;
}

.menu {
    flex: 1;
    padding: 16px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.menu-item span {
    margin-right: 12px;
    font-size: 20px;
}

.user-info {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    background: #f5f7fa;
    min-height: 100vh;
}

.top-bar {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
}

.top-bar h2 {
    font-size: 20px;
    margin: 0;
}

.content-area {
    padding: 24px;
}

/* 数据卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h4 {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-card .change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-card .change.up {
    color: #52c41a;
}

.stat-card .change.down {
    color: #ff4d4f;
}

/* 表格 */
.data-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}

.data-table tr:hover {
    background: #fafafa;
}

/* 按钮 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

/* 筛选栏 */
.filter-bar {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-bar .search-input {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.filter-bar .filter-select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-0 { background: #fff7e6; color: #fa8c16; }
.status-1 { background: #f6ffed; color: #52c41a; }
.status-2 { background: #e6f7ff; color: #1890ff; }
.status-3 { background: #f5f5f5; color: #999; }
.status-4 { background: #fff1f0; color: #ff4d4f; }

/* 系统设置 */
.settings-container {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 16px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e8e8e8;
}

.tab-btn.active {
    background: #667eea;
    color: #fff;
}

.settings-content {
    min-height: 300px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

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

.form-group input {
    width: 100%;
    max-width: 500px;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group .help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.settings-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}


/* ========== AI 出题 / AI 整卷 ========== */
.ai-tabs { display:flex; gap:0; border-bottom:2px solid #667eea; margin-bottom:24px; }
.ai-tabs .tab-btn { padding:10px 24px; border:none; background:transparent; color:#666; cursor:pointer; font-size:14px; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .2s; }
.ai-tabs .tab-btn:hover { color:#667eea; }
.ai-tabs .tab-btn.active { color:#667eea; border-bottom-color:#667eea; font-weight:600; }

.ai-form { background:#fff; border-radius:12px; padding:28px; box-shadow:0 2px 12px rgba(0,0,0,.06); margin-bottom:24px; }
.ai-form h3 { font-size:20px; color:#333; }
.ai-form .form-row { display:flex; gap:20px; margin-bottom:16px; flex-wrap:wrap; }
.ai-form .form-row:last-child { margin-bottom:0; }
.ai-form .form-group { flex:1; min-width:180px; }
.ai-form .form-group label { display:block; margin-bottom:6px; font-size:13px; color:#666; font-weight:500; }
.ai-form .form-input { width:100%; padding:8px 12px; border:1px solid #d9d9d9; border-radius:6px; font-size:14px; color:#333; box-sizing:border-box; }
.ai-form .form-input:focus { border-color:#667eea; outline:none; box-shadow:0 0 0 2px rgba(102,126,234,.1); }
.ai-form input[type="range"] { padding:0; border:none; }

.ai-spinner { width:48px; height:48px; border:4px solid #e8e8e8; border-top-color:#667eea; border-radius:50%; animation:ai-spin .8s linear infinite; margin:0 auto; }
@keyframes ai-spin { to { transform:rotate(360deg); } }

.ai-question-card { background:#fff; border-radius:10px; padding:20px; margin-bottom:16px; box-shadow:0 1px 8px rgba(0,0,0,.04); border:1px solid #f0f0f0; }
.ai-question-card .q-header { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.ai-question-card .q-num { background:#667eea; color:#fff; border-radius:50%; width:28px; height:28px; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; flex-shrink:0; }
.ai-question-card .q-type.tag { background:#e6f7ff; color:#1890ff; padding:2px 8px; border-radius:4px; font-size:12px; }
.ai-question-card .q-diff.tag { background:#fff7e6; color:#fa8c16; padding:2px 8px; border-radius:4px; font-size:12px; }
.ai-question-card .q-score.tag { background:#f6ffed; color:#52c41a; padding:2px 8px; border-radius:4px; font-size:12px; }
.ai-question-card .q-source.tag { padding:2px 8px; border-radius:4px; font-size:12px; }
.ai-question-card .tag-ai { background:#f0e6ff; color:#7b61ff; }
.ai-question-card .q-content { font-size:15px; line-height:1.7; color:#333; margin-bottom:12px; }
.ai-question-card .q-options { margin-bottom:12px; }
.ai-question-card .q-option { padding:8px 12px; margin-bottom:4px; background:#fafafa; border-radius:6px; font-size:14px; color:#555; }
.ai-question-card .q-option-correct { background:#f6ffed; color:#52c41a; border:1px solid #b7eb8f; font-weight:500; }
.ai-question-card .q-answer { background:#fffbe6; padding:8px 12px; border-radius:6px; font-size:14px; color:#333; margin-bottom:8px; }
.ai-question-card .q-analysis { background:#f0f5ff; padding:8px 12px; border-radius:6px; font-size:13px; color:#555; line-height:1.6; margin-bottom:12px; }
.ai-question-card .q-footer { display:flex; justify-content:flex-end; gap:8px; }

.ai-paper-result { }
.ai-paper-result .paper-summary { background: linear-gradient(135deg,#667eea,#764ba2); color:#fff; border-radius:12px; padding:28px; margin-bottom:24px; }
.ai-paper-result .paper-summary h3 { color:#fff; font-size:22px; margin-bottom:12px; }
.ai-paper-result .paper-meta { display:flex; gap:24px; margin-bottom:16px; font-size:14px; opacity:.9; }
.ai-paper-result .paper-actions { display:flex; gap:12px; }
.ai-paper-result .paper-actions .btn { background:rgba(255,255,255,.2); color:#fff; border:1px solid rgba(255,255,255,.3); }
.ai-paper-result .paper-actions .btn:hover { background:rgba(255,255,255,.3); }

.ai-error-box { text-align:center; padding:40px 20px; background:#fff; border-radius:12px; }

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

/* ===== AI 出题 / 整卷生成 ===== */
.ai-tabs { display:flex; gap:0; border-bottom:2px solid #e8e8e8; margin-bottom:20px; }
.ai-tab { padding:10px 24px; border:none; background:none; cursor:pointer; font-size:14px; color:#666; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all 0.2s; }
.ai-tab:hover { color:#0066FF; }
.ai-tab.active { color:#0066FF; border-bottom-color:#0066FF; font-weight:600; }
.ai-form { display:flex; justify-content:center; }
.ai-form-card { background:#fff; border-radius:12px; padding:32px; box-shadow:0 2px 12px rgba(0,0,0,0.06); width:100%; }
.ai-form-card h3 { font-size:20px; color:#1a1a1a; }
.form-row { display:flex; gap:16px; margin-bottom:16px; }
.form-row .form-group { flex:1; }
.form-group label { display:block; font-size:13px; color:#666; margin-bottom:6px; font-weight:500; }
.form-group select, .form-group input { width:100%; padding:10px 12px; border:1px solid #d9d9d9; border-radius:6px; font-size:14px; }
.star-rating { display:flex; gap:4px; padding:8px 0; cursor:pointer; }
.star-rating .star { font-size:24px; color:#d9d9d9; transition:color 0.2s; user-select:none; }
.star-rating .star.active { color:#faad14; }
.ai-loading { text-align:center; padding:40px 20px; }
.ai-loading .spinner { width:40px; height:40px; border:4px solid #e8e8e8; border-top-color:#0066FF; border-radius:50%; margin:0 auto 16px; animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.ai-loading p { color:#999; font-size:14px; }
.ai-question-card { background:#fafafa; border:1px solid #e8e8e8; border-radius:8px; padding:20px; margin-bottom:16px; }
.ai-question-card .q-header { margin-bottom:10px; color:#333; font-size:14px; display:flex; justify-content:space-between; align-items:center; }
.ai-question-card .q-meta { color:#999; font-size:12px; }
.ai-question-card .q-content { font-size:14px; color:#333; line-height:1.8; margin-bottom:10px; }
.ai-question-card .q-options { font-size:13px; color:#555; margin-bottom:10px; }
.ai-question-card .q-answer { font-size:13px; color:#52c41a; margin-bottom:8px; }
.ai-question-card .q-analysis { font-size:13px; color:#666; background:#f0f5ff; padding:10px; border-radius:6px; }
.paper-info { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; background:#f6f8fa; border-radius:8px; padding:16px; margin-bottom:12px; }
.paper-stat { text-align:center; }
.paper-stat label { display:block; font-size:12px; color:#999; margin-bottom:4px; }
.paper-stat span { font-size:18px; font-weight:700; color:#1a1a1a; }
.btn-block { width:100%; padding:12px; font-size:15px; margin-top:12px; }

/* AI通知设置 */
.recipient-search, .recipient-manual {
    display: flex; gap: 8px; margin-bottom: 8px;
}
.recipient-search input, .recipient-manual input {
    flex: 1; padding: 6px 10px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 13px;
}
.recipient-search-results {
    border: 1px solid #e5e7eb; border-radius: 8px;
    max-height: 200px; overflow-y: auto; margin-bottom: 8px;
}
.recipient-result-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid #f3f4f6;
}
.recipient-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 6px;
}
.recipient-item-info { font-size: 13px; }
.recipient-item-name { font-weight: 600; }
.recipient-item-phone { color: #6b7280; font-size: 12px; }
CSSCEOF
echo 'CSS appended successfully'

/* AI通知设置 */
.recipient-search, .recipient-manual {
    display: flex; gap: 8px; margin-bottom: 8px;
}
.recipient-search input, .recipient-manual input {
    flex: 1; padding: 6px 10px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 13px;
}
.recipient-search-results {
    border: 1px solid #e5e7eb; border-radius: 8px;
    max-height: 200px; overflow-y: auto; margin-bottom: 8px;
}
.recipient-result-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid #f3f4f6;
}
.recipient-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 6px;
}
.recipient-item-info { font-size: 13px; }
.recipient-item-name { font-weight: 600; }
.recipient-item-phone { color: #6b7280; font-size: 12px; }
