/* ==========================================================================
   学习平台辅导 — 全站样式
   深色主题 + 单一强调色（teal #2dd4bf），系统字体栈，无外部依赖。
   ========================================================================== */

:root {
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-ring: rgba(45, 212, 191, 0.45);

  --bg: #0b1120;
  --bg-soft: #0f172a;
  --surface: #131d33;
  --surface-2: #17233c;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.34);

  --text: #e6edf6;
  --text-dim: #9fb0c7;
  --text-faint: #7b8ba3;

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;

  --shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  --shadow-sm: 0 4px 14px rgba(2, 6, 23, 0.35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;

  --safe-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(45, 212, 191, 0.10), transparent 62%),
    radial-gradient(900px 480px at 92% 0%, rgba(99, 102, 241, 0.10), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--safe-bottom);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------- 顶部导航 -------------------------------- */

.site-header {
  padding: 22px 0 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 6px 18px rgba(45, 212, 191, 0.28);
  display: grid;
  place-items: center;
  color: #04211d;
  font-weight: 800;
  font-size: 19px;
}

.site-brand-text {
  min-width: 0;
}

.site-name {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}

.site-tagline {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.notice {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.08);
  border-radius: var(--radius);
  color: #fde68a;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.notice.show {
  display: block;
}

/* ------------------------------ 搜索 / 分类 ------------------------------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.97) 60%, rgba(11, 17, 32, 0.86));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-box input {
  width: 100%;
  padding: 11px 38px 11px 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  appearance: none;
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-box input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 8px;
}

.search-clear:hover {
  color: var(--text);
}

.cat-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.cat-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  flex: 0 0 auto;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.cat-tab.active {
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.55);
  color: var(--accent);
  font-weight: 600;
}

/* -------------------------------- 结果区 --------------------------------- */

.result-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 10px;
  flex-wrap: wrap;
}

.result-count {
  font-size: 14px;
  color: var(--text-dim);
}

.result-count strong {
  color: var(--accent);
  font-weight: 700;
}

.result-tip {
  font-size: 12.5px;
  color: var(--text-faint);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* -------------------------------- 卡片 ----------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-cover .hot-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #3a1d00;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.card-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-faint);
}

.card-price {
  display: block;
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.card-price .unit {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 2px;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-dim);
  font-size: 12px;
}

/* -------------------------------- 徽章 ----------------------------------- */

.badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-full {
  background: var(--accent);
  color: #04211d;
  border: 1px solid var(--accent);
}

.badge-single {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
}

/* ------------------------------ 空状态 / 错误 ----------------------------- */

.state-box {
  display: none;
  text-align: center;
  padding: 46px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(19, 29, 51, 0.6);
}

.state-box.show {
  display: block;
}

.state-icon {
  font-size: 34px;
  line-height: 1;
}

.state-title {
  margin: 14px 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.state-text {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* -------------------------------- 按钮 ----------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04211d;
  box-shadow: 0 8px 22px rgba(45, 212, 191, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

/* -------------------------------- 页脚 ----------------------------------- */

.site-footer {
  margin-top: 44px;
  padding: 22px 0 6px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ============================== 详情页 ==================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 4px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 18px;
}

.hero {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-cover {
  flex: 0 0 auto;
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

.hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-main {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.hero-price {
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.hero-price .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 3px;
}

.hero-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent);
}

.outline {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.outline li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.service-note {
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: #d5fbf4;
  overflow-wrap: anywhere;
}

/* --------------------------------- 表单 ---------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 700px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.field label .req {
  color: var(--accent);
  margin-left: 3px;
}

.field input[type="text"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  appearance: none;
  min-width: 0;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[readonly] {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-dim);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field .hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.field .err {
  margin: 0;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 600;
}

.field .err[hidden],
[hidden] {
  display: none !important;
}

/* 蜜罐字段：移出屏幕，真实用户不会填 */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input {
  padding-right: 44px;
}

.eye-btn {
  position: absolute;
  right: 4px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.eye-btn:hover {
  color: var(--accent);
}

.eye-btn .slash {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.eye-btn.on .slash {
  opacity: 1;
}

.check-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.check-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.check-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-dim) !important;
  line-height: 1.6;
}

.recommend {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px dashed rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.07);
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.recommend .rec-label {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-right: 6px;
}

.recommend .rec-value {
  color: var(--accent);
  font-weight: 700;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

.form-error {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* ------------------------------ 成功卡片 --------------------------------- */

.success-card {
  text-align: center;
  padding: 34px 20px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(45, 212, 191, 0.07);
}

.success-card .success-icon {
  font-size: 40px;
  line-height: 1;
}

.success-card .success-title {
  margin: 14px 0 8px;
  font-size: 20px;
  font-weight: 750;
}

.success-card .success-order {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.success-card .success-line {
  margin: 0 auto 10px;
  max-width: 520px;
  color: var(--text-dim);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.success-card .success-actions {
  margin-top: 18px;
}

/* ------------------------------ 底部报名条 -------------------------------- */

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.sticky-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sticky-price {
  color: var(--accent);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sticky-price .unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 2px;
}

.sticky-bar .btn {
  flex: 0 0 auto;
  padding: 12px 26px;
}

/* 详情页给底部固定条留出空间 */
body.detail-page {
  padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
}

/* --------------------------------- 404 ----------------------------------- */

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 16px calc(30px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.error-box {
  max-width: 520px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 22px;
  box-shadow: var(--shadow);
}

.error-code {
  font-size: 46px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.error-title {
  margin: 14px 0 8px;
  font-size: 19px;
  font-weight: 700;
}

.error-text {
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
