/* 天易极简申论批改系统 - 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f5f6f8;
    color: #2c2c2c;
    line-height: 1.7;
    font-size: 15px;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 导航 */
.nav {
    display: flex; align-items: center; justify-content: space-between;
    background: #1e3a5f; color: #fff; padding: 0 20px; height: 54px;
    flex-wrap: wrap;
}
.nav.admin { background: #1f2937; }
.nav .brand { color: #fff; font-weight: 700; font-size: 17px; }
.nav a { color: #fff; margin-left: 16px; }
.nav-links { display: flex; align-items: center; }
.nav-user { color: #cbd5e1; margin-left: 16px; font-size: 13px; }

/* 容器 */
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.container.wide { max-width: 1100px; }

/* 卡片 */
.card {
    background: #fff; border-radius: 10px; padding: 22px; margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card h2 { font-size: 19px; margin-bottom: 14px; color: #1e3a5f; }
.card h3 { font-size: 16px; margin: 16px 0 8px; }

/* 按钮 */
.btn {
    display: inline-block; padding: 9px 20px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 14px; background: #2563eb; color: #fff;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.block { display: block; width: 100%; }
.btn.ghost { background: #eef2f7; color: #333; }
.btn.danger { background: #dc2626; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; line-height: 1.8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #2563eb; }

/* 提示 */
.alert { background: #fef3c7; color: #92400e; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
th { background: #f8fafc; font-weight: 600; color: #475569; }

/* 题目列表 */
.q-item { display: block; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.q-item:hover { background: #f8fafc; }
.q-title { font-weight: 600; color: #1f2937; }
.q-meta { color: #6b7280; font-size: 13px; margin-top: 2px; }
.q-stem { font-size: 14px; color: #374151; margin-top: 4px; line-height: 1.7; }

/* 套题卡片 */
.paper-card {
    display: block; padding: 14px 16px; border: 1px solid #e5e7eb;
    border-radius: 10px; margin-bottom: 10px; background: #fff;
    transition: all .15s;
}
.paper-card:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.paper-head { background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%); }
.paper-q { border-left: 3px solid #e5e7eb; }
.paper-q:hover { border-left-color: #2563eb; }

/* 二级 tab */
.sub-tabs {
    display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 14px;
    border-bottom: 2px solid #e5e7eb;
}
.sub-tab {
    padding: 8px 16px; cursor: pointer; font-size: 14px; color: #6b7280;
    border-bottom: 2px solid transparent; margin-bottom: -2px; user-select: none;
    white-space: nowrap;
}
.sub-tab:hover { color: #2563eb; }
.sub-tab.active { color: #2563eb; font-weight: 600; border-bottom-color: #2563eb; }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

/* 二级菜单（题型/套题来源入口） */
.menu-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff; font-size: 15px; color: #1f2937; transition: all .15s;
}
.menu-item:hover { border-color: #93c5fd; background: #eff6ff; }
.menu-item .menu-name { font-weight: 600; }
.menu-item .muted { font-size: 13px; color: #6b7280; }
.back-link {
    display: inline-block; font-size: 13px; color: #2563eb;
    margin-bottom: 10px; text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* 套题批改进度提示条 */
.progress-tip {
    margin-top: 12px; padding: 10px 14px; border-radius: 8px;
    font-size: 14px; background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe;
}
.progress-tip.partial { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.progress-tip.done { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* 范文来源标签 */
.article-source {
    display: inline-block; margin-bottom: 10px; padding: 4px 12px;
    background: #eef2ff; color: #3730a3; border-radius: 6px;
    font-size: 13px; font-weight: 500;
}

/* 参考答案折叠 */
.ref-answer summary {
    cursor: pointer; padding: 8px 12px; background: #f0fdf4;
    border-radius: 6px; font-weight: 600; color: #166534;
    list-style: none; user-select: none;
}
.ref-answer summary::-webkit-details-marker { display: none; }
.ref-answer summary::before { content: '▸ '; display: inline-block; transition: transform .15s; }
.ref-answer[open] summary::before { content: '▾ '; }
.ref-answer[open] summary { margin-bottom: 10px; }

/* 学员端剩余批改提示条 */
.usage-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 16px; font-size: 14px; }
.section-title {
    font-size: 15px; font-weight: 700; color: #1e3a5f;
    margin: 16px 0 6px; padding: 6px 10px;
    border-left: 3px solid #2563eb;
}
.section-title.collapsible { cursor: pointer; user-select: none; border-radius: 0 6px 6px 0; }
.section-title.collapsible:hover { background: #eff6ff; }
.section-title .caret { display: inline-block; width: 14px; color: #2563eb; font-size: 12px; }
.section-body.collapsed { display: none; }
.section-title .muted { font-weight: 400; }
.tag.num { background: #e0e7ff; color: #3730a3; }
.tag {
    display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; margin-right: 6px;
}
.tag.gk { background: #dbeafe; color: #1e40af; }
.tag.fx { background: #fef3c7; color: #92400e; }
.tag.dc { background: #dcfce7; color: #166534; }
.tag.yw { background: #fce7f3; color: #9d174d; }
.tag.zw { background: #ede9fe; color: #5b21b6; }
.tag.done { background: #e5e7eb; color: #374151; }

/* 材料 */
.material-box {
    background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 16px; max-height: 400px; overflow-y: auto; white-space: pre-wrap;
    font-size: 14px; color: #374151;
}
.stem-box {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px;
    padding: 14px 16px; margin-bottom: 12px; white-space: pre-wrap;
}
.answer-box {
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
    padding: 14px 16px; margin-top: 10px; white-space: pre-wrap;
}

/* 批改结果 */
.review-md { white-space: normal; }
.review-md h1, .review-md h2, .review-md h3, .review-md h4 {
    margin: 18px 0 8px; color: #1e3a5f;
}
.review-md h3 { font-size: 17px; border-left: 4px solid #2563eb; padding-left: 10px; }
.review-md p { margin: 6px 0; }
.review-md ul { margin: 6px 0 6px 20px; }
.review-md li { margin: 4px 0; }
.review-md .score-line { background: #eff6ff; padding: 10px 14px; border-radius: 6px; font-weight: 700; color: #1e40af; font-size: 16px; }
.review-md pre { background: #1f2937; color: #e5e7eb; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.review-md code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.review-md pre code { background: none; padding: 0; }
.review-md .ol-item { margin: 4px 0 4px 6px; }

/* 加载 */
.loading {
    text-align: center; padding: 40px; color: #6b7280;
}
.spinner {
    display: inline-block; width: 36px; height: 36px; border: 4px solid #e5e7eb;
    border-top-color: #2563eb; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat .num { font-size: 28px; font-weight: 700; color: #1e3a5f; }
.stat .label { color: #6b7280; font-size: 13px; }

.footer { text-align: center; color: #9ca3af; font-size: 13px; padding: 30px 16px; }
.mt { margin-top: 14px; }
.muted { color: #6b7280; font-size: 13px; }
.flex { display: flex; gap: 10px; align-items: center; }

/* 方块 Tab */
.tab-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.tab-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px 10px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tab-card:hover { border-color: #93c5fd; transform: translateY(-2px); }
.tab-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
}
.tab-icon { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.tab-label { font-weight: 700; font-size: 15px; color: #1f2937; }
.tab-count { font-size: 12px; color: #6b7280; margin-top: 4px; }

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

/* 无权限提示 */
.no-perm { text-align: center; padding: 50px 20px; }
.no-perm h2 { color: #b45309; margin: 10px 0; }
.no-perm p { color: #6b7280; margin: 6px 0; }

/* 文章正文 */
.article-content { white-space: normal; font-size: 15px; line-height: 2; }
.article-content h2 { font-size: 20px; margin: 18px 0 10px; color: #1e3a5f; }
.article-content h3 { font-size: 17px; margin: 16px 0 8px; color: #1e3a5f; }
.article-content ul, .article-content ol { margin: 8px 0 8px 22px; }
.article-content li { margin: 4px 0; }
.article-content blockquote { border-left: 4px solid #cbd5e1; padding: 4px 12px; color: #64748b; margin: 10px 0; }

/* 富文本编辑器 */
.rte-wrap { border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.rte-toolbar {
    display: flex; flex-wrap: wrap; gap: 2px; align-items: center;
    padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
}
.rte-btn {
    border: none; background: transparent; cursor: pointer;
    padding: 5px 10px; border-radius: 5px; font-size: 13px; color: #374151;
}
.rte-btn:hover { background: #e2e8f0; }
.rte-sep { width: 1px; height: 18px; background: #e5e7eb; margin: 0 4px; display: inline-block; }
.rte-editor {
    min-height: 320px; padding: 14px 16px; outline: none;
    font-size: 15px; line-height: 1.9; background: #fff;
}
.rte-editor:empty:before {
    content: attr(data-placeholder); color: #9ca3af; pointer-events: none;
}
.rte-editor h2 { font-size: 20px; margin: 12px 0 8px; }
.rte-editor h3 { font-size: 17px; margin: 12px 0 8px; }
.rte-editor ul, .rte-editor ol { margin: 6px 0 6px 22px; }
.rte-editor li { margin: 3px 0; }

/* 响应式 */
@media (max-width: 600px) {
    .container { margin: 14px auto; }
    .nav { height: auto; padding: 10px 16px; }
    .nav-links { width: 100%; flex-wrap: wrap; margin-top: 6px; }
    .nav a { margin: 4px 10px 4px 0; }
    .tab-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tab-card { padding: 16px 8px; }
}

