/* ===================================
   西南交通大学本科论文AI使用过程管理系统
   =================================== */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --warning: #ea580c;
  --danger: #dc2626;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #7dd3fc 100%);
  padding: 20px;
}
.login-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%; max-width: 420px; padding: 40px;
}
.login-header { text-align:center; margin-bottom:28px; }
.login-header h1 { font-size:22px; color:var(--primary); margin-bottom:4px; }
.login-header h2 { font-size:17px; color:var(--text); font-weight:500; margin-bottom:12px; }
.login-header p { color:var(--text-light); font-size:14px; }
.login-footer { margin-top:24px; padding-top:20px; border-top:1px solid var(--border); text-align:center; font-size:13px; color:var(--text-light); }
.login-footer code { background:var(--bg); padding:2px 8px; border-radius:4px; font-size:12px; }

.role-selector { display:flex; gap:8px; }
.role-btn {
  flex:1; display:block; padding:10px; text-align:center;
  background:var(--bg); border:2px solid var(--border); border-radius:var(--radius-sm);
  cursor:pointer; font-size:13px; transition:all .2s;
}
.role-btn input { display:none; }
.role-btn:has(input:checked) { border-color:var(--primary); background:#eff6ff; color:var(--primary); font-weight:500; }

/* Buttons */
.btn-primary {
  background:var(--primary); color:white; border:none; padding:12px 24px;
  border-radius:var(--radius-sm); font-size:16px; font-weight:500; cursor:pointer;
  width:100%; transition:background .2s;
}
.btn-primary:hover { background:var(--primary-dark); }
.btn-secondary {
  background:var(--secondary, #64748b); color:white; border:none; padding:8px 16px;
  border-radius:var(--radius-sm); font-size:14px; cursor:pointer;
}
.btn-outline {
  background:transparent; border:1px solid var(--border); padding:8px 16px;
  border-radius:var(--radius-sm); font-size:14px; cursor:pointer; color:var(--text-light);
}
.btn-outline:hover { background:var(--bg); }
.btn-sm { padding:6px 12px; font-size:13px; width:auto; }

/* Dashboard */
.dashboard { min-height:100vh; }
.dashboard-header {
  background:linear-gradient(135deg, #1e3a8a, #3b82f6);
  color:white; padding:16px 24px; display:flex; justify-content:space-between; align-items:center;
}
.dashboard-header h2 { font-size:18px; }
.dashboard-header .header-right { display:flex; align-items:center; gap:12px; }
.dashboard-header .btn-outline { color:rgba(255,255,255,0.8); border-color:rgba(255,255,255,0.3); }
.dashboard-header .btn-outline:hover { background:rgba(255,255,255,0.1); }

.tab-bar {
  background:white; border-bottom:1px solid var(--border);
  padding:0 24px; display:flex; gap:4px;
}
.tab-btn {
  background:none; border:none; padding:14px 20px; font-size:14px; color:var(--text-light);
  cursor:pointer; border-bottom:2px solid transparent; transition:all .2s;
}
.tab-btn.active { color:var(--primary); border-bottom-color:var(--primary); font-weight:500; }
.tab-btn:hover { color:var(--primary); }

.tab-content { padding:24px; max-width:1000px; margin:0 auto; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* Card */
.card {
  background:var(--bg-card); border-radius:var(--radius); padding:24px; box-shadow:0 2px 8px rgba(0,0,0,0.06);
  margin-bottom:20px;
}
.card h3 { font-size:17px; margin-bottom:16px; }
.hint { color:var(--text-light); font-size:13px; margin-bottom:16px; }

/* Form */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-weight:500; margin-bottom:6px; font-size:14px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:10px 14px; border:2px solid var(--border); border-radius:var(--radius-sm);
  font-size:15px; font-family:inherit; transition:border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline:none; border-color:var(--primary);
}
.form-group textarea { resize:vertical; min-height:80px; }
.form-actions { margin-top:20px; }

.range-wrapper {
  display:flex; align-items:center; gap:16px;
}
.range-input { flex:1; height:8px; -webkit-appearance:none; appearance:none; background:var(--border); border-radius:4px; }
.range-input::-webkit-slider-thumb {
  -webkit-appearance:none; width:20px; height:20px; background:var(--primary); border-radius:50%; cursor:pointer;
}
.range-value { font-size:18px; font-weight:600; color:var(--primary); min-width:50px; }

/* Record Cards */
.record-card {
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:16px; margin-bottom:12px;
}
.record-card .record-header {
  display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px;
}
.record-card .badge {
  display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:500;
}
.badge.pending { background:#fef3c7; color:#92400e; }
.badge.approved { background:#dcfce7; color:#166534; }
.badge.rejected { background:#fee2e2; color:#991b1b; }
.record-card .record-meta { font-size:13px; color:var(--text-light); margin-bottom:6px; }
.record-card .record-desc { font-size:14px; margin-bottom:8px; }
.record-card .record-actions { display:flex; gap:8px; margin-top:8px; }
.record-card .btn-approve { background:var(--success); color:white; border:none; padding:6px 16px; border-radius:4px; cursor:pointer; }
.record-card .btn-reject { background:var(--danger); color:white; border:none; padding:6px 16px; border-radius:4px; cursor:pointer; }
.record-card .teacher-comment { margin-top:8px; padding:10px; background:var(--bg); border-radius:4px; font-size:14px; }
.record-card .teacher-comment strong { color:var(--primary); }

/* Stats */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; margin-bottom:20px; }
.stat-card { background:var(--bg-card); border-radius:var(--radius); padding:20px; text-align:center; box-shadow:0 2px 8px rgba(0,0,0,0.06); font-size:14px; }
.stat-card span { display:block; font-size:28px; font-weight:700; color:var(--primary); margin-top:4px; }

/* Section Header */
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.section-header h3 { margin-bottom:0; }
.header-actions { display:flex; gap:8px; }

/* Account List */
.account-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 16px; border-bottom:1px solid var(--border);
}
.account-row:last-child { border-bottom:none; }
.account-row .account-info { font-size:14px; }
.account-row .account-role { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; background:var(--bg); }

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.file-upload-area:hover { border-color: var(--primary-light); background: #f8faff; }
.file-upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.file-upload-hint { color: var(--text-light); font-size: 14px; pointer-events: none; }
.file-upload-hint::before { content: '📁 '; font-size: 20px; display: block; margin-bottom: 8px; }

.file-list { list-style: none; margin-top: 8px; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--bg); border-radius: 4px; margin-bottom: 4px;
  font-size: 13px;
}
.file-item .file-icon { font-size: 16px; flex-shrink: 0; }
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.file-item .file-remove { cursor: pointer; color: var(--danger); font-size: 18px; line-height: 1; flex-shrink: 0; }

/* Attachments */
.attachments { margin-top: 10px; padding: 10px; background: var(--bg); border-radius: 6px; }
.attachments-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.attachment-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px;
}
.attachment-item .file-icon { font-size: 15px; }
.attachment-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item .file-size { color: var(--text-light); font-size: 12px; }
.attachment-item .attachment-preview,
.attachment-item .attachment-download {
  color: var(--primary); cursor: pointer; text-decoration: none; font-size: 12px;
  flex-shrink: 0;
}
.attachment-item .attachment-preview:hover,
.attachment-item .attachment-download:hover { text-decoration: underline; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal { background: white; border-radius: var(--radius); padding: 32px; max-width: 450px; width: 90%; }
.modal-lg { max-width: 90vw; }
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions button { flex: 1; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); padding: 0 4px; line-height: 1; }
.btn-close:hover { color: var(--text); }

/* Empty hint */
.empty-hint { text-align:center; padding:40px; color:var(--text-light); }

/* Error */
.error-message { color:var(--danger); font-size:14px; min-height:20px; margin-bottom:12px; }

/* Export */
.export-actions { display:flex; gap:12px; }
.export-actions .btn-primary, .export-actions .btn-secondary { width:auto; }

/* Misc */
.fade-in { animation:fadeIn .3s; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

@media (max-width:640px) {
  .role-selector { flex-direction:column; }
  .tab-btn { font-size:13px; padding:12px 14px; }
  .tab-content { padding:16px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
