/* style.css - 全局自定义样式 */

:root {
  --primary: #1a56db;
  --primary-dark: #1e3a5f;
  --primary-light: #3b82f6;
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f0f4f8;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --shadow: 0 4px 24px rgba(30,58,95,0.12);
  --shadow-lg: 0 8px 40px rgba(30,58,95,0.18);
}

* { box-sizing: border-box; }

body {
  font-family: 'PingFang SC', '思源黑体', 'Microsoft YaHei', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

/* ===== Word预览样式优化 ===== */
#word-preview-content {
  /* 字体设置 - 保留Word默认字体 */
  font-family: 'Microsoft YaHei', 'SimSun', 'KaiTi', 'FangSong', 'PingFang SC', sans-serif !important;
}

#word-preview-content h1, 
#word-preview-content h2, 
#word-preview-content h3, 
#word-preview-content h4, 
#word-preview-content h5, 
#word-preview-content h6 {
  font-weight: bold;
  margin: 1.5em 0 0.5em;
  color: #1e293b;
  font-family: 'Microsoft YaHei', 'SimHei', sans-serif !important;
}

#word-preview-content p {
  margin: 0.8em 0;
  text-indent: 2em;
  line-height: 1.8;
}

#word-preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  border: 1px solid #cbd5e1;
}

#word-preview-content table th,
#word-preview-content table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
  text-indent: 0; /* 表格文字不需要首行缩进 */
}

#word-preview-content table th {
  background-color: #f8fafc;
  font-weight: bold;
}

#word-preview-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
}

#word-preview-content strong,
#word-preview-content b {
  font-weight: bold;
}

#word-preview-content em,
#word-preview-content i {
  font-style: italic;
}

#word-preview-content ul,
#word-preview-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

#word-preview-content li {
  margin: 0.5em 0;
}

/* ===== 全局动效 ===== */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.slide-in { animation: slideIn .35s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 2px 10px rgba(26,86,219,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,86,219,.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.btn-secondary:hover { background: #eff6ff; }

.btn-danger {
  background: linear-gradient(135deg, #f87171, var(--danger));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,.35); }

.btn-success {
  background: linear-gradient(135deg, #34d399, var(--accent));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.btn-success:hover { transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #fbbf24, var(--warning));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-sm { padding: 5px 12px !important; font-size: 13px !important; }

/* ===== 输入框 ===== */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #dde4ef;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #dde4ef;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

.form-label { display: block; font-weight: 600; color: var(--text-main); margin-bottom: 6px; font-size: 14px; }
.form-group { margin-bottom: 18px; }

/* ===== 卡片 ===== */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow-lg); }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark), #162d4c);
  color: white;
  padding: 0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
}
.sidebar-header {
  padding: 28px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 8px;
}
.sidebar-logo {
  font-size: 17px;
  font-weight: 700;
  color: white;
  line-height: 1.4;
}
.sidebar-nav { padding: 8px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: white; }
.nav-item.active { background: rgba(59,130,246,.35); color: white; box-shadow: 0 2px 8px rgba(59,130,246,.2); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.main-content {
  margin-left: 240px;
  min-height: 100vh;
  background: var(--bg-main);
}
.topbar {
  background: white;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 40;
}
.page-content { padding: 28px; }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: linear-gradient(135deg, #f0f4f8, #e8f0fe);
  color: var(--text-main);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-muted);
  vertical-align: middle;
}
.data-table tr:hover td { background: #f8faff; }
.data-table tr:last-child td { border-bottom: none; }

/* ===== 标签/徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: var(--text-muted); }

/* ===== Tab 切换 ===== */
.tab-bar {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-bottom: 24px;
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  transition: all .2s;
  white-space: nowrap;
}
.tab-item.active {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  box-shadow: 0 2px 10px rgba(26,86,219,.3);
}
.tab-item:hover:not(.active) { background: #f0f4f8; color: var(--text-main); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 模态框 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  animation: fadeIn .3s ease;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn .3s ease;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 12px; }

/* ===== 预览弹窗 ===== */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.preview-header {
  background: var(--primary-dark);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.preview-body {
  flex: 1;
  overflow: hidden;
  background: #f8f9fa;
}

/* ===== 评分滑块 ===== */
.score-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  width: 100%;
  cursor: pointer;
}
.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-light);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59,130,246,.4);
  transition: transform .15s;
}
.score-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ===== 排名 ===== */
.rank-1 { background: linear-gradient(135deg, #fef3c7, #fffbeb); border-left: 4px solid #f59e0b; }
.rank-2 { background: linear-gradient(135deg, #f1f5f9, #f8fafc); border-left: 4px solid #94a3b8; }
.rank-3 { background: linear-gradient(135deg, #fef7ee, #fff7ed); border-left: 4px solid #f97316; }

.rank-medal-1 { color: #f59e0b; }
.rank-medal-2 { color: #94a3b8; }
.rank-medal-3 { color: #f97316; }

/* ===== 进度条 ===== */
.score-bar-wrap { background: #f1f5f9; border-radius: 4px; height: 8px; overflow: hidden; }
.score-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }

/* ===== 上传区域 ===== */
.upload-zone {
  border: 2.5px dashed #c7d2e4;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  background: #fafcff;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary-light);
  background: #eff6ff;
}

/* ===== 步骤条 ===== */
.step-bar { display: flex; align-items: center; margin-bottom: 32px; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: #e2e8f0;
}
.step-item.done:not(:last-child)::after { background: var(--primary-light); }
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: #e2e8f0;
  color: var(--text-muted);
  transition: all .3s;
  z-index: 1;
}
.step-item.active .step-circle { background: var(--primary-light); color: white; box-shadow: 0 0 0 4px rgba(59,130,246,.2); }
.step-item.done .step-circle { background: var(--accent); color: white; }
.step-label { font-size: 12px; margin-top: 6px; color: var(--text-muted); font-weight: 500; }
.step-item.active .step-label { color: var(--primary-light); font-weight: 600; }

/* ===== Toast通知 ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: slideInRight .3s ease;
  border-left: 4px solid var(--primary-light);
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 18px; }
.toast-msg { font-size: 14px; font-weight: 500; color: var(--text-main); }

/* ===== 加载动画 ===== */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: .3; }
.empty-state-text { font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.empty-state-hint { font-size: 13px; opacity: .7; }

/* ===== 工具类 ===== */
.hidden { display: none !important; }

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
  .page-content { padding: 16px; }
}
