/* 汇嘉图书 — 暖橙主色、企业站常规字号 */
:root {
  --primary: #ff6b35;
  --primary-dark: #e85a28;
  --primary-light: #ff8a5c;
  --primary-bg: #fff8f5;
  --primary-border: #ffe4d6;
  --accent: #ff9800;
  --bg-page: #f8f8f8;
  --bg-warm: #fff5ee;
  --bg-card: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #eeeeee;
  --border-dark: #e0e0e0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 20px rgba(255, 107, 53, 0.12);
  --header-main-h: 90px;
  --header-nav-h: 0;
  --header-total: 90px;
  --max-width: 1200px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 24px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  /* 企业站常规字号 */
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-xs: 13px;
  --font-size-xxs: 12px;
  --font-size-sidebar: 17px;
  --line-height-base: 1.6;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  color: var(--text);
  background: var(--bg-page);
  line-height: var(--line-height-base);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

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

ul {
  list-style: none;
}

/* 浮层在首屏先隐藏，避免异步样式加载前中间闪一下 */
.login-modal[hidden],
.forgot-password-modal[hidden],
.change-phone-modal[hidden],
.customer-chat[hidden],
.huijia-toast[hidden] {
  display: none !important;
}

.login-modal:not([hidden]) {
  display: flex !important;
}

.forgot-password-modal:not([hidden]),
.change-phone-modal:not([hidden]) {
  display: flex !important;
}

.customer-chat:not([hidden]) {
  display: block !important;
}

.huijia-toast:not([hidden]).is-show {
  display: block !important;
}

/* —— 顶栏 —— */
.site-header {
  position: relative;
  z-index: 100;
  background: linear-gradient(105deg, #fff0e6 0%, #ffe8dc 45%, #fff5ee 100%);
  box-shadow: 0 1px 0 var(--primary-border);
}

.header-main-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
}

.header-main {
  height: var(--header-total);
  background: transparent;
}

.header-main-inner {
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--primary);
}

.logo:hover {
  color: var(--primary-dark);
}

/* 后台配置图片后设置 .logo-img[src] 即可替换文字 */
.logo-img {
  display: none;
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.logo-img[src]:not([src=""]) {
  display: block;
}

.logo:has(.logo-img[src]:not([src=""])) .logo-label {
  display: none;
}

.logo-label {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  min-width: 0;
}

.header-slogan {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 107, 53, 0.28);
  min-width: 0;
}

.header-slogan-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.3;
  white-space: nowrap;
}

.header-slogan-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
}

/* 搜索条 — 输入区 + 右侧搜索按钮一体（常见电商 H5 结构） */
.header-search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: stretch;
  height: 40px;
  background: #f5f5f5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
  background: #fff;
  border-color: var(--primary-border);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.12);
}

.header-search select {
  flex-shrink: 0;
  width: 76px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  font-size: 14px;
  padding: 0 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.header-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0 12px;
  font-size: 16px;
  line-height: 40px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.header-search input::placeholder {
  color: #999999;
  opacity: 1;
}

.header-search button {
  flex-shrink: 0;
  width: 72px;
  min-width: 72px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.header-search button:hover,
.header-search button:active {
  background: var(--primary-dark);
}

.header-end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-quick-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--primary);
  background: transparent;
  text-decoration: none;
  transition: color 0.2s;
}

@media (hover: hover) {
  .header-quick-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 登录态顶栏/抽屉头像：写在 common 中，避免 auth-ui.css 异步加载前 img 被撑大 */
.header-user-avatar,
.drawer-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

.header-user-avatar {
  width: 28px;
  height: 28px;
}

.drawer-user-avatar {
  width: 40px;
  height: 40px;
}

.header-user-avatar-img,
.drawer-user-avatar-img {
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.header-user-avatar-img {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
}

.drawer-user-avatar-img {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
}

.header-actions .header-link {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-actions .header-link:hover {
  color: var(--primary);
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-login:hover {
  background: var(--primary);
  color: #fff;
}

.page-wrap {
  padding-top: 0;
  min-height: calc(100vh - 280px);
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

.float-sidebar {
  position: fixed;
  right: 20px;
  bottom: 140px;
  z-index: 900;
  width: 88px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: visible;
}

.float-sidebar ul {
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.float-sidebar li {
  border-bottom: none;
}

.float-sidebar li:not(:last-child)::after {
  content: "";
  display: block;
  height: 1px;
  margin: 0 12px;
  background: var(--border);
}

.float-sidebar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

/* 侧栏内「顶部」始终可见（勿用全局 #back-top 的隐藏规则） */
.float-sidebar #back-top {
  opacity: 1;
  pointer-events: auto;
}

.float-sidebar a:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.float-sidebar-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.float-sidebar-label {
  line-height: 1.2;
  white-space: nowrap;
}

/* APP / 公众号：点击不跳转，仅悬停二维码 */
.float-sidebar [data-float-qr] {
  cursor: default;
}

.float-sidebar [data-float-action="service"] {
  cursor: pointer;
}

/* APP / 公众号悬停显示二维码占位 */
.float-sidebar-item--qr {
  position: relative;
}

.float-sidebar-qr-pop {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  z-index: 910;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.float-sidebar-item--qr:hover .float-sidebar-qr-pop,
.float-sidebar-item--qr:focus-within .float-sidebar-qr-pop {
  opacity: 1;
  visibility: visible;
}

.float-sidebar-qr-box {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  background-image:
    linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
    linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  position: relative;
}

.float-sidebar-qr-box::after {
  content: "二维码";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.75);
}

.float-sidebar-qr-caption {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.site-footer {
  background: #3f4346;
  color: #fff;
  margin-top: 40px;
  padding: 28px 0 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.footer-layout {
  display: flex;
  align-items: stretch;
  gap: 32px 48px;
}

.footer-main {
  flex: 1;
  min-width: 0;
}

.footer-partners-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.footer-partners-label {
  flex-shrink: 0;
  font-size: var(--font-size-base);
  color: #fff;
  line-height: 1.75;
}

.footer-partners-names {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.footer-partners-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.footer-partners-row span {
  font-size: var(--font-size-base);
  color: #fff;
  line-height: 1.75;
  white-space: nowrap;
}

.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  margin-bottom: 20px;
}

.footer-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px 28px;
}

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

.footer-brand-icon {
  display: none;
}

.footer-brand-text {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
}

.footer-center {
  min-width: 0;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 4px;
  margin-bottom: 10px;
}

.footer-nav a {
  color: #fff;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.footer-nav a:hover {
  color: var(--primary-light);
}

.footer-nav-sep {
  color: rgba(255, 255, 255, 0.45);
  font-size: var(--font-size-sm);
  user-select: none;
}

.footer-copy {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  line-height: 1.7;
  margin: 0;
}

.footer-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.footer-app--side {
  align-self: center;
  justify-content: center;
  padding-left: 32px;
  min-width: 132px;
}

.footer-qr-placeholder {
  width: 112px;
  height: 112px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-image:
    linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
    linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  position: relative;
}

.footer-qr-placeholder::after {
  content: "二维码";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  color: #999;
  background: rgba(255, 255, 255, 0.72);
}

.footer-app-label {
  font-size: var(--font-size-base);
  color: #fff;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.section-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: none;
  padding-bottom: 0;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head h2::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-head a {
  font-size: 14px;
  color: var(--text-muted);
}

.section-head a:hover {
  color: var(--primary);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  margin: 0 6px;
  color: var(--border-dark);
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.book-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #f0ebe6 0%, #e5dfd8 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#back-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* 移动端样式见 responsive.css */
