/* ============================================================
   Python实训交付台 —— 页面原型共享样式
   状态色规范（来自需求文档 §五）：
   灰=未开放 蓝=进行中 橙=待确认 绿=已锁定 红=异常
   ============================================================ */

:root {
  --c-bg: #f4f6fa;
  --c-card: #ffffff;
  --c-border: #e3e8f0;
  --c-text: #1f2937;
  --c-text-sub: #6b7280;
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;

  --st-gray: #9ca3af;   /* 未开放 */
  --st-blue: #2563eb;   /* 进行中 */
  --st-orange: #f59e0b; /* 待确认/草稿 */
  --st-green: #16a34a;  /* 已锁定/已验收 */
  --st-red: #dc2626;    /* 异常 */

  --st-gray-bg: #f3f4f6;
  --st-blue-bg: #eff6ff;
  --st-orange-bg: #fffbeb;
  --st-green-bg: #f0fdf4;
  --st-red-bg: #fef2f2;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: #1e3a8a;
  color: #fff;
  padding: 0 20px;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  height: 56px;
}
.topbar .logo { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .logo small { font-weight: 400; font-size: 12px; opacity: .75; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .user-info { font-size: 13px; opacity: .92; }
.topbar .user-info b { font-weight: 600; }
.topbar a.nav-link { color: #dbeafe; font-size: 13px; margin-left: 14px; }
.topbar a.nav-link:hover { color: #fff; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 12px; }
.card h3 { font-size: 14px; margin-bottom: 8px; }

/* ---------- 徽章 / 状态 ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-gray   { color: #4b5563; background: var(--st-gray-bg);   border-color: #d1d5db; }
.badge-blue   { color: var(--st-blue);  background: var(--st-blue-bg);  border-color: #bfdbfe; }
.badge-orange { color: #b45309; background: var(--st-orange-bg); border-color: #fde68a; }
.badge-green  { color: var(--st-green); background: var(--st-green-bg); border-color: #bbf7d0; }
.badge-red    { color: var(--st-red);  background: var(--st-red-bg);  border-color: #fecaca; }
.badge-purple { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; } /* AI / 文档类标识 */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-gray { background: var(--st-gray); }
.dot-blue { background: var(--st-blue); }
.dot-orange { background: var(--st-orange); }
.dot-green { background: var(--st-green); }
.dot-red { background: var(--st-red); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-danger { background: var(--st-red); border-color: var(--st-red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--st-green); border-color: var(--st-green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 28px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-row label .req { color: var(--st-red); margin-left: 2px; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row input[type="datetime-local"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid #bfdbfe; border-color: var(--c-primary);
}
.form-row .hint { font-size: 12px; color: var(--c-text-sub); margin-top: 4px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.checkbox-row input { margin-top: 4px; }

/* ---------- 表格 ---------- */
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  white-space: nowrap;
}
table.table th { background: #f9fafb; font-weight: 600; color: #374151; }
table.table tr:hover td { background: #f8fafc; }

/* ---------- 任务卡片（学生首页） ---------- */
.task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.task-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 5px solid var(--st-gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.task-card.st-blue   { border-left-color: var(--st-blue); }
.task-card.st-orange { border-left-color: var(--st-orange); }
.task-card.st-green  { border-left-color: var(--st-green); }
.task-card.st-gray   { border-left-color: var(--st-gray); }
.task-card.st-red    { border-left-color: var(--st-red); }
.task-card .task-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.task-card .task-name { font-size: 16px; font-weight: 700; }
.task-card .task-meta { font-size: 12.5px; color: var(--c-text-sub); margin-bottom: 4px; }
.task-card .task-file {
  font-size: 12.5px; background: #f8fafc; border: 1px dashed var(--c-border);
  border-radius: 8px; padding: 6px 10px; margin: 8px 0; color: #374151;
}
.task-card .task-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  text-align: center;
  padding: 36px 20px;
  color: var(--c-text-sub);
}
.dropzone .dz-icon { font-size: 34px; margin-bottom: 6px; }
.progress {
  height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin-top: 10px;
}
.progress > i { display: block; height: 100%; background: var(--c-primary); border-radius: 999px; }

/* ---------- 检查清单 ---------- */
.checklist { list-style: none; }
.checklist li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px dashed var(--c-border); font-size: 13.5px;
}
.checklist li:last-child { border-bottom: none; }
.checklist input { margin-top: 5px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: calc(100vw - 40px);
  max-height: 88vh; overflow: auto; padding: 24px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal .modal-warn {
  background: var(--st-orange-bg); border: 1px solid #fde68a; color: #92400e;
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 12px 0;
}
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.file-summary-box {
  background: #f8fafc; border: 1px solid var(--c-border); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; margin: 12px 0;
}
.file-summary-box .mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- 提示条 ---------- */
.alert {
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid transparent;
}
.alert-info { background: var(--st-blue-bg); border-color: #bfdbfe; color: #1e40af; }
.alert-warn { background: var(--st-orange-bg); border-color: #fde68a; color: #92400e; }
.alert-success { background: var(--st-green-bg); border-color: #bbf7d0; color: #166534; }
.alert-danger { background: var(--st-red-bg); border-color: #fecaca; color: #991b1b; }

/* ---------- 看板统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-box {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow);
}
.stat-box .num { font-size: 24px; font-weight: 700; }
.stat-box .lbl { font-size: 12px; color: var(--c-text-sub); }

/* ---------- 时间线 ---------- */
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--c-border);
}
.timeline li { position: relative; padding: 0 0 18px 10px; font-size: 13px; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--st-blue); border: 2px solid #fff;
}
.timeline li.tl-green::before { background: var(--st-green); }
.timeline li.tl-orange::before { background: var(--st-orange); }
.timeline li.tl-red::before { background: var(--st-red); }
.timeline li.tl-gray::before { background: var(--st-gray); }
.timeline .tl-time { color: var(--c-text-sub); font-size: 12px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--c-border); margin-bottom: 20px; }
.tabs a {
  padding: 8px 18px; font-size: 14px; color: var(--c-text-sub);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs a.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--c-primary); }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar select, .filter-bar input {
  padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; font-family: var(--font);
}

/* ---------- 回执 ---------- */
.receipt {
  border: 2px solid var(--st-green); border-radius: var(--radius);
  background: linear-gradient(180deg, #f0fdf4, #fff);
  padding: 26px 30px;
}
.receipt .receipt-title { font-size: 18px; font-weight: 700; color: var(--st-green); margin-bottom: 4px; }
.receipt dl { display: grid; grid-template-columns: 120px 1fr; row-gap: 8px; font-size: 13.5px; margin-top: 14px; }
.receipt dt { color: var(--c-text-sub); }
.receipt dd { font-weight: 500; }
.receipt dd.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- 登录/注册页 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 40px 16px;
}
.auth-card {
  background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 460px; max-width: 100%; padding: 32px 36px;
}
.auth-card.wide { width: 640px; }
.auth-card .auth-logo { text-align: center; margin-bottom: 20px; }
.auth-card .auth-logo .t { font-size: 22px; font-weight: 800; color: #1e3a8a; }
.auth-card .auth-logo .s { font-size: 12.5px; color: var(--c-text-sub); }
.auth-foot { text-align: center; font-size: 13px; margin-top: 14px; color: var(--c-text-sub); }

/* ---------- 原型导航页 ---------- */
.proto-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proto-item {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: block; color: var(--c-text);
}
.proto-item:hover { border-color: var(--c-primary); text-decoration: none; }
.proto-item .p-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.proto-item .p-desc { font-size: 12.5px; color: var(--c-text-sub); }
.proto-item .p-role { float: right; }
.proto-note { font-size: 12.5px; color: var(--c-text-sub); margin-top: 8px; }

/* ---------- 工具 ---------- */
.mono { font-family: var(--mono); }
.text-sub { color: var(--c-text-sub); }
.text-sm { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title { font-size: 18px; font-weight: 700; margin: 8px 0 16px; }
.proto-tag {
  display: inline-block; font-size: 11px; background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a; border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: middle;
}

@media (max-width: 860px) {
  .task-grid, .proto-list, .form-2col { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid.cols-8 { grid-template-columns: repeat(4, 1fr); }
}
