:root {
  --bg: #0f1115;
  --bg-soft: #13161d;
  --card: #1a1d24;
  --card-hover: #20242d;
  --border: #262b36;
  --border-soft: #1f242e;
  --text: #e7eaf0;
  --text-muted: #939bb0;
  --text-dim: #5f6779;
  --primary: #6c8cff;
  --primary-strong: #5a78f0;
  --primary-soft: rgba(108, 140, 255, 0.14);
  --accent: #2dd4bf;
  --success: #34d399;
  --warning: #f0b35c;
  --danger: #f06464;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: rgba(108, 140, 255, 0.35);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #2d3340;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a4252;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- 通用组件 ---------------- */

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #11141a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder {
  color: var(--text-dim);
}

.input:hover {
  border-color: #333a49;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #12161e;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

select.input option {
  background: #161a22;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 8px 20px rgba(90, 120, 240, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7b98ff, #6884f5);
  box-shadow: 0 10px 24px rgba(90, 120, 240, 0.38);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
  background: #151922;
}

.btn-ghost:hover {
  border-color: #3a4252;
  color: var(--text);
  background: var(--card-hover);
}

.btn-danger {
  border-color: rgba(240, 100, 100, 0.35);
  color: var(--danger);
  background: rgba(240, 100, 100, 0.08);
}

.btn-danger:hover {
  border-color: rgba(240, 100, 100, 0.6);
  background: rgba(240, 100, 100, 0.16);
}

.btn-block {
  width: 100%;
}

/* 登录成功后的「进入系统」链接复用按钮样式 */
a.btn {
  text-decoration: none;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

.input-sm {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
  min-width: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: #3a4252;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* 徽章前置彩色圆点 */
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}

.badge-blue {
  background: rgba(108, 140, 255, 0.14);
  border-color: rgba(108, 140, 255, 0.28);
  color: #9db2ff;
}

.badge-green {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.28);
  color: #5ee3b3;
}

.badge-orange {
  background: rgba(240, 179, 92, 0.14);
  border-color: rgba(240, 179, 92, 0.3);
  color: #f3c17d;
}

.badge-red {
  background: rgba(240, 100, 100, 0.14);
  border-color: rgba(240, 100, 100, 0.28);
  color: #f58f8f;
}

.badge-gray {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.badge-gray::before {
  box-shadow: none;
  opacity: 0.6;
}

/* 订单状态下拉：按状态着色（待处理/操作中/已完成/已退款） */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 92px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  padding-right: 24px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b90a0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.status-select:hover {
  filter: brightness(1.15);
}

.status-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(108, 140, 255, 0.25);
}

.status-select.status-pending {
  background-color: rgba(240, 179, 92, 0.12);
  border-color: rgba(240, 179, 92, 0.45);
  color: #f3c17d;
}

.status-select.status-processing {
  background-color: rgba(108, 140, 255, 0.12);
  border-color: rgba(108, 140, 255, 0.45);
  color: #9db2ff;
}

.status-select.status-completed {
  background-color: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.4);
  color: #5ee3b3;
}

.status-select.status-refunded {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
}

.status-select.status-failed {
  background-color: rgba(240, 100, 100, 0.12);
  border-color: rgba(240, 100, 100, 0.4);
  color: #f58f8f;
}

/* select 的 option 用系统默认样式，保证可读性 */
.status-select option {
  background: #1a1d24;
  color: var(--text);
}

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

.dim {
  color: var(--text-dim);
}

.spacer {
  flex: 1;
}

/* ---------------- 登录页 ---------------- */

.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(800px 500px at 50% -10%, rgba(108, 140, 255, 0.14), transparent 70%),
    radial-gradient(600px 400px at 90% 110%, rgba(45, 212, 191, 0.07), transparent 70%),
    var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.24), rgba(45, 212, 191, 0.16));
  border: 1px solid rgba(108, 140, 255, 0.35);
  box-shadow: 0 12px 30px rgba(90, 120, 240, 0.22);
  color: #b9c8ff;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.login-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-label {
  font-size: 13px;
  color: var(--text-muted);
}

.card-input {
  height: 52px;
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  padding: 0 10px;
}

.card-input::placeholder {
  letter-spacing: 2px;
  color: #3f4657;
}

.login-card .btn {
  height: 46px;
  font-size: 15px;
}

.login-card .btn.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  /* 有限次旋转：避免无限动画让浏览器自动化工具一直等待动画结束 */
  animation: spin 0.7s linear 2;
}

.login-foot {
  color: var(--text-dim);
  font-size: 12px;
}

.tip {
  display: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
  word-break: break-all;
}

.tip.show {
  display: block;
  animation: fade-in 0.2s ease;
}

.tip-error {
  background: rgba(240, 100, 100, 0.1);
  border-color: rgba(240, 100, 100, 0.28);
  color: #f59a9a;
}

.tip-success {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
  color: #6ee7bb;
}

.tip-info {
  background: rgba(108, 140, 255, 0.1);
  border-color: rgba(108, 140, 255, 0.28);
  color: #a6b8ff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------- 卡密系统页 ---------------- */

.page-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 22px;
  background: rgba(20, 23, 30, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 14px rgba(108, 140, 255, 0.6);
  flex: none;
}

.site-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
}

.nav-toggle {
  display: none;
}

.appnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
}

.appnav-item {
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.appnav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.appnav-item.active {
  color: #c9d5ff;
  background: var(--primary-soft);
  border-color: rgba(108, 140, 255, 0.3);
}

.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 320px;
}

.home-panel {
  width: 100%;
  max-width: 1200px;
}

.home-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.home-card-head h2 {
  font-size: 16px;
  font-weight: 600;
}

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

.home-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  background: #12151c;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.home-label {
  font-size: 12px;
  color: var(--text-dim);
}

.home-value {
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.home-value.mono {
  font-family: var(--mono);
  letter-spacing: 1px;
  color: #c7d1ff;
}

/* 湛幼选课 */

.school-login-section {
  width: 100%;
  max-width: 1460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.school-login-section h2 {
  font-size: 18px;
  font-weight: 600;
}

.school-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #12151c;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

/* 选课页公告容器（数量由管理端配置） */
.course-announcements {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-announcements[hidden] {
  display: none !important;
}

.school-tip.school-warm {
  background: rgba(108, 140, 255, 0.06);
  border-color: rgba(108, 140, 255, 0.22);
}

.school-tip.school-disclaimer {
  background: rgba(240, 179, 92, 0.06);
  border-color: rgba(240, 179, 92, 0.22);
}

.tip-icon {
  flex: none;
  line-height: 1.5;
}

.tip-text {
  min-width: 0;
}

.school-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.form-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.form-group-inline {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 180px;
  min-width: 0;
}

.form-group-inline > label {
  font-size: 13px;
  color: var(--text-muted);
}

.form-group-inline input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #11141a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group-inline input::placeholder {
  color: var(--text-dim);
}

.form-group-inline input:hover {
  border-color: #333a49;
}

.form-group-inline input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #12161e;
}

.course-list-container {
  flex: 1 1 100%;
}

.course-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

.selected-count {
  color: #9db2ff;
}

.course-checkbox-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  background: #12151c;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.empty-hint {
  padding: 22px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.course-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.course-item:hover {
  background: rgba(108, 140, 255, 0.06);
}

.course-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
}

.course-item:has(input:checked) {
  background: rgba(108, 140, 255, 0.1);
  border-color: rgba(108, 140, 255, 0.3);
}

.course-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.course-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.course-name {
  word-break: break-word;
}

/* 课程标签区：扣除额度 / 免费下单 */
.course-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.course-quota-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(108, 140, 255, 0.14);
  border: 1px solid rgba(108, 140, 255, 0.45);
  color: #93a9ff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.course-quota-tag.is-free {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* 0 额度班号：免费下单标签 */
.free-order-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #4ade80;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  vertical-align: middle;
  white-space: nowrap;
}

.course-meta {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-word;
}

/* 下单记录 */

.order-list-wrap {
  margin-top: 20px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.order-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.order-list-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.btn-small {
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.order-item {
  padding: 12px 14px;
  background: #12151c;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.order-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.order-course-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.order-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.order-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  word-break: break-all;
}

.btn-submit,
.btn-reset,
.btn-save {
  height: 40px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn-submit {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 8px 20px rgba(90, 120, 240, 0.28);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #7b98ff, #6884f5);
  box-shadow: 0 10px 24px rgba(90, 120, 240, 0.38);
}

.btn-reset {
  background: #151922;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-reset:hover {
  border-color: #3a4252;
  color: var(--text);
  background: var(--card-hover);
}

.btn-save {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: #7ce8d7;
}

.btn-save:hover {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(45, 212, 191, 0.55);
}

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

.error-message,
.success-message {
  display: none;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.error-message.show,
.success-message.show {
  display: block;
  animation: fade-in 0.2s ease;
}

.error-message.show {
  background: rgba(240, 100, 100, 0.1);
  border-color: rgba(240, 100, 100, 0.28);
  color: #f59a9a;
}

.success-message.show {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
  color: #6ee7bb;
}

.placeholder {
  color: var(--text-dim);
  font-size: 15px;
  letter-spacing: 1px;
  text-align: center;
}

.placeholder::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 0 auto 18px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
}

/* ---------------- 管理端 ---------------- */

.page-admin {
  background: var(--bg);
}

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(108, 140, 255, 0.12), transparent 70%),
    var(--bg);
}

.admin-login .login-card {
  max-width: 380px;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 224px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #14171e;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-brand .logo-dot {
  flex: none;
}

.side-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
}

/* 菜单分组：按业务域收纳 */
.side-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-group-title {
  padding: 0 12px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  white-space: nowrap;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.side-nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.8;
  flex: none;
}

.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.side-nav-item.active {
  background: var(--primary-soft);
  border-color: rgba(108, 140, 255, 0.22);
  color: #c3cfff;
}

.side-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.side-foot .admin-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-foot button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
}

.side-foot button:hover {
  color: var(--danger);
}

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 35;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 26px;
  background: rgba(15, 17, 21, 0.92);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
}

.admin-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.admin-header .site-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.side-toggle {
  display: none;
}

.admin-content {
  padding: 26px;
  flex: 1;
}

.panel {
  max-width: none;
}

.panel[hidden] {
  display: none !important;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-head h3 {
  font-size: 16px;
  font-weight: 600;
}

.panel-head p {
  font-size: 13px;
  color: var(--text-dim);
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.section-card + .section-card {
  margin-top: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

/* flex 布局的 field 需要显式声明 hidden，否则 hidden 属性会被 display:flex 覆盖 */
.field[hidden] {
  display: none;
}

.field > label {
  font-size: 13px;
  color: var(--text-muted);
}

.field-wide {
  grid-column: 1 / -1;
}

.field .hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 表单网格中的操作行独占整行，保证按钮与输入框上下对齐 */
.form-actions-full {
  grid-column: 1 / -1;
}

/* 选课页公告配置（管理端） */
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.announcement-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.announcement-type {
  width: 130px;
  flex: none;
}

.announcement-text {
  flex: 1;
  height: auto;
  min-height: 42px;
  padding: 8px 12px;
  line-height: 1.5;
  resize: vertical;
}

/* 公告发布状态与排序控件 */
.announcement-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 42px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.announcement-online input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.announcement-online.is-offline {
  color: var(--text-dim);
}

.announcement-order {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

@media (max-width: 720px) {
  .announcement-row {
    flex-wrap: wrap;
  }

  .announcement-type,
  .announcement-text {
    width: 100%;
    flex-basis: 100%;
  }

  .announcement-online {
    height: auto;
  }
}

.result-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #12151c;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: #151922;
  font-size: 13px;
}

.result-head strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.result-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gen-list {
  margin: 0;
  padding: 16px;
  max-height: 340px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: #c7d1ff;
  white-space: pre;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .input {
  width: auto;
  min-width: 170px;
}

.toolbar .search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1180px;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.table th {
  background: #151922;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table .card-code {
  font-family: var(--mono);
  letter-spacing: 0.5px;
  color: #c7d1ff;
}

.table .actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.table .empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--text-dim);
}

.table .remark-cell,
.table .ua-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

/* 订单表格备注输入框 */
.table .remark-input {
  width: 220px;
  min-width: 180px;
}

/* 卡密列表表格列宽按内容自适应 */
.panel[data-panel="cards"] .table {
  min-width: 0;
}

/* ---------------- 管理端：打卡订单列表 ---------------- */

/* 列较多，交给表格横向滚动 */
.panel[data-panel="internshipOrders"] .panel-head {
  align-items: center;
  gap: 12px;
}

.panel[data-panel="internshipOrders"] .panel-head p {
  max-width: 640px;
  line-height: 1.6;
}

.panel[data-panel="internshipOrders"] .toolbar {
  margin-bottom: 12px;
}

.panel[data-panel="internshipOrders"] .toolbar .search-input {
  max-width: 360px;
}

/* 筛选下拉与按钮高度对齐 */
.panel[data-panel="internshipOrders"] .toolbar select.input {
  min-width: 132px;
  height: 36px;
  font-size: 13px;
}

.panel[data-panel="internshipOrders"] .table-wrap {
  margin-bottom: 0;
}

.panel[data-panel="internshipOrders"] .table {
  min-width: 1502px;
}

.panel[data-panel="internshipOrders"] .table th,
.panel[data-panel="internshipOrders"] .table td {
  padding: 12px;
  vertical-align: middle;
}

.panel[data-panel="internshipOrders"] .table th {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.panel[data-panel="internshipOrders"] .table th:first-child,
.panel[data-panel="internshipOrders"] .table td:first-child {
  padding-left: 16px;
}

.panel[data-panel="internshipOrders"] .table th:last-child,
.panel[data-panel="internshipOrders"] .table td:last-child {
  padding-right: 16px;
}

/* 列宽：保证内容不互相挤压 */
.panel[data-panel="internshipOrders"] .table th:nth-child(1) { min-width: 86px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(2) { min-width: 170px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(3) { min-width: 96px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(4) { min-width: 76px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(5) { min-width: 150px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(6) { min-width: 84px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(7) { min-width: 170px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(8) { min-width: 132px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(9) { min-width: 72px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(10) { min-width: 96px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(11) { min-width: 80px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(12) { min-width: 78px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(13) { min-width: 88px; }
.panel[data-panel="internshipOrders"] .table th:nth-child(14) { min-width: 242px; }

/* 打卡地址：允许换行并限制宽度，避免挤压相邻列 */
.panel[data-panel="internshipOrders"] .checkin-address-cell {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.55;
  color: var(--text-muted);
}

/* 打卡周期标签紧凑、对齐 */
.panel[data-panel="internshipOrders"] .checkin-cycle-tags {
  gap: 4px;
}

.panel[data-panel="internshipOrders"] .checkin-cycle-tag {
  padding: 1px 6px;
  font-size: 11px;
}

/* 状态类单元格统一单行居中 */
.panel[data-panel="internshipOrders"] .checkin-expire-state-cell,
.panel[data-panel="internshipOrders"] .checkin-today-cell,
.panel[data-panel="internshipOrders"] .checkin-switch-cell {
  white-space: nowrap;
}

/* 分页与表格保持呼吸感 */
.panel[data-panel="internshipOrders"] .pager {
  margin-top: 16px;
}

/* 工具栏内联复选框 */
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.check-inline input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 已删除订单行：整体降透明，区别正常订单 */
.checkin-row-deleted td {
  opacity: 0.6;
}

.checkin-deleted-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 详情弹窗：操作审计 */
.checkin-audit {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.checkin-audit-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.checkin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkin-audit-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #151922;
}

.checkin-audit-action {
  flex-shrink: 0;
  font-size: 12px;
  color: #9db2ff;
}

.checkin-audit-message {
  flex: 1;
  min-width: 160px;
  font-size: 12px;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
}

.checkin-audit-meta {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.checkin-audit-empty {
  font-size: 12px;
  color: var(--text-dim);
}

.order-table {
  min-width: 0;
  table-layout: auto;
}

.order-table th,
.order-table td {
  white-space: nowrap;
  width: auto;
  padding: 12px 8px;
}

.order-table .remark-cell {
  max-width: 260px;
}

.order-table .remark-input {
  width: 100%;
  min-width: 120px;
}

.order-table .status-select {
  min-width: 88px;
  width: 100%;
}

.order-table:not(.user-order-table) th:nth-child(6),
.order-table:not(.user-order-table) td:nth-child(6) {
  min-width: 96px;
}

/* 已选课程名称可能较长，允许换行压缩列宽 */
.order-table:not(.user-order-table) th:nth-child(7),
.order-table:not(.user-order-table) td:nth-child(7) {
  white-space: normal;
  min-width: 130px;
  max-width: 240px;
}

/* 用户端下单记录：加宽展示，课程与备注列允许换行 */
.user-order-table th {
  padding: 14px 14px;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.user-order-table td {
  padding: 16px 14px;
  line-height: 1.55;
  vertical-align: middle;
  border-bottom-color: var(--border);
}

.user-order-table th {
  border-bottom-color: var(--border);
}

.user-order-table th:nth-child(3),
.user-order-table td:nth-child(3) {
  white-space: normal;
  min-width: 130px;
  max-width: 230px;
}

.user-order-table th:nth-child(6),
.user-order-table td:nth-child(6) {
  white-space: nowrap;
}

/* 订单号 / 来源卡密保持单行，窄屏由外层容器横向滚动承载 */
.user-order-table .card-code {
  white-space: nowrap;
  word-break: normal;
}

.user-order-table th:nth-child(9),
.user-order-table td:nth-child(9) {
  white-space: normal;
  min-width: 130px;
  max-width: 200px;
}

.table .ua-cell {
  max-width: 260px;
}

/* 打卡日志：下单记录表格 */
.checkin-order-table {
  min-width: 1440px;
  table-layout: auto;
}

/* 到期状态列：徽标单行展示 */
.checkin-order-table .checkin-expire-state-cell {
  white-space: nowrap;
}

/* 原生日期选择器：跟随深色主题 */
input[type="date"] {
  color-scheme: dark;
}

/* 打卡开关独立列：保持开关与状态文案单行展示 */
.checkin-order-table .checkin-switch-cell {
  white-space: nowrap;
}

/* 今日打卡列：徽标单行展示 */
.checkin-order-table .checkin-today-cell {
  white-space: nowrap;
}

/* 打卡记录弹窗表格 */
.checkin-records-table {
  min-width: 680px;
}

.checkin-records-table th,
.checkin-records-table td {
  padding: 12px 14px;
  font-size: 12.5px;
}

.checkin-records-table .wrap-cell {
  min-width: 180px;
  max-width: 420px;
  white-space: normal;
}

.checkin-records-table .checkin-records-date {
  white-space: nowrap;
}

/* 打卡记录：日志内容长文本换行并限制宽度，避免溢出撑破表格 */
.checkin-records-table .checkin-records-log {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.checkin-records-table .checkin-records-log-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  min-width: 200px;
  max-width: 320px;
  line-height: 1.65;
  font-size: 12px;
  color: var(--text-muted);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 打卡记录：本次实际使用的图片缩略图 */
.checkin-records-thumb {
  width: 40px;
  height: 40px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.08);
  transition: border-color 0.15s ease;
}

.checkin-records-thumb:hover {
  border-color: var(--primary);
}

.checkin-order-table .actions.checkin-actions {
  display: grid;
  grid-template-columns: repeat(3, 66px);
  gap: 6px;
  justify-content: start;
}

.checkin-order-table .checkin-actions-cell {
  min-width: 224px;
  vertical-align: middle;
}

.checkin-order-table .checkin-actions .btn {
  width: 100%;
  height: 28px;
  padding: 0 4px;
  font-size: 12px;
  white-space: nowrap;
}

.checkin-order-table th:last-child {
  white-space: nowrap;
}

/* 开始打卡日期：自定义日期选择器（超出范围置灰不可选） */
.checkin-date-wrap {
  position: relative;
  display: flex;
  gap: 8px;
}

.field-error {
  font-size: 12px;
  line-height: 1.5;
  color: var(--danger);
}

.checkin-date-wrap .input {
  flex: 1;
  min-width: 0;
}

.checkin-date-btn {
  flex: none;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.checkin-date-btn:hover,
.checkin-date-btn[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--primary);
}

.checkin-date-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkin-calendar {
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 6px);
  width: min(280px, calc(100vw - 60px));
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.checkin-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.checkin-calendar-head button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.checkin-calendar-head button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--primary);
}

.checkin-calendar-head button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 日历右上角操作组：今日快捷按钮 + 下个月 */
.checkin-calendar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkin-calendar-head .checkin-calendar-today {
  width: auto;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.checkin-calendar-head .checkin-calendar-today:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.checkin-calendar-head span {
  font-size: 13px;
  font-weight: 600;
}

.checkin-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.checkin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.checkin-calendar-day {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.checkin-calendar-day:hover:not(:disabled) {
  border-color: var(--primary);
}

.checkin-calendar-day.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.checkin-calendar-day:disabled {
  color: var(--text-dim);
  opacity: 0.4;
  cursor: not-allowed;
}

.checkin-calendar-blank {
  height: 32px;
}

.checkin-order-table th {
  padding: 14px 14px;
  border-bottom-color: var(--border);
}

.checkin-order-table td {
  padding: 16px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  vertical-align: middle;
  border-bottom-color: var(--border);
}

.checkin-order-table .wrap-cell {
  white-space: normal;
  min-width: 120px;
  max-width: 220px;
}

/* 学号保持单行展示，避免窄屏逐字换行 */
.checkin-order-table .card-code {
  white-space: nowrap;
  word-break: normal;
}

/* 实习信息：状态标签与可下单高亮 */
.sx-status-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sx-status-tag.is-active {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #4ade80;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.12);
}

.sx-status-tag.is-inactive {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.35);
  color: #9aa4b2;
}

.internship-item {
  flex-wrap: wrap;
}

/* 「实习中」整行浅绿底色；选中态仍由 .course-item:has(input:checked) 的蓝色覆盖 */
.internship-item.is-active {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
}

.course-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.course-item.is-disabled:hover {
  background: transparent;
}

.btn-tip-wrap {
  display: inline-flex;
}

/* 桌面端详情弹窗双列布局，减少滚动；窄屏自动单列 */
#checkinDetailBody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

/* ---------------- 湛幼实习打卡页 ---------------- */

.checkin-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #2f6bff 0%, #3b82f6 48%, #22d3ee 100%);
  box-shadow: 0 18px 42px rgba(47, 107, 255, 0.22);
  overflow: hidden;
}

.checkin-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -110px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.checkin-hero-icon {
  width: 54px;
  height: 54px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 18, 44, 0.32);
  color: #fff;
}

.checkin-hero-icon svg {
  width: 28px;
  height: 28px;
}

.checkin-hero-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.checkin-hero-eyebrow {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.checkin-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.checkin-hero p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

.checkin-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.checkin-order-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.checkin-order-main .section-card + .section-card {
  margin-top: 0;
}

.checkin-step-card {
  padding: 22px 24px;
}

.checkin-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.checkin-step-badge {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7dff, #3b82f6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.checkin-step-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.checkin-step-sub {
  font-size: 12px;
  color: var(--text-dim);
}

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

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

.checkin-basic-actions {
  grid-column: 1 / -1;
}

.btn-fetch {
  width: 100%;
  height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f7dff, #3b82f6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.btn-fetch:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-fetch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 实习记录：恢复单选列表交互 */
.checkin-internship-block {
  margin-bottom: 16px;
}

.checkin-internship-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.checkin-sub-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* 打卡地址：独占整行，保证长地址完整展示且可手动编辑 */
.checkin-address-field {
  grid-column: 1 / -1;
}

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

.checkin-stepper {
  display: flex;
  align-items: stretch;
}

.stepper-btn {
  width: 40px;
  height: 42px;
  flex: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.stepper-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.stepper-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.stepper-btn:hover {
  color: var(--text);
  border-color: var(--border-soft);
}

.stepper-input {
  width: 100%;
  text-align: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.checkin-weekday-field {
  margin-top: 16px;
}

.checkin-weekday-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkin-weekday {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #11141a;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.checkin-weekday input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.checkin-weekday:hover {
  border-color: var(--primary);
}

.checkin-weekday:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}

.checkin-submit-wrap {
  display: block;
}

.checkin-submit-btn {
  width: 100%;
  height: 42px;
}

/* 打卡日志：提交订单入口与下单弹窗 */
.checkin-order-action-card .checkin-step-sub {
  margin: 6px 0 14px;
}

.checkin-order-modal .modal-body-scroll {
  gap: 16px;
}

/* 弹窗内的步骤块：去掉外层卡片样式，用分隔线区分步骤 */
.checkin-order-step {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.checkin-order-step + .checkin-order-step {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.checkin-order-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkin-order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.05);
}

.checkin-order-summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-order-summary-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.checkin-order-modal .checkin-calendar {
  z-index: 130;
}

/* ---------------- 打卡日志：统计 / 周期标签 / 开关 / 续费弹窗 ---------------- */

.checkin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px;
}

.checkin-stat {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: baseline;
  column-gap: 6px;
  row-gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(108, 140, 255, 0.06);
}

.checkin-stat-label {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
}

.checkin-stat-unit {
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-cycle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.checkin-cycle-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  white-space: nowrap;
}

.checkin-days-cell,
.checkin-expire-cell {
  white-space: nowrap;
}

.checkin-address-cell {
  min-width: 160px;
  max-width: 260px;
}

.checkin-row-paused td {
  background: rgba(148, 163, 184, 0.08);
}

.checkin-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.checkin-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkin-switch-track {
  position: relative;
  width: 34px;
  height: 18px;
  flex: none;
  border-radius: 999px;
  background: #2a3140;
  border: 1px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.checkin-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9aa4b8;
  transition: transform 0.18s ease, background 0.18s ease;
}

.checkin-switch input:checked + .checkin-switch-track {
  background: var(--primary);
  border-color: var(--primary);
}

.checkin-switch input:checked + .checkin-switch-track .checkin-switch-thumb {
  transform: translateX(16px);
  background: #fff;
}

.checkin-switch input:focus-visible + .checkin-switch-track {
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.checkin-switch input:disabled + .checkin-switch-track {
  opacity: 0.55;
}

.checkin-switch-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.checkin-switch input:checked ~ .checkin-switch-text {
  color: var(--primary);
}

/* 编辑弹窗：修改密码输入行 */
.checkin-password-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkin-password-row .input {
  flex: 1;
  min-width: 0;
}

.checkin-password-row .btn {
  flex: none;
}

/* 打卡图片：上传区与列表 */
.checkin-image-field {
  margin-top: 14px;
}

/* 图片来源二选一：公共图片池 / 我的上传图片池 */
.checkin-image-source {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.checkin-source-option {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.checkin-source-option:hover {
  border-color: var(--primary);
}

.checkin-source-option.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.checkin-source-option input {
  flex: none;
  margin: 0;
  accent-color: var(--primary);
}

.checkin-mine-image-panel {
  margin-top: 12px;
}

/* 表单内高亮提示：淡主色背景 + 左侧强调线 + 「提示」徽章 */
.field .checkin-hint-highlight {
  display: block;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(108, 140, 255, 0.35);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.field .checkin-hint-highlight::before {
  content: '提示';
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  vertical-align: middle;
}

.checkin-mine-image-panel:not([hidden]) {
  animation: checkin-panel-fade 0.18s ease;
}

@keyframes checkin-panel-fade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.checkin-upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.checkin-upload-zone:hover,
.checkin-upload-zone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.checkin-upload-zone svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.checkin-upload-title {
  font-size: 13px;
  color: var(--text);
}

.checkin-upload-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkin-upload-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.checkin-upload-row .checkin-upload-zone {
  width: 100%;
  min-height: 128px;
  padding: 18px 16px;
}

/* 上传按钮固定宽度靠右，避免受 .btn-fetch 的 100% 宽度影响挤压上传区 */
.checkin-upload-row .btn-fetch {
  flex: none;
  align-self: flex-end;
  width: auto;
  min-width: 132px;
  padding: 0 20px;
}

.checkin-upload-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.checkin-upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.05);
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-upload-item img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}

.checkin-upload-item .checkin-upload-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 用户端：上传状态面板（进度 / 四态 / 取消） */
.checkin-upload-error {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--danger);
}

.checkin-upload-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.05);
}

.checkin-upload-file {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkin-upload-thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: cover;
  background: rgba(148, 163, 184, 0.08);
}

.checkin-upload-meta {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.checkin-upload-meta .checkin-upload-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.checkin-upload-meta .checkin-upload-size {
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-upload-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-upload-state.is-uploading {
  color: var(--primary);
}

.checkin-upload-state.is-success {
  color: var(--success);
}

.checkin-upload-state.is-error {
  color: var(--danger);
}

.checkin-upload-state-icon {
  position: relative;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.is-uploading .checkin-upload-state-icon {
  border-color: rgba(108, 140, 255, 0.3);
  border-top-color: var(--primary);
  animation: checkin-upload-spin 0.8s linear 3;
}

.is-success .checkin-upload-state-icon {
  border-color: var(--success);
  background: var(--success);
}

.is-success .checkin-upload-state-icon::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #0f1115;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.is-error .checkin-upload-state-icon {
  border-color: var(--danger);
  background: var(--danger);
}

.is-error .checkin-upload-state-icon::after {
  content: '!';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #0f1115;
}

@keyframes checkin-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.checkin-upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.checkin-upload-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.checkin-upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.15s ease;
}

.checkin-upload-bar span.is-success {
  background: var(--success);
}

.checkin-upload-bar span.is-error {
  background: var(--danger);
}

.checkin-upload-percent {
  flex: none;
  min-width: 38px;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.checkin-upload-cancel {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.checkin-upload-cancel:hover {
  border-color: var(--danger);
  background: rgba(240, 100, 100, 0.08);
}

.checkin-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.checkin-image-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checkin-image-thumb:hover {
  border-color: var(--accent);
}

.checkin-image-thumb.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35);
}

.checkin-gallery-check {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.checkin-image-thumb.is-selected .checkin-gallery-check {
  background: var(--accent);
}

.checkin-gallery-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.checkin-image-thumb:hover .checkin-gallery-del {
  opacity: 1;
}

.checkin-gallery-del:hover {
  background: var(--danger);
}

.checkin-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-set-field {
  margin-top: 12px;
}

/* 订单管理头部操作区 */
.order-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
}

/* 头部按钮统一尺寸，视觉更整齐 */
.order-list-actions .btn-small {
  min-width: 84px;
  justify-content: center;
}

/* 图片组管理弹窗 */
.checkin-set-manage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.checkin-set-manage-head .hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.checkin-set-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkin-set-list[hidden] {
  display: none;
}

.checkin-set-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.05);
}

.checkin-set-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.checkin-set-card-name {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-set-card-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-set-card-order {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 9px;
  border: 1px solid rgba(108, 140, 255, 0.45);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
}

/* 关联学号标签高亮：标签用主色加粗，学号保持正文色，便于快速定位 */
.checkin-set-order-label {
  flex: none;
  color: var(--primary);
  font-weight: 600;
}

.checkin-set-order-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: middle;
}

.checkin-set-order-value {
  color: var(--text);
  font-weight: 500;
}

.checkin-set-card-order.is-empty {
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.08);
}

.checkin-set-card-order.is-empty .checkin-set-order-label,
.checkin-set-card-order.is-empty .checkin-set-order-label::before,
.checkin-set-card-order.is-empty .checkin-set-order-value {
  color: var(--text-dim);
  font-weight: 400;
}

.checkin-set-card-order.is-empty .checkin-set-order-label::before {
  background: var(--text-dim);
}


.checkin-set-card-thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.checkin-set-card-thumbs img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

.checkin-set-card-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-set-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.checkin-set-card-del:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.checkin-set-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkin-set-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* 公共图片池预览 */
.checkin-pool-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.checkin-pool-preview[hidden] {
  display: none;
}

.checkin-pool-preview img {
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
  background: rgba(148, 163, 184, 0.06);
}

.checkin-pool-preview span {
  font-size: 12px;
  color: var(--text-dim);
}

/* 下单弹窗：公共图片池分类选择 */
.checkin-pool-pick-panel {
  margin-top: 12px;
}

.checkin-pool-pick-panel[hidden] {
  display: none;
}

.checkin-pool-selected {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.checkin-pool-selected[hidden] {
  display: none;
}

/* 打卡日志：分类选择与文案展示 */
.checkin-log-field {
  margin-top: 16px;
}

.checkin-log-selected {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-word;
}

.checkin-log-selected[hidden] {
  display: none;
}

/* 我的自定义日志：编辑区 */
.checkin-log-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
}

.checkin-log-editor textarea {
  flex: 1 1 260px;
  min-height: 70px;
  resize: vertical;
}

.checkin-log-editor select {
  flex: 0 0 160px;
}

.checkin-log-editor .btn-fetch {
  flex: 0 0 auto;
}

.checkin-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.checkin-log-item {
  position: relative;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.checkin-log-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.checkin-log-del:hover {
  opacity: 1;
  background: var(--danger);
}

.checkin-log-item:hover {
  border-color: var(--primary);
}

.checkin-log-item.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 管理端：日志文案列表 */
.checkin-log-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.checkin-log-admin-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.checkin-log-admin-item.is-disabled {
  opacity: 0.6;
}

.checkin-log-admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.checkin-category-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.checkin-log-admin-state {
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-log-content {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.checkin-log-admin-actions {
  display: flex;
  gap: 8px;
}

.checkin-records-log {
  max-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
}

/* 提交前强制确认弹窗 */
.checkin-pool-confirm-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.checkin-pool-confirm-text strong {
  color: var(--primary);
  font-size: 16px;
}

.checkin-pool-confirm-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.checkin-pool-confirm-preview img {
  max-width: 100%;
  max-height: 240px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
  background: rgba(148, 163, 184, 0.06);
}

.checkin-pool-confirm-preview span {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
  text-align: center;
}

/* 图片组编辑器：上传与图片网格 */
.checkin-set-upload {
  margin-bottom: 6px;
}

/* flex 布局元素需要显式声明 hidden，避免覆盖浏览器默认的 display:none */
.checkin-set-editor[hidden],
.checkin-set-editor-actions[hidden],
#checkinSetUploadProgress[hidden] {
  display: none;
}

.checkin-set-upload .checkin-upload-row .checkin-upload-zone {
  min-height: 96px;
}

.checkin-set-gallery-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.checkin-set-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
}

.checkin-set-tile-del {
  width: 100%;
  padding: 3px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.checkin-set-tile-del:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(240, 100, 100, 0.08);
}

.checkin-image-thumb.is-marked {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(240, 100, 100, 0.35);
}

.checkin-image-thumb.is-marked .checkin-gallery-check {
  background: var(--danger);
}

/* 大图预览 */
.checkin-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(2px);
}

.checkin-lightbox[hidden] {
  display: none;
}

.checkin-lightbox img {
  max-width: min(92vw, 960px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0b1220;
}

.checkin-lightbox-name {
  color: #e2e8f0;
  font-size: 12px;
  word-break: break-all;
  text-align: center;
}

.checkin-lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.checkin-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 640px) {
  .checkin-set-card {
    flex-direction: column;
    align-items: stretch;
  }

  .checkin-set-card-actions {
    justify-content: flex-end;
  }

  .checkin-set-manage-head {
    flex-direction: column;
  }

  .checkin-set-manage-head .btn {
    align-self: flex-end;
  }

  .checkin-set-editor-actions .btn {
    flex: 1 1 0;
  }

  .checkin-pool-preview img {
    max-height: 42vh;
  }

  .checkin-set-gallery-actions {
    justify-content: space-between;
    width: 100%;
  }

  .checkin-lightbox img {
    max-height: 70vh;
  }
}


.checkin-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkin-image-remove {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 0;
  border: none;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.checkin-image-empty {
  font-size: 12px;
  color: var(--text-dim);
}

/* 管理端：打卡图片池 */
.checkin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.checkin-image-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.05);
}

/* 管理端：图片批量操作 */
.checkin-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-soft);
}

.checkin-batch-bar[hidden] {
  display: none;
}

.checkin-batch-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.checkin-batch-bar .input {
  width: auto;
  min-width: 130px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.checkin-image-card.is-batch-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108, 140, 255, 0.35);
}

.checkin-batch-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

.checkin-image-card.is-batch-selected .checkin-batch-check {
  background: var(--primary);
}

.checkin-image-card.is-disabled {
  opacity: 0.55;
}

.checkin-image-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.checkin-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 0;
  font-size: 12px;
}

.checkin-image-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-image-tag {
  flex: none;
  color: var(--text-dim);
}

.checkin-image-tag.is-category {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.checkin-image-tag.is-uncategorized {
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(240, 100, 100, 0.12);
  color: var(--danger);
}

.checkin-image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
}

.checkin-image-category-select {
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
}

/* 分类标签页：管理端与用户端共用 */
.checkin-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.checkin-category-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.checkin-category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.checkin-category-tab.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 编辑弹窗：订单绑定的打卡图片 */
.checkin-edit-image {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.05);
}

.checkin-edit-image-thumb {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: cover;
}

.checkin-edit-image-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-edit-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.checkin-edit-image-actions .btn {
  cursor: pointer;
}

/* 详情弹窗：打卡图片 */
.detail-checkin-image {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-checkin-image img {
  width: 64px;
  height: 64px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: cover;
}

.detail-checkin-image span {
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-renew-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.checkin-renew-summary > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(108, 140, 255, 0.06);
}

.checkin-renew-summary span {
  font-size: 12px;
  color: var(--text-dim);
}

.checkin-renew-summary strong {
  font-size: 18px;
  color: var(--primary);
}

.checkin-renew-expire {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.checkin-renew-expire strong {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 20, 26, 0.96);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  text-align: center;
  animation: fade-in 0.18s ease;
}

.app-toast[hidden] {
  display: none !important;
}

.app-toast-success {
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

.app-toast-error {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.app-toast-info {
  border-color: rgba(108, 140, 255, 0.5);
  color: var(--primary);
}

@media (max-width: 720px) {
  .checkin-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .checkin-stat {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .checkin-stat-value {
    font-size: 20px;
  }

  .app-toast {
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}

@media (max-width: 900px) {
  .checkin-basic-grid,
  .checkin-detail-grid,
  .checkin-setting-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .checkin-basic-grid,
  .checkin-detail-grid,
  .checkin-setting-grid {
    grid-template-columns: 1fr;
  }

  .checkin-hero {
    padding: 20px;
    gap: 12px;
  }

  .checkin-hero h2 {
    font-size: 19px;
  }

  .checkin-step-card {
    padding: 18px 16px;
  }

  /* 打卡图片上传：窄屏按钮铺满整行 */
  .checkin-upload-row .btn-fetch {
    width: 100%;
    align-self: stretch;
  }

  .checkin-upload-row .checkin-upload-zone {
    min-height: 112px;
  }

  /* 上传状态面板：窄屏允许状态标签换行 */
  .checkin-upload-file {
    flex-wrap: wrap;
  }

  .checkin-upload-meta {
    flex-basis: calc(100% - 58px);
  }

  /* 下单弹窗：摘要改为单列，避免窄屏挤压 */
  .checkin-order-summary {
    grid-template-columns: 1fr;
  }
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.pager button {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #151922;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.pager button:hover:not(:disabled) {
  border-color: #3a4252;
  color: var(--text);
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 公共池（图片 / 日志）分页 */
.pool-pager {
  justify-content: center;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12151c;
  gap: 2px;
}

.segmented button {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--primary-soft);
  color: #c3cfff;
}

.log-table th {
  top: 0;
}

/* 弹窗 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

/* 叠加在其它弹窗之上的确认层（如下单弹窗内的分类确认） */
.modal-backdrop.modal-backdrop-top {
  z-index: 120;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: fade-in 0.18s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* 弹窗底部需要左对齐的按钮（如编辑弹窗内的续费入口） */
.modal-foot-start {
  margin-right: auto;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.modal-close:hover {
  color: var(--text);
}

/* 等宽字体（卡密 / 订单参数） */
.mono {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

/* 订单详情弹窗 */
.detail-field {
  margin: 0;
}

.detail-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-value-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.detail-value-row .input {
  flex: 1;
  min-width: 0;
}

.detail-value-row .btn {
  flex-shrink: 0;
}

.detail-textarea {
  height: auto;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  word-break: break-all;
}

.detail-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.modal-body-scroll {
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}

.modal-wide {
  max-width: 920px;
  width: 90vw;
}

/* 订单 CSV 导入预览 */
.import-summary {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #12151c;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.import-section {
  margin-bottom: 18px;
}
.import-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.import-preview-wrap {
  max-height: 320px;
  overflow-y: auto;
}
.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.import-preview-table th,
.import-preview-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
  max-width: 240px;
  word-break: break-all;
}

/* 提示浮层 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(10px);
  z-index: 200;
  max-width: min(520px, calc(100vw - 40px));
  padding: 11px 18px;
  border-radius: 10px;
  background: #232834;
  border: 1px solid #343b4c;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  word-break: break-all;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.4);
  color: #8af0c8;
}

.toast.error {
  border-color: rgba(240, 100, 100, 0.45);
  color: #f5a3a3;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-mask {
    display: block;
  }

  .side-toggle {
    display: inline-flex;
  }

  .admin-content {
    padding: 18px 16px;
  }

  .admin-header {
    padding: 0 16px;
  }

  .admin-header .site-tag {
    display: none;
  }

  /* 平板端：下单记录适度收紧横向内边距，纵向留白保持不变 */
  .user-order-table th {
    padding: 14px 12px;
  }

  .user-order-table td {
    padding: 16px 12px;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .topbar-left {
    flex: 1;
  }

  .topbar-right .btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .appnav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 14px;
  }

  body.nav-open .appnav {
    display: flex;
  }

  .appnav-item {
    text-align: left;
    border-radius: var(--radius-sm);
    height: 40px;
  }

  .app-main {
    padding: 28px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar .input {
    min-width: 0;
    flex: 1;
  }

  .toolbar .search-input {
    max-width: none;
    flex-basis: 100%;
  }

  .section-card {
    padding: 18px;
  }

  /* 下单记录：小屏收紧内边距，保留充足行高与间距 */
  .user-order-table th {
    padding: 12px 10px;
  }

  .user-order-table td {
    padding: 14px 10px;
    font-size: 12.5px;
  }

  /* 打卡日志：小屏同样收紧内边距 */
  .checkin-order-table th {
    padding: 12px 10px;
  }

  .checkin-order-table td {
    padding: 14px 10px;
    font-size: 12px;
  }

  .admin-header h2 {
    font-size: 15px;
  }
}

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

  .home-card {
    padding: 18px;
  }

  /* 下单记录：移动端保持可横向滚动，单元格留白不压缩 */
  .user-order-table {
    min-width: 900px;
  }

  .user-order-table th {
    padding: 12px 10px;
  }

  .user-order-table td {
    padding: 14px 12px;
  }
}

@media (max-width: 420px) {
  .login-card {
    padding: 24px 18px;
  }

  .card-input {
    font-size: 17px;
    letter-spacing: 1px;
  }
}

/* ---- 用户绑定视图 ---- */
.user-cards-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.user-card-chip {
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
}

/* ---- 首页卡密明细 ---- */
.cards-detail {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-soft);
}

.cards-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cards-detail-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cards-detail-head h3::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
}

/* 绑定新卡密按钮：胶囊型强调按钮 */
.bind-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px 0 11px;
  border: 1px solid rgba(108, 140, 255, 0.42);
  border-radius: 999px;
  background: rgba(108, 140, 255, 0.12);
  color: #a6b8ff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, transform 0.12s ease;
}

.bind-card-btn svg {
  width: 13px;
  height: 13px;
  flex: none;
  transition: transform 0.2s ease;
}

.bind-card-btn:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 6px 16px rgba(90, 120, 240, 0.35);
  transform: translateY(-1px);
}

.bind-card-btn:hover svg {
  transform: rotate(90deg);
}

.bind-card-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(90, 120, 240, 0.28);
}

.bind-card-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------------- 意见反馈 ---------------- */
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.feedback-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.feedback-meta {
  color: var(--text-dim);
  font-size: 12px;
}

.feedback-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.feedback-contact {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.feedback-reply {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
}

.feedback-reply-head {
  display: block;
  color: var(--primary);
  font-size: 12px;
  margin-bottom: 4px;
}

.feedback-reply-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.feedback-cell {
  max-width: 340px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- 选课下单定时关闭提示 ---------------- */
.course-order-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(240, 179, 92, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(240, 179, 92, 0.12);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.6;
}

/* 使用说明：导航中的外链样式与按钮保持一致 */
a.appnav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* 登录页底部：使用说明入口 */
.login-guide-link {
  color: var(--primary);
  font-size: 12.5px;
  text-decoration: none;
}
.login-guide-link:hover { text-decoration: underline; }
