/* ==========================================================================
   卫民CMS 组件库（Component Library）
   - 设计令牌复用 style.css :root（不引入新硬编码色）
   - 浅色主题 / SIL OFL 字体 / 过渡统一 .2s
   - 本文件 = 套餐A（模板款）直接复用；套餐B（高端定制）在令牌之上再设计
   - 媒体子模块：大图 / 画廊 / 懒加载 / 裁剪 / 水印 / WebP 约定见 docs/design/components.md
   ========================================================================== */

/* ---------- 1. 按钮系统（基础 .btn / .btn-ghost 已在 style.css） ---------- */
.btn-lg{padding:14px 30px;font-size:17px}
.btn-sm{padding:7px 14px;font-size:13px}
.btn-block{display:block;width:100%;text-align:center}
.btn-outline{background:transparent;border:1px solid var(--brand);color:var(--brand)}
.btn-outline:hover{background:var(--brand);color:#fff}
.btn-light{background:#fff;color:var(--brand-dark)}
.btn-light:hover{background:rgba(255,255,255,.9)}
.btn-link{background:none;color:var(--brand);padding:0;font-weight:600}
.btn-link:hover{text-decoration:underline}
.btn:disabled,.btn.is-disabled{opacity:.55;cursor:not-allowed;pointer-events:none}

/* ---------- 2. 表单系统 ---------- */
.field{margin-bottom:var(--sp-4)}
.field__label{display:block;margin-bottom:var(--sp-2);font-weight:600;font-size:14px}
.field__hint{margin-top:6px;font-size:12px;color:var(--muted)}
.field__error{margin-top:6px;font-size:12px;color:#e23b3b}
.field.is-error input,.field.is-error textarea,.field.is-error select{border-color:#e23b3b}
.field--inline{display:flex;align-items:center;gap:var(--sp-2);margin-bottom:var(--sp-3)}
/* 算术题验证码：题面 + 输入框同排，题面加粗为主色，避免与普通字段混淆 */
.captcha-row{display:flex;align-items:center;gap:var(--sp-2)}
.captcha-row .captcha-q{flex:none;font-size:16px;font-weight:600;color:var(--brand-dark);background:var(--bg-alt);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 14px;white-space:nowrap;letter-spacing:.5px}
.captcha-row input{flex:1;width:100%;min-width:0}
/* flex 容器内的 .input 不能用 width:100% 撑开，否则窄视口(375)会撑破视口产生横向滚动 */
.field--inline .input,.input-group .input{min-width:0}
.field--inline .field__label{margin-bottom:0}
.field input,.field textarea,.field select,
.input{flex:1;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;font-size:15px;background:#fff;color:var(--ink);transition:.2s}
.field input:focus,.field textarea:focus,.field select:focus,
.input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(8,98,195,.12)}
.field textarea{resize:vertical;min-height:110px;line-height:1.7}
.input-group{display:flex;gap:var(--sp-2)}
.input-group .input{flex:1}
.checkbox,.radio{display:flex;align-items:flex-start;gap:8px;font-size:14px;cursor:pointer;margin-bottom:var(--sp-2)}
.checkbox input,.radio input{margin-top:3px;width:16px;height:16px;accent-color:var(--brand)}
.form-actions{display:flex;gap:var(--sp-3);flex-wrap:wrap;margin-top:var(--sp-4)}
.form-note{color:var(--muted);font-size:13px;margin-top:var(--sp-2)}
/* 组件库演示辅助：深色衬底块，用于展示 .btn-ghost/.btn-light 等"仅深底可用"的组件 */
.demo-dark{display:inline-block;vertical-align:middle;background:var(--brand-dark);padding:10px 12px;border-radius:var(--radius-sm)}

/* ---------- 3. Banner（内页通用横幅，区别于首页 hero） ---------- */
.banner{background:linear-gradient(135deg,var(--brand) 0%,var(--brand-dark) 100%);color:#fff;padding:54px 0}
.banner--alt{background:var(--bg-alt);color:var(--ink)}
.banner--image{position:relative;background-size:cover;background-position:center;color:#fff}
.banner--image::before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(6,74,150,.82),rgba(6,74,150,.55))}
.banner--image .container{position:relative;z-index:1}
.banner__title{font-size:30px;font-weight:700;line-height:1.3}
.banner__sub{margin-top:12px;font-size:16px;opacity:.92;max-width:720px}
.banner__actions{margin-top:22px;display:flex;gap:14px;flex-wrap:wrap}

/* ---------- 4. 案例 / 作品集卡片（案例库改造规范 11 配套） ---------- */
.showcase{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--sp-4)}
.showcase-card{border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff;transition:.2s;display:flex;flex-direction:column}
.showcase-card:hover{box-shadow:var(--shadow);transform:translateY(-3px)}
.showcase-card__media{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--bg-alt)}
.showcase-card__media img{width:100%;height:100%;object-fit:cover;transition:.2s}
.showcase-card:hover .showcase-card__media img{transform:scale(1.05)}
.showcase-card__tag{position:absolute;top:10px;left:10px}
.showcase-card__body{padding:var(--sp-3);display:flex;flex-direction:column;gap:6px;flex:1}
.showcase-card__title{font-size:17px;font-weight:600}
.showcase-card__desc{color:var(--muted);font-size:14px;flex:1}
.showcase-card__link{color:var(--brand);font-weight:600;font-size:14px;margin-top:auto}

/* ---------- 5. 徽章 / 标签 ---------- */
.tag{display:inline-block;padding:3px 10px;border:1px solid var(--brand);border-radius:999px;color:var(--brand);font-size:12px;font-weight:600;background:rgba(8,98,195,.06)}
.badge{display:inline-block;padding:3px 10px;border-radius:6px;font-size:12px;font-weight:600;color:#fff;background:var(--brand)}
.badge--new{background:#16a34a}
.badge--update{background:#0862c3}
.badge--fix{background:#d97706}
.badge--security{background:#dc2626}
.badge--opt{background:#0d9488}
.badge--doc{background:#7c3aed}
.badge--dep{background:#64748b}
.badge--deploy{background:#0891b2}
.badge--other{background:#475569}
.badge--unknown{background:#94a3b8}

/* ---------- 6. 媒体子模块（大图 / 画廊 / 懒加载 / 裁剪 / 水印 / WebP） ---------- */
.media{margin:var(--sp-4) 0}
.media__caption{margin-top:8px;font-size:13px;color:var(--muted);text-align:center}
.media--cover{position:relative;overflow:hidden;border-radius:var(--radius);background:var(--bg-alt)}
.media--cover img{width:100%;height:100%;object-fit:cover;display:block}

/* 裁剪比例工具：包裹层定比例，内部 img object-fit:cover 实现统一裁剪 */
.ar-16x9{aspect-ratio:16/9}
.ar-21x9{aspect-ratio:21/9}
.ar-4x3{aspect-ratio:4/3}
.ar-3x2{aspect-ratio:3/2}
.ar-1x1{aspect-ratio:1/1}

/* 画廊：自适应网格 + 悬停放大 + 点击放大（lightbox 见 media.js） */
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:var(--sp-3)}
.gallery__item{position:relative;display:block;overflow:hidden;border-radius:var(--radius-sm);background:var(--bg-alt);aspect-ratio:4/3}
.gallery__item img{width:100%;height:100%;object-fit:cover;transition:.2s}
.gallery__item:hover img{transform:scale(1.06)}
.gallery__caption{position:absolute;left:0;right:0;bottom:0;padding:8px 10px;font-size:12px;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.6));opacity:0;transition:.2s}
.gallery__item:hover .gallery__caption{opacity:1}

/* 图片悬停放大（独立使用） */
.img-zoom{overflow:hidden;border-radius:var(--radius-sm)}
.img-zoom img{transition:.2s}
.img-zoom:hover img{transform:scale(1.06)}

/* WebP + 回退：统一 picture 包裹，CSS 仅保证自适应 */
.picture img{width:100%;height:auto;display:block;border-radius:var(--radius-sm)}

/* 水印位：图片右上角叠加半透明标识（由模板输出，CSS 仅定位） */
.img-watermark{position:relative}
.img-watermark::after{content:attr(data-wm);position:absolute;right:8px;bottom:8px;padding:2px 8px;font-size:12px;color:#fff;background:rgba(0,0,0,.45);border-radius:4px;pointer-events:none}

/* lightbox 容器（media.js 注入） */
.lightbox{position:fixed;inset:0;background:rgba(15,31,51,.92);display:none;align-items:center;justify-content:center;z-index:var(--z-modal);padding:24px}
.lightbox.open{display:flex}
.lightbox img{max-width:92vw;max-height:88vh;border-radius:8px}
.lightbox__close{position:absolute;top:18px;right:24px;color:#fff;font-size:32px;cursor:pointer;line-height:1}

/* ---------- 7. 区块辅助 ---------- */
.section--tight{padding:36px 0}
.lead{font-size:18px;color:var(--muted);line-height:1.8;max-width:760px}
.divider{border:0;border-top:1px solid var(--line);margin:var(--sp-5) 0}
.cta-band{background:linear-gradient(135deg,var(--brand) 0%,var(--brand-dark) 100%);color:#fff;border-radius:var(--radius);padding:36px;text-align:center;margin:var(--sp-5) 0}
.cta-band__title{font-size:24px;font-weight:700;margin-bottom:10px}
.cta-band__sub{opacity:.92;margin-bottom:20px;max-width:620px;margin-left:auto;margin-right:auto}
.cta-band__actions{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}

/* ---------- 8. 排版 / 间距工具 ---------- */
.text-center{text-align:center}
.text-brand{color:var(--brand)}
.text-muted{color:var(--muted)}
.mt-1{margin-top:var(--sp-1)}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}.mt-4{margin-top:var(--sp-4)}.mt-5{margin-top:var(--sp-5)}.mt-6{margin-top:var(--sp-6)}
.mb-1{margin-bottom:var(--sp-1)}.mb-2{margin-bottom:var(--sp-2)}.mb-3{margin-bottom:var(--sp-3)}.mb-4{margin-bottom:var(--sp-4)}.mb-5{margin-bottom:var(--sp-5)}.mb-6{margin-bottom:var(--sp-6)}

/* ---------- 8.5 列数修饰类（替代模板行内样式，让媒体查询能接管折叠） ---------- */
.card-grid--2{grid-template-columns:repeat(2,1fr)}
.card-grid--4{grid-template-columns:repeat(4,1fr)}

/* ---------- 9. 响应式 ---------- */
@media (max-width:980px){
  .showcase{grid-template-columns:repeat(2,1fr)}
  .card-grid--4{grid-template-columns:repeat(2,1fr)}
  .banner__title{font-size:26px}
}
@media (max-width:680px){
  .showcase{grid-template-columns:1fr}
  .card-grid--2,.card-grid--4{grid-template-columns:1fr}
  .gallery{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .banner__title{font-size:22px}
  .form-actions{flex-direction:column}
  .form-actions .btn{width:100%}
}

/* 产品详情页转化区（v20261020b） */
.product-cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.product-cta .btn{flex:0 0 auto}
.product-foot{margin-top:40px;padding:28px 30px;border:1px solid var(--line);border-radius:var(--radius,8px);background:var(--bg-alt,#f8fafc)}
.product-foot__title{margin:0 0 8px;font-size:20px;font-weight:600;color:var(--text,#222)}
.product-foot__desc{margin:0 0 18px;font-size:15px;line-height:1.8;color:var(--muted,#666)}
.product-foot__actions{display:flex;gap:12px;flex-wrap:wrap}
@media (max-width:768px){
  .product-cta .btn,.product-foot__actions .btn{flex:1 1 100%}
  .product-foot{padding:22px 18px}
}

/* FAQ 问答模块（v20261020d）—— details 折叠，纯 CSS 无需 JS */
.faq{margin-top:36px;border-top:1px solid var(--line);padding-top:28px}
.faq__title{margin:0 0 4px;font-size:22px;font-weight:600;color:var(--text,#222)}
.faq__lead{margin:0 0 18px;font-size:15px;color:var(--muted,#666)}
.faq__item{border:1px solid var(--line);border-radius:8px;margin-bottom:10px;background:#fff;overflow:hidden}
.faq__item[open]{border-color:var(--brand)}
.faq__q{list-style:none;cursor:pointer;padding:16px 46px 16px 18px;font-size:16px;font-weight:500;color:var(--text,#222);position:relative;line-height:1.6}
.faq__q::-webkit-details-marker{display:none}
.faq__q::after{content:"";position:absolute;right:20px;top:50%;width:9px;height:9px;border-right:1.5px solid var(--muted,#888);border-bottom:1.5px solid var(--muted,#888);transform:translateY(-70%) rotate(45deg);transition:transform .2s}
.faq__item[open] .faq__q::after{transform:translateY(-30%) rotate(-135deg)}
.faq__q:hover{color:var(--brand)}
.faq__a{padding:0 18px 18px;font-size:15px;line-height:1.85;color:var(--muted,#555)}
.faq__a p{margin:0 0 10px}
.faq__a p:last-child{margin-bottom:0}
.faq__a code{background:var(--bg-alt,#f5f7fa);padding:1px 6px;border-radius:4px;font-size:13px}
@media (max-width:768px){
  .faq__title{font-size:19px}
  .faq__q{font-size:15px;padding:14px 40px 14px 15px}
  .faq__a{font-size:14px;padding:0 15px 15px}
}

/* 价格面议（源码交付类产品无标准报价） */
.price--ask{color:var(--brand);font-weight:600}

/* 价格区间参考说明（v20261020h） */
.price-hint{margin-top:4px;font-size:13px;color:var(--muted,#666);line-height:1.6}
.product-info .price-hint{font-size:14px;margin:0 0 16px}
.card-body .price-hint{font-size:12.5px}

/* 联系信息里的重点联系方式（电话 / 微信） */
.contact-meta__strong{color:var(--brand);font-weight:600;font-size:17px}

/* 产品正文排版 .prose（v20261020g）
   注意：全局 ul/li 是导航用的无序列表样式，正文里必须用 .prose 包裹隔离 */
.prose{font-size:16px;line-height:1.9;color:#374151}
.prose h2{margin:32px 0 12px;font-size:22px;font-weight:600;color:var(--ink);padding-left:12px;border-left:4px solid var(--brand);line-height:1.4}
.prose h3{margin:24px 0 10px;font-size:18px;font-weight:600;color:var(--ink)}
.prose p{margin:0 0 14px}
.prose ul,.prose ol{margin:0 0 16px;padding:0;list-style:none;display:block}
.prose li{display:block;padding:9px 0 9px 24px;border-bottom:1px dashed var(--line);position:relative;margin:0}
.prose li:last-child{border-bottom:0}
.prose li::before{content:"";position:absolute;left:6px;top:18px;width:6px;height:6px;border-radius:50%;background:var(--brand)}
.prose ol{counter-reset:prose-num}
.prose ol li{counter-increment:prose-num;padding-left:32px}
.prose ol li::before{content:counter(prose-num);left:0;top:9px;width:20px;height:20px;border-radius:50%;background:var(--brand);color:#fff;font-size:12px;line-height:20px;text-align:center;font-weight:500}
.prose strong{color:var(--ink);font-weight:600}
.prose em{font-style:normal;color:var(--brand);font-weight:500}
.prose .prose-lead{font-size:17px;color:var(--muted);margin-bottom:18px}
.prose .prose-note{margin:18px 0;padding:14px 16px;background:var(--bg-alt);border-left:3px solid var(--brand);border-radius:var(--radius-sm,8px);font-size:15px;color:#4b5563}
.prose .prose-note b{color:var(--ink)}
.prose .prose-plan{margin:18px 0;padding:16px 18px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm,8px)}
.prose .prose-plan__label{display:inline-block;margin-bottom:8px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:500;color:#fff;background:var(--muted)}
.prose .prose-plan__label--now{background:var(--brand)}
.prose .prose-plan__label--next{background:#9ca3af}
.prose .prose-plan p{margin:0 0 8px;font-size:15px}
.prose .prose-plan p:last-child{margin-bottom:0}
.prose .prose-table{width:100%;border-collapse:collapse;margin:0 0 18px;font-size:15px}
.prose .prose-table th,.prose .prose-table td{padding:11px 14px;border:1px solid var(--line);text-align:left;vertical-align:top}
.prose .prose-table th{background:var(--bg-alt);font-weight:600;color:var(--ink);white-space:nowrap}
.prose code{background:var(--bg-alt);padding:2px 6px;border-radius:4px;font-size:14px;font-family:ui-monospace,Menlo,Consolas,monospace}
@media (max-width:768px){
  .prose{font-size:15px;line-height:1.85}
  .prose h2{font-size:19px;margin:26px 0 10px}
  .prose h3{font-size:16px}
  .prose .prose-table{font-size:14px}
  .prose .prose-table th,.prose .prose-table td{padding:9px 10px}
}
