/* ============================================================
   INSIS 员工自助服务平台 · 通用样式
   气质：克制、留白、细体、温暖、无粗体
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-weight: var(--weight-light);
  color: var(--insis-ash);
  background: var(--insis-ecru);
  line-height: var(--lh-cn);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 内容区宽度：
   - 桌面端：占页面中间 80%（左右各留约 10% 空白）
   - 手机/窄屏：占满，仅保留内边距 */
.page {
  width: 80%;
  margin: 0 auto;
  padding: var(--space-page);
  min-height: 100vh;
}
@media (max-width: 800px) {
  .page { width: auto; }
  .module-col { width: 100%; }   /* 手机：模块上下堆叠 */
}

/* —— 顶部品牌区（方案B：图腾 + 字标 + 称呼，居中留白）—— */
.brand-header {
  text-align: center;
  padding: 52px 0 40px;
}
.brand-header .brand-totem {
  display: block;
  margin: 0 auto 18px;
  color: var(--insis-driftwood);
  opacity: 0.85;
}
.brand-header .wordmark {
  height: 64px;
  opacity: 0.9;
  mix-blend-mode: multiply;   /* 让白底 Logo 融入米白背景 */
}
.brand-header .welcome {
  margin-top: 20px;
  font-size: 14px;
  font-weight: var(--weight-regular);
  color: var(--insis-driftwood);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand-header .welcome .name {
  color: var(--insis-ash);
}

/* —— 小标题（品牌规范：居中、字距）—— */
.section-title {
  text-align: center;
  font-weight: var(--weight-light);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--insis-driftwood);
  margin: 18px 0 16px;
}

/* —— 模块化竖列（方案B）：卡片固定为"一排三个"的宽度，
   每排放几个由 JS 按模块数量决定，整体居中（宽度/列数由 render-home.js 计算）—— */
.modules-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 32px;
  justify-content: center;
  margin: 77px auto 10px;
}
.module-col {
  display: flex;
  flex-direction: column;
  background: transparent;   /* 方案B：无卡片，直接在米白背景上 */
}

/* 模块头：极简标签 + 发丝分割线（无图标）*/
.module-col-head {
  text-align: left;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(84, 84, 80, 0.16);
}
.module-col-head .name {
  font-size: 15px;
  font-weight: var(--weight-light);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--insis-ash);   /* JS 会用模块配色覆盖 */
}
.module-col-head .module-title-cjk {
  font-weight: var(--weight-light);
  opacity: 0.82;
}

/* 模块链接列表：发丝分割线，安静 */
.module-col-links {
  padding: 2px 2px 0;
}
.module-col-links .link-item {
  font-size: 12px;
  font-weight: 500;
}

/* —— 页脚 —— */
.page-footer {
  text-align: center;
  margin-top: 40px;
  padding: 24px 0;
}
.page-footer .totem {
  height: 40px; opacity: 0.5;
  mix-blend-mode: multiply;   /* 让白底图腾融入米白背景 */
}
.page-footer .slogan {
  margin-top: 14px;
  font-size: 11px;
  color: var(--insis-driftwood);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

/* —— 二级页面：返回栏、内容块 —— */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 18px;
}
.topbar .back {
  text-decoration: none;
  color: var(--insis-driftwood);
  font-size: 15px;
}
.topbar .page-name {
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--insis-ash);
}

.content-card {
  background: var(--insis-white);
  border-radius: var(--radius-card);
  padding: 22px;
  margin-bottom: 14px;
  border: 1px solid rgba(84, 84, 80, 0.06);
}
.content-card h3 {
  font-weight: var(--weight-light);
  font-size: 16px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.content-card p, .content-card li {
  font-size: 14px;
  color: var(--insis-ash);
  line-height: var(--lh-cn);
}
.content-card ul { padding-left: 18px; }
.content-card .hint {
  color: var(--insis-driftwood);
  font-size: 13px;
}

/* 内容页 · 方案C 简约文档式（无卡片外框，直接排在米白背景上）*/
/* PC 上收窄成居中阅读栏（不跟随首页 80% 宽度）*/
.page-doc { width: 100%; max-width: 680px; }

.doc { padding: 6px 4px 40px; }
.doc-title {
  font-size: 22px;
  font-weight: var(--weight-light);
  color: var(--insis-ash);
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 8px;
}
.doc-sub {
  font-size: 13px;
  color: var(--insis-driftwood);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.doc-body p {
  font-size: 15px;
  color: var(--insis-ash);
  font-weight: var(--weight-regular);
  line-height: 1.9;
  margin-bottom: 16px;
}
.doc-body p:last-child { margin-bottom: 0; }
.doc-body .hint { color: var(--insis-driftwood); }
.doc-images { margin-top: 6px; }
.doc-img {
  width: 100%;
  border-radius: var(--radius-card);
  margin: 18px 0;
  display: block;
  cursor: zoom-in;
}
.doc-img:focus {
  outline: 1px solid rgba(84, 84, 80, 0.32);
  outline-offset: 3px;
}
body.image-viewer-open {
  overflow: hidden;
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
}
.image-viewer.is-open {
  display: flex;
}
.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 38, 35, 0.78);
  backdrop-filter: blur(2px);
}
.image-viewer-stage {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.image-viewer-img {
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-card);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}
.image-viewer.is-dragging .image-viewer-img {
  cursor: grabbing;
}
.image-viewer-tools {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(84, 84, 80, 0.14);
  border-radius: 999px;
  background: rgba(244, 242, 230, 0.92);
  transform: translateX(-50%);
}
.image-viewer-tools button {
  min-width: 38px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--insis-ash);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}
.image-viewer-tools button:hover {
  background: rgba(84, 84, 80, 0.08);
}
@media (max-width: 800px) {
  .image-viewer-img {
    max-width: 96vw;
    max-height: 82vh;
  }
  .image-viewer-tools {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
.oa-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}
.oa-open-btn {
  border: 1px solid rgba(84, 84, 80, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--insis-ash);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 9px 18px;
}
.oa-open-btn:disabled {
  cursor: default;
  opacity: 0.45;
}
.oa-home-link {
  color: var(--insis-driftwood);
  font-size: 14px;
  text-decoration: none;
}
.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(84, 84, 80, 0.14);
  border-radius: 999px;
  background: rgba(244, 242, 230, 0.88);
  color: var(--insis-driftwood);
  font-size: 20px;
  font-weight: var(--weight-light);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, color 180ms ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--insis-ash);
}

/* 列表型条目（How-To 用） */
.link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 4px;
  border-bottom: 1px solid rgba(84, 84, 80, 0.07);
  color: var(--insis-ash);
  font-size: 15px;
  font-weight: var(--weight-regular);   /* 提到常规字重，更清晰（品牌只禁 Bold）*/
  text-decoration: none;
}
.link-item:last-child { border-bottom: none; }
.link-item .arrow { color: var(--insis-driftwood); }
.link-more {
  justify-content: center;
  gap: 8px;
  color: var(--insis-driftwood);
  font-size: 14px;
}
.doc-link-list {
  margin-top: 4px;
}
.doc-link-list .link-item {
  padding-left: 0;
  padding-right: 0;
}

/* —— INSIS Time：首页图片 —— */
.insis-time {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  color: var(--insis-ash);
}
.insis-time-head {
  position: relative;
  text-align: left;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(84, 84, 80, 0.16);
}
.insis-time-head h2 {
  font-size: 15px;
  font-weight: var(--weight-light);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.insis-time-main,
.insis-time-row {
  align-items: center;
  color: var(--insis-ash);
  text-decoration: none;
  border-bottom: 1px solid rgba(84, 84, 80, 0.10);
}
.insis-time-main {
  position: relative;
  display: block;
  padding: 24px 0 26px;
  border-bottom: none;
}
.insis-time-row {
  display: flex;
}
.insis-time-gallery-wrap {
  margin-top: 18px;
}
.insis-time-gallery {
  display: flex;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}
.insis-time-gallery-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.insis-time-gallery-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
}
.insis-time-gallery.is-dragging {
  cursor: grabbing;
}
.insis-time-gallery::-webkit-scrollbar {
  display: none;
}
.insis-time-thumb {
  position: relative;
  display: inline-flex;
  width: var(--thumb-w, 150px);
  height: 150px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--insis-ecru);
}
.insis-time-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.insis-time-thumb.is-wide-low img {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}
.insis-time-progress {
  display: block;
  position: relative;
  width: min(58%, 560px);
  height: 18px;
  margin: 28px auto 0;
  cursor: pointer;
}
.insis-time-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(84, 84, 80, 0.14);
}
.insis-time-progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  width: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(84, 84, 80, 0.58);
  transition: width 80ms linear;
}
.insis-time-progress.is-dragging .insis-time-progress-fill {
  transition: none;
}
.insis-time-gallery-wrap.is-single .insis-time-progress {
  opacity: 0;
  pointer-events: none;
}
.insis-time-row {
  justify-content: space-between;
  min-height: 54px;
  font-size: 15px;
  font-weight: var(--weight-regular);
}

@media (max-width: 800px) {
  .insis-time {
    width: 100%;
  }
  .insis-time-main {
    padding: 16px 0;
  }
  .insis-time-gallery {
    gap: 10px;
  }
  .insis-time-gallery-wrap {
    margin-top: 14px;
  }
  .insis-time-thumb {
    width: var(--thumb-w, 130px);
    height: 130px;
  }
  .insis-time-row {
    min-height: 50px;
    font-size: 15px;
  }
}
