/* ==========================================================================
   柯南好房 · 公共样式文件 common.css
   全站共享的CSS变量、基础样式、导航栏、浮动按钮、水印等
   ========================================================================== */

/* === CSS 变量 === */
:root {
  --bg: #FAF7F2;
  --bg2: #FFFFFF;
  --ink: #2C2C2C;
  --muted: #8A8A8A;
  --rule: #EDE5D8;
  --accent: #FF6B35;
  --accent-dark: #E55A28;
  --accent-light: #FF8A5C;
  --green: #2E7D32;
  --red: #C62828;
  --yellow: #F9A825;
  --accent-soft: rgba(255, 107, 53, 0.10);
  --yellow-soft: rgba(249, 168, 37, 0.14);
  --yellow-border: rgba(249, 168, 37, 0.40);
  --grey-soft: #F5F2EE;
}

/* === 基础重置 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

/* === 页面容器（深业上宸标准宽度 1180px）=== */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* === 标准深墨头部组件 .ke-hero（全站统一刊头）=== */
.ke-hero {
  background: linear-gradient(160deg, #2B241D 0%, #1F1A15 100%);
  color: #fff;
  border-radius: 0 0 20px 20px;
  padding: 32px 36px 28px;
  margin: 0 0 28px;
  position: relative;
  overflow: hidden;
}
.ke-hero::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 107, 53, 0.18), rgba(255, 107, 53, 0.04) 60%, transparent 72%);
  pointer-events: none;
}
.ke-hero .ke-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: relative; }
.ke-hero .ke-brand-row .ke-block { width: 12px; height: 12px; background: var(--accent); border-radius: 3px; flex-shrink: 0; }
.ke-hero .ke-brand-row span { font-size: 12px; letter-spacing: 4px; color: #B7AC9D; font-weight: 700; }
.ke-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: 1px; position: relative; line-height: 1.35; }
.ke-hero .ke-sub { font-size: 13px; color: #B7AC9D; margin-top: 10px; letter-spacing: 1px; position: relative; }
.ke-hero .ke-meta { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; font-size: 13px; color: #B7AC9D; position: relative; }
.ke-hero .ke-meta .sep { opacity: 0.4; }
.ke-hero .ke-meta b { color: #fff; font-weight: 700; }
.ke-hero .ke-accent-line { width: 46px; height: 3px; background: var(--accent); border-radius: 2px; margin-top: 16px; position: relative; }
@media (max-width: 640px) {
  .ke-hero { padding: 24px 20px; border-radius: 0 0 16px 16px; }
  .ke-hero h1 { font-size: 21px; }
}

/* === 顶部导航栏 === */
.kenan-topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  height: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.kenan-topbar .ktb-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kenan-topbar .ktb-brand svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.kenan-topbar .ktb-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.kenan-topbar .ktb-nav::-webkit-scrollbar {
  display: none;
}

.kenan-topbar .ktb-nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.kenan-topbar .ktb-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.kenan-topbar .ktb-nav a.active {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 600px) {
  .kenan-topbar {
    height: 44px;
    padding: 0 12px;
  }
  .kenan-topbar .ktb-brand {
    font-size: 13px;
  }
  .kenan-topbar .ktb-brand svg {
    width: 18px;
    height: 18px;
  }
  .kenan-topbar .ktb-nav a {
    font-size: 12px;
    padding: 5px 8px;
  }
}

/* === 浮动返回按钮 === */
.kenan-float-back {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 10002;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.92);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.kenan-float-back:hover {
  background: rgba(255, 107, 53, 1);
  transform: scale(1.08);
}

.kenan-float-back:active {
  transform: scale(0.95);
}

.kenan-float-back svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 600px) {
  .kenan-float-back {
    bottom: 20px;
    left: 16px;
    width: 44px;
    height: 44px;
  }
  .kenan-float-back svg {
    width: 20px;
    height: 20px;
  }
}

/* === 柯南好房水印 === */
.kenan-watermark {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9990;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 180px,
    rgba(255, 107, 53, 0.025) 180px,
    rgba(255, 107, 53, 0.025) 320px
  );
}

.kenan-watermark::before {
  content: '柯南好房';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 60px;
  font-weight: 800;
  color: rgba(255, 107, 53, 0.03);
  white-space: nowrap;
  letter-spacing: 8px;
}

/* 导出时用的水印 */
.export-watermark {
  position: absolute;
  bottom: 10px;
  right: 15px;
  font-size: 12px;
  color: rgba(255, 107, 53, 0.5);
  font-weight: 600;
  pointer-events: none;
}

/* === 全局滚动条美化 === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 53, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 53, 0.5);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 53, 0.3) transparent;
}

/* === 通用页头 === */
.kenan-header {
  text-align: center;
  padding: 44px 20px 36px;
  background: linear-gradient(135deg, #FFF3EC 0%, var(--bg2) 100%);
  border-radius: 20px;
  border: 1px solid var(--rule);
  margin: 20px 0 24px;
}

.kenan-header .brand-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 107, 53, 0.1);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.kenan-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 10px;
}

.kenan-header h1 .accent {
  color: var(--accent);
}

.kenan-header .subtitle {
  font-size: 14px;
  color: var(--muted);
}

.kenan-header .subtitle .sep {
  margin: 0 8px;
  color: var(--rule);
}

@media (max-width: 600px) {
  .kenan-header {
    padding: 32px 16px 28px;
  }
  .kenan-header h1 {
    font-size: 22px;
  }
}

/* === 通用页脚 === */
.kenan-footer {
  max-width: 960px;
  margin: 40px auto 0;
  padding: 32px 16px 48px;
  text-align: center;
}

.kenan-footer .footer-cta {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 20px;
}

.kenan-footer .footer-cta p {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 8px;
}

.kenan-footer .footer-cta .highlight {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.kenan-footer .footer-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* === 通用卡片 === */
.kenan-card {
  background: var(--bg2);
  border-radius: 12px;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 10px rgba(44, 44, 44, 0.04);
  padding: 22px 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.kenan-card:hover {
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.08);
}

/* === 通用标签 === */
.kenan-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.kenan-tag.green { background: var(--green); }
.kenan-tag.yellow { background: var(--yellow); }
.kenan-tag.red { background: var(--red); }

/* === 通用区域标题 === */
.kenan-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-left: 4px;
}

/* === 留资弹窗通用样式 === */
.kenan-lead-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10003;
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.kenan-lead-modal .lead-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10002;
}

.kenan-lead-modal h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.kenan-lead-modal p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.kenan-lead-modal input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--rule);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.kenan-lead-modal input:focus {
  border-color: var(--accent);
}

.kenan-lead-modal button {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.kenan-lead-modal button:hover {
  background: var(--accent-dark);
}

/* === 防止图片溢出 === */
img {
  max-width: 100%;
  height: auto;
}

/* === 链接默认样式 === */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* === 桌面端统一限宽（desktop-unify 20260820）：满宽页与 .page 居中派对齐 === */
@media (min-width: 1212px) {
  html { background: var(--bg); }
  body { max-width: 1180px; margin: 0 auto; }
}
