/* 课程开发工作坊 — 对齐 course-dev-workshop 浅色学院风 */
:root {
  color-scheme: light;
  --navy: #0f1f3d;
  --navy-mid: #1a3460;
  --navy-light: #2b4d8c;
  --slate: #4a6080;
  --silver: #8fa3be;
  --mist: #dce6f0;
  --fog: #eef3f8;
  --paper: #f8fafc;
  --gold: #b8892a;
  --gold-pale: #fdf8ec;
  --green: #1a6b4a;
  --text: #1a2a3a;
  --text-mid: #3d5270;
  --text-light: #7a90a8;
  --border: #d0dce8;
  --border-light: #e8eff5;
  --shadow-sm: 0 1px 4px rgba(15, 31, 61, 0.07);
  --shadow: 0 2px 12px rgba(15, 31, 61, 0.1);
  --radius: 6px;
  --radius-lg: 10px;
  --font: 'Noto Sans SC', system-ui, sans-serif;
  --font-serif: 'Noto Serif SC', 'Noto Sans SC', serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-mid);
}

.view {
  min-height: 100%;
}

/* —— 登录 —— */
.view-login {
  flex: 1 1 auto;
  min-height: calc(100vh - 5.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--paper);
}

.login-shell {
  width: 100%;
  max-width: 440px;
}

.login-card-ws {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 22px;
  box-shadow: var(--shadow);
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.org-logo-img {
  display: block;
  height: auto;
  object-fit: contain;
}

.org-logo-img--login {
  max-width: 100%;
  max-height: 72px;
  width: auto;
}

.org-logo-img--bar {
  max-height: 40px;
  width: auto;
  margin-right: 14px;
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 720px) {
  .org-logo-img--bar {
    max-height: 32px;
    margin-right: 10px;
  }

  .top-bar-product .logo-sub {
    display: none;
  }

  .top-bar-product .logo-divider {
    display: none;
  }
}

.top-bar-product {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.login-brand-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.logo-divider {
  width: 1px;
  height: 18px;
  background: rgba(15, 31, 61, 0.18);
  margin: 0 8px;
}

.logo-sub {
  font-size: 11px;
  color: var(--slate);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.login-title-ws {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.login-lead {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
}

.login-form-ws .field-ws {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
}

.login-form-ws input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.login-form-ws input:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(43, 77, 140, 0.1);
  background: #fff;
}

.form-error-ws {
  color: #b91c1c;
  font-size: 13px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.btn-block-ws {
  width: 100%;
  margin-top: 4px;
  padding: 11px 20px;
  justify-content: center;
}

.login-foot-ws {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.info-box-ws {
  background: var(--fog);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 13px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
}

.info-box-ws strong {
  color: var(--navy);
}

.login-foot-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* —— 工作台整体 —— */
.view-workshop {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: calc(100vh - 5.5rem);
}

/* TOP BAR */
.top-bar {
  background: var(--navy);
  color: #fff;
  padding: 0 clamp(16px, 4vw, 36px);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

.top-bar .logo-text {
  color: #fff;
}

.top-bar .logo-sub {
  color: var(--silver);
}

.top-bar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.model-tag {
  font-size: 12px;
  color: #e4c97a;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 11px;
  white-space: nowrap;
}

.top-user {
  font-size: 12px;
  color: var(--silver);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-top-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--mist);
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.btn-top-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* PROGRESS */
.prog-track {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(12px, 3vw, 36px);
  display: flex;
  align-items: stretch;
  min-height: 62px;
  overflow-x: auto;
  position: sticky;
  top: 54px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.ps {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0 12px 0 8px;
  border: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  user-select: none;
  font: inherit;
  background: transparent;
  color: inherit;
}

.ps:focus-visible {
  outline: 2px solid var(--navy-light);
  outline-offset: 2px;
}

.ps:hover {
  background: var(--fog);
}

.ps.active {
  border-bottom-color: var(--navy);
  background: var(--fog);
}

.ps.done {
  border-bottom-color: var(--green);
}

.ps-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
  transition: all 0.2s;
}

.ps-num-final {
  font-size: 13px;
  font-weight: 600;
}

.ps.active .ps-num {
  background: var(--navy);
  color: #fff;
}

.ps.done .ps-num {
  background: var(--green);
  color: #fff;
}

.ps-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
  line-height: 1.2;
  text-align: left;
}

.ps.active .ps-title {
  color: var(--navy);
}

.ps.done .ps-title {
  color: var(--green);
}

.ps-en {
  font-size: 9px;
  color: var(--text-light);
  font-family: var(--font-mono);
  white-space: nowrap;
  margin-top: 2px;
  text-align: left;
}

.ai-dot {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 6px;
  flex-shrink: 0;
}

.prog-arrow {
  color: var(--border);
  font-size: 13px;
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
  user-select: none;
}

/* LAYOUT */
.body-wrap {
  display: flex;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 36px) clamp(16px, 4vw, 36px) 80px;
  gap: 28px;
  align-items: flex-start;
}

.content-col {
  flex: 1;
  min-width: 0;
}

.aside-col {
  width: 268px;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .body-wrap {
    flex-direction: column;
  }

  .aside-col {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .aside-col {
    grid-template-columns: 1fr;
  }

  .top-bar-right .model-tag {
    display: none;
  }
}

/* STEP HEADER */
.step-head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.step-head-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.step-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-light);
  background: var(--fog);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-badge {
  font-size: 10px;
  color: var(--gold);
  font-family: var(--font-mono);
  background: var(--gold-pale);
  border: 1px solid #d4b85a;
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
}

.ai-badge.hidden {
  display: none !important;
}

.step-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin: 0;
}

.step-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 640px;
  margin: 8px 0 0;
}

.main-body {
  animation: fadeInBody 0.22s ease;
}

@keyframes fadeInBody {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CARDS */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin: 0 0 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.field-block {
  margin-bottom: 14px;
}

.field-block:last-child {
  margin-bottom: 0;
}

.field-block > span.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.field-block textarea,
.field-block input[type='text'],
.field-block input[type='number'] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.field-block textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.field-block textarea:focus,
.field-block input:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(43, 77, 140, 0.1);
  background: #fff;
}

.hint {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  margin: 0 0 12px;
  padding: 10px 13px;
  background: var(--fog);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.hint strong {
  color: var(--navy);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.btn {
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-ai {
  background: var(--gold);
  color: #fff;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-ai:hover:not(:disabled) {
  background: #9a7020;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 137, 42, 0.3);
}

.btn-secondary {
  background: #fff;
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--fog);
}

.ai-out {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid #d4b85a;
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 13.5px;
  color: var(--text);
  min-height: 48px;
  max-height: 480px;
  overflow-y: auto;
}

.ai-out.loading {
  color: var(--text-light);
  font-style: italic;
  background: rgba(253, 248, 236, 0.6);
}

/* bottom nav */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-prev:hover:not(:disabled) {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--fog);
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-next:hover:not(:disabled) {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-next.green {
  background: var(--green);
}

.btn-next.green:hover:not(:disabled) {
  background: #155a3e;
}

.step-ctr {
  font-size: 12px;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.sync-hint-line {
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
  font-family: var(--font-mono);
}

/* ASIDE */
.aside-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.aside-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.aside-tip {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.7;
  margin: 0;
}

.aside-tip strong {
  color: var(--navy);
  font-weight: 600;
}

/* —— 课程框架表 —— */
.framework-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.framework-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 880px;
}

.framework-table th,
.framework-table td {
  border: 1px solid var(--border-light);
  padding: 10px 10px;
  vertical-align: top;
}

.framework-table th {
  background: var(--fog);
  color: var(--text-mid);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

.framework-table .struct {
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--navy-mid);
  white-space: nowrap;
}

.framework-table textarea,
.framework-table input {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  resize: vertical;
  outline: none;
}

.framework-table textarea:focus,
.framework-table input:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 2px rgba(43, 77, 140, 0.08);
}

.framework-table input[type='text'] {
  min-height: 34px;
}

.framework-table .hint-cell {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.45;
  max-width: 200px;
  font-weight: 400;
}

.stat-row td {
  background: linear-gradient(90deg, rgba(26, 107, 74, 0.06), rgba(15, 31, 61, 0.04));
  font-weight: 600;
}

.title-row td {
  background: var(--fog);
}

/* —— 管理后台 —— */
.admin-link {
  color: var(--mist);
  text-decoration: none;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.admin-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-link.hidden {
  display: none !important;
}

.view-admin {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.admin-body {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  width: 100%;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text-mid);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  color: var(--navy);
}

.admin-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.admin-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.admin-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.admin-add-row input[type='text'],
.admin-add-row input[type='password'] {
  flex: 1;
  min-width: 140px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
}

.admin-add-row select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  min-width: 160px;
}

.admin-filter {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-filter label {
  font-size: 13px;
  color: var(--text-mid);
}

.admin-add-student {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.admin-list li:last-child {
  border-bottom: none;
}

.btn-del {
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--text-mid);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-del:hover {
  border-color: var(--danger, #f87171);
  color: var(--danger, #f87171);
}

/* —— 全站页脚（华商基业） —— */
.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, #f1f5f9 0%, #e8eef5 100%);
  border-top: 1px solid var(--border-light);
}

.site-footer-cn {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--text-mid);
  font-weight: 500;
}

.site-footer-en {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* —— 打印 —— */
@media print {
  .top-bar,
  .prog-track,
  .aside-col,
  .nav-bar,
  .sync-hint-line,
  .row-actions,
  .btn-top-logout,
  .model-tag,
  .site-footer,
  #view-login {
    display: none !important;
  }

  .view-workshop {
    display: block;
  }

  .body-wrap {
    padding: 0;
    max-width: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .framework-wrap {
    box-shadow: none;
    break-inside: avoid;
  }

  .framework-table th,
  .framework-table td {
    border-color: #ccc;
  }
}
