/* ============================================================
   课程助手 - 设计系统
   按原站 sign.luluapi.pro 的 CSS token 还原:
   主色 #2080f0 (naive-ui 蓝) · 背景 #f6f7f9 · 圆角 6/8px
   输入框/按钮 min-height 44px · 页宽 1080px · 卡片网格布局
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { min-height: 100%; background: #f6f7f9; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", sans-serif;
  color: #1f2329; font-size: 14px; line-height: 1.6;
}
:root { --page-max-width: 1080px; --primary: #2080f0; }

/* ---------- 布局骨架 ---------- */
.app-shell { min-height: 100vh; }
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid #e6e8ec; padding: 12px 16px;
}
.app-header-inner {
  max-width: var(--page-max-width); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.credits-pill {
  background: #e8f1fd; color: #1060c9; border-radius: 20px;
  padding: 4px 14px; font-size: 13px;
}
.credits-pill b { font-size: 15px; }
.app-main { padding: 20px 16px 40px; }
.page-container { max-width: var(--page-max-width); margin: 0 auto; }
.capability-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
/* ---------- 主栏 / 侧栏 (桌面: 课程+日志为主栏, 账号+额度为侧栏) ---------- */
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.panel-main { display: grid; gap: 12px; min-width: 0; }
.panel-side { display: grid; gap: 12px; min-width: 0; }
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-side { order: 2; }
  .panel-main { order: 1; }
}
@media (max-width: 640px) {
  .app-main { padding: 12px 10px 28px; }
  .capability-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}
/* ---------- 表单标签 / 大字余额 / 平台切换 / 提示 / 分页 ---------- */
.field-label { font-size: 13px; color: #444; font-weight: 600; margin-top: 8px; }
.credits-big b { font-size: 30px; color: #1060c9; }
.credits-big span { color: #666; font-size: 13px; }
.platform-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.n-alert--warn { background: #fff7e6; border: 1px solid #ffd591; color: #ad6800; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; justify-content: flex-end; }
/* 二维码展开时不撑高旁边卡片 */
.account-panel .login-qr { max-width: 200px; height: auto; }
@media (max-width: 640px) {
  .app-main { padding: 12px 10px 28px; }
  .capability-grid { grid-template-columns: 1fr; }
}

/* ---------- n-card ---------- */
.n-card {
  background: #fff; border-radius: 8px; border: 1px solid #e6e8ec;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  display: flex; flex-direction: column; min-width: 0;
}
.n-card__header {
  padding: 14px 20px 0; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.n-card__content { padding: 16px 20px 20px; min-width: 0; }

/* ---------- n-btn (min-height 44px, 圆角 6px) ---------- */
.n-btn {
  min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1px solid #d0d4da;
  background: #fff; color: #1f2329; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s; white-space: nowrap; text-decoration: none; max-width: 100%;
}
.n-btn:hover { border-color: #4098fc; color: #2080f0; }
.n-btn:active { background: #f2f6fc; }
.n-btn:disabled { opacity: .5; cursor: not-allowed; }
.n-btn--primary { background: #2080f0; border-color: #2080f0; color: #fff; }
.n-btn--primary:hover { background: #4098fc; border-color: #4098fc; color: #fff; }
.n-btn--primary:active { background: #1060c9; border-color: #1060c9; }
.n-btn--error { color: #d03050; }
.n-btn--error:hover { border-color: #d03050; color: #d03050; }
.n-btn--text { border: none; background: transparent; color: #2080f0; min-height: 36px; padding: 0 8px; }
.n-btn--text:hover { background: #f2f6fc; color: #2080f0; }
.n-btn--small { min-height: 28px; padding: 0 10px; font-size: 13px; border-radius: 5px; }

/* ---------- 表单 (min-height 44px / 圆角 6px / 边框 #bbb) ---------- */
input, select, textarea {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px;
  padding: 10px 12px; border: 1px solid #bbb; border-radius: 6px;
  font: inherit; font-size: 16px; background: #fff; color: #1f2329;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #2080f0;
  box-shadow: 0 0 0 3px rgba(32,128,240,.15);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: auto; }
label input[type="checkbox"] { width: auto; min-height: auto; }
.login-form { display: grid; gap: 10px; min-width: 0; }
.login-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.login-modes .n-btn, .login-form .n-btn { min-height: 44px; }
.login-qr { display: block; width: 240px; max-width: 100%; height: auto; }

/* ---------- n-alert ---------- */
.n-alert {
  border-radius: 8px; padding: 10px 16px; font-size: 13px;
  display: grid; gap: 4px; overflow-wrap: anywhere;
}
.n-alert a { color: inherit; font-weight: 600; }
.n-alert--info { background: #e8f1fd; border: 1px solid #b9d6f9; color: #1060c9; }
.n-alert--error { background: #fdecee; border: 1px solid #f3b3bd; color: #c02040; }
.n-alert--success { background: #e8f7ee; border: 1px solid #a6dfbe; color: #128047; }

/* ---------- n-tag ---------- */
.n-tag {
  display: inline-block; padding: 1px 10px; border-radius: 12px;
  font-size: 12px; background: #f2f3f5; color: #606266;
}
.n-tag--accepted, .n-tag--done, .n-tag--signed, .n-tag--success { background: #e8f7ee; color: #128047; }
.n-tag--pending, .n-tag--unused, .n-tag--waiting, .n-tag--signing, .n-tag--info { background: #e8f1fd; color: #1060c9; }
.n-tag--failed, .n-tag--error, .n-tag--expired, .n-tag--voided { background: #fdecee; color: #c02040; }
.n-tag--redeemed, .n-tag--unknown, .n-tag--default { background: #f2f3f5; color: #606266; }

/* ---------- 业务组件 ---------- */
.lesson-item {
  padding: 12px 0; border-top: 1px solid #eee; display: grid; gap: 6px;
}
.lesson-item:first-of-type { border-top: none; padding-top: 0; }
.lesson-title { overflow-wrap: anywhere; font-size: 15px; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.lesson-actions .n-btn { min-height: 32px; }

.account-panel { display: grid; gap: 12px; min-width: 0; }
.account-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 1px solid #e6e8ec; border-radius: 8px;
}
.redeem-form { display: grid; gap: 6px; padding-top: 4px; }
.redeem-label { font-size: 13px; color: #555; }
.redeem-row { display: flex; flex-wrap: wrap; gap: 8px; }
.redeem-row input { flex: 1 1 220px; }

.schedule-task {
  display: grid; gap: 8px; min-width: 0; padding: 12px;
  border: 1px solid #e6e8ec; border-radius: 8px; margin-bottom: 8px;
}
.task-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.task-message { overflow-wrap: anywhere; font-size: 13px; color: #555; }
.schedule-hint { color: #666; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: #f6f7f9; border: 1px solid #e6e8ec; border-radius: 8px;
  padding: 14px 10px; text-align: center;
}
.stat b { display: block; font-size: 24px; color: #2080f0; }
.stat span { color: #909399; font-size: 12px; }

.code-list { display: grid; gap: 8px; }
.code-item {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 8px 12px; border: 1px solid #e6e8ec; border-radius: 8px; font-size: 13px;
}
.code-item code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #1060c9; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; justify-content: center; align-items: center; z-index: 100; padding: 16px;
}
.modal-body { width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.place-results { max-height: 200px; overflow-y: auto; margin-top: 8px; }
.saved-places { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.saved-place { background: #eef2ff; border-radius: 12px; padding: 2px 10px;
  font-size: 12px; cursor: pointer; }
.saved-place i { margin-left: 4px; color: #888; font-style: normal; }
@media (max-width: 640px) {
  .modal-body { width: calc(100vw - 24px); max-height: 90vh; overflow-y: auto; }
}
