/* ============================================================
   银龄生活 · 适老化样式
   设计原则：大字体、高对比、大按钮、少弹窗、清晰分区
   ============================================================ */

/* 字号档位：通过 body class 调整根字号 */
body.font-normal  { font-size: 16px; }
body.font-large   { font-size: 20px; }
body.font-xlarge  { font-size: 24px; }

:root {
    --c-bg: #f4f6f8;
    --c-card: #ffffff;
    --c-text: #1a1a1a;
    --c-sub: #5a6470;
    --c-primary: #1e7e34;     /* 醒目绿，代表安全/健康 */
    --c-primary-d: #155d27;
    --c-accent: #d9531e;      /* 警示橙红 */
    --c-blue: #1565c0;
    --c-border: #e2e6ea;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
    --btn-h: 3.2rem;          /* 大按钮高度，随字号放大 */
}

/* 高对比度模式 */
body.high-contrast {
    --c-bg: #000000;
    --c-card: #111111;
    --c-text: #ffffff;
    --c-sub: #ffe600;
    --c-primary: #ffe600;
    --c-primary-d: #ffd000;
    --c-accent: #ff5252;
    --c-blue: #40c4ff;
    --c-border: #ffffff;
    --shadow: none;
}
body.high-contrast .card,
body.high-contrast .topbar,
body.high-contrast .mainnav,
body.high-contrast .btn { border: 2px solid #fff; }
body.high-contrast a { color: #ffe600; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶部栏 ---------- */
.topbar { background: var(--c-primary); color: #fff; }
body.high-contrast .topbar { background:#000; border-bottom:3px solid #ffe600; }
.topbar-inner, .mainnav-inner, .container, .footer-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 16px;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 3.4rem; }
.brand { display: flex; align-items: center; gap: .4rem; color: #fff; font-weight: 700; font-size: 1.2rem; }
.brand-logo { font-size: 1.6rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.btn-call {
    background: var(--c-accent); color: #fff; border: none;
    height: 2.6rem; padding: 0 1rem; border-radius: 999px;
    font-size: 1rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-ghost { color: #fff; font-size: .95rem; padding: .3rem .5rem; }
body.high-contrast .btn-ghost { color: #ffe600; }

/* ---------- 主导航 ---------- */
.mainnav { background: var(--c-card); border-bottom: 1px solid var(--c-border); }
.mainnav-inner { display: flex; gap: .3rem; overflow-x: auto; }
.navitem {
    flex: 1 1 auto; text-align: center; padding: .9rem .5rem;
    color: var(--c-text); font-weight: 600; font-size: 1.05rem;
    border-bottom: 4px solid transparent; white-space: nowrap;
}
.navitem.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ---------- 容器 ---------- */
.container { padding: 18px 16px 90px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.card-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: .5rem; }
.card-title .more { margin-left: auto; font-size: .9rem; color: var(--c-sub); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
    height: var(--btn-h); padding: 0 1.4rem; border-radius: 12px;
    border: 2px solid transparent; font-size: 1.05rem; font-weight: 700;
    cursor: pointer; background: var(--c-primary); color: #fff; line-height: 1;
}
.btn:hover { background: var(--c-primary-d); }
.btn-secondary { background: #eceff1; color: var(--c-text); }
body.high-contrast .btn-secondary { background:#222; color:#ffe600; }
.btn-outline { background: transparent; border-color: var(--c-primary); color: var(--c-primary); }
.btn-danger { background: var(--c-accent); }
.btn-block { width: 100%; }
.btn-sm { height: 2.4rem; font-size: .95rem; padding: 0 .9rem; }

/* ---------- 首页大按钮网格 ---------- */
.big-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.big-tile {
    background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px 14px; text-align: center; cursor: pointer; color: var(--c-text);
    border: 2px solid transparent; transition: transform .08s;
}
.big-tile:active { transform: scale(.97); }
.big-tile .ico { font-size: 2.6rem; line-height: 1; }
.big-tile .lbl { font-size: 1.2rem; font-weight: 700; margin-top: 8px; }
.big-tile .sub { font-size: .85rem; color: var(--c-sub); margin-top: 2px; }

/* 紧急呼叫置顶大按钮 */
.emergency-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.emergency-bar a {
    background: var(--c-accent); color: #fff; border-radius: 14px; padding: 16px 8px;
    text-align: center; font-weight: 700; font-size: 1.1rem;
}
.emergency-bar a small { display:block; font-weight:400; font-size:.8rem; opacity:.9; }

/* ---------- 列表 / 商品 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.product {
    background: var(--c-card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column;
}
.product .thumb { aspect-ratio: 1/1; background: #eee center/cover no-repeat; }
.product .info { padding: 10px 12px 14px; }
.product .pname { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.product .price { color: var(--c-accent); font-weight: 800; font-size: 1.15rem; margin-top: 6px; }
.product .price s { color: var(--c-sub); font-weight: 400; font-size: .8rem; margin-left: 6px; }
.product .scene { color: var(--c-sub); font-size: .8rem; margin-top: 4px; }

/* 列表行 */
.list-row {
    display: flex; align-items: center; gap: 12px; padding: 14px 4px;
    border-bottom: 1px solid var(--c-border); cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row .ico { font-size: 1.8rem; }
.list-row .body { flex: 1; }
.list-row .body .t { font-weight: 600; font-size: 1.05rem; }
.list-row .body .d { color: var(--c-sub); font-size: .85rem; }
.list-row .arrow { color: var(--c-sub); font-size: 1.4rem; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: 14px 12px; font-size: 1.05rem; border-radius: 12px;
    border: 2px solid var(--c-border); background: var(--c-card); color: var(--c-text);
}
.field textarea { min-height: 100px; resize: vertical; }

/* ---------- 标签 / 徽章 ---------- */
.tag { display: inline-block; background: #e8f5e9; color: var(--c-primary);
    padding: 2px 10px; border-radius: 999px; font-size: .8rem; margin: 2px; }
body.high-contrast .tag { background:#222; color:#ffe600; border:1px solid #ffe600; }
.badge { display:inline-block; background: var(--c-blue); color:#fff; font-size:.75rem;
    padding: 2px 8px; border-radius: 999px; }
.badge-warn { background: var(--c-accent); }
.badge-ok { background: var(--c-primary); }
.badge-gray { background:#9aa3ad; }

/* ---------- 进度条 ---------- */
.steps { display: flex; gap: 4px; margin: 10px 0; }
.steps .step { flex: 1; text-align: center; font-size: .8rem; color: var(--c-sub); }
.steps .step .dot { width: 26px; height: 26px; border-radius: 50%; background: #e0e0e0;
    color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; font-weight: 700; }
.steps .step.done .dot { background: var(--c-primary); }
.steps .step.active .dot { background: var(--c-accent); }

/* ---------- 浮动返回首页 ---------- */
.float-home {
    position: fixed; right: 18px; bottom: 24px; width: 60px; height: 60px;
    border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 1.8rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.25);
    z-index: 50;
}
body.high-contrast .float-home { border:2px solid #ffe600; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--c-card); border-radius: var(--radius); padding: 20px;
    width: 100%; max-width: 420px; }
.call-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.call-item { display: flex; justify-content: space-between; align-items: center;
    background: #e8f5e9; color: var(--c-text); padding: 16px; border-radius: 12px; font-weight: 700; }
body.high-contrast .call-item { background:#222; color:#ffe600; border:1px solid #ffe600; }
.call-phone { color: var(--c-accent); }

/* ---------- 语音提示 ---------- */
#voice-status { position: fixed; left: 50%; top: 12%; transform: translateX(-50%);
    background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 999px;
    font-size: 1rem; z-index: 200; display: none; }

/* ---------- 闪存消息 ---------- */
.flash { max-width: 1100px; margin: 12px auto; padding: 14px 18px; border-radius: 12px;
    font-weight: 600; cursor: pointer; }
.flash-info { background: #e3f2fd; color: #0d47a1; }
.flash-success { background: #e8f5e9; color: var(--c-primary-d); }
.flash-error { background: #ffebee; color: #b71c1c; }

/* ---------- 工具 ---------- */
.muted { color: var(--c-sub); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.text-center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
hr.sep { border: none; border-top: 1px solid var(--c-border); margin: 16px 0; }
.price-big { color: var(--c-accent); font-weight: 800; font-size: 1.6rem; }

/* 详情页图片占位 */
.photo { background: #e9ecef center/cover no-repeat; border-radius: 12px; }
.photo.lg { aspect-ratio: 16/9; }
.photo.sm { aspect-ratio: 1/1; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--c-card); border-top: 1px solid var(--c-border); padding: 22px 16px; text-align: center; color: var(--c-sub); }
.footer-links a { color: var(--c-blue); margin: 0 2px; }
.footer-copy { font-size: .8rem; margin-top: 8px; }

/* ---------- 双栏：老人/子女切换 ---------- */
.switch { display:flex; gap:8px; margin-bottom:14px; }
.switch a { flex:1; text-align:center; padding:14px; border-radius:12px; background:var(--c-card); border:2px solid var(--c-border); font-weight:700; }
.switch a.on { border-color: var(--c-primary); color: var(--c-primary); background:#e8f5e9; }

/* 隐藏类 */
.hidden { display: none !important; }

/* 响应式 */
@media (max-width: 600px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .big-tile .ico { font-size: 2.2rem; }
}

/* ============================================================
   首页幻灯片（轮播）
   适老化：大字号、高对比、清晰圆点、悬停/触摸暂停
   ============================================================ */
.slideshow {
    position: relative;
    margin: 12px;
    border-radius: 14px;
    overflow: hidden;
    background: #e9eef2;
    height: 184px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.slideshow .slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 56px 0 22px;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
    z-index: 1;
}
.slideshow .slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
.slideshow .slide .emoji { font-size: 2.4rem; line-height: 1; }
.slideshow .slide .s-title {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 8px 0 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.slideshow .slide .s-sub {
    font-size: 1rem;
    opacity: .96;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.slideshow .slide .s-cta {
    margin-top: 12px;
    width: max-content;
    background: rgba(255, 255, 255, .92);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: .98rem;
}
.slideshow .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slideshow .arrow.prev { left: 8px; }
.slideshow .arrow.next { right: 8px; }
.slideshow .dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.slideshow .dots .dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
}
.slideshow .dots .dot.active {
    width: 22px;
    border-radius: 6px;
    background: #fff;
}
/* 背景图形态（后台上传图片时）：铺满 + 左侧暗色蒙版，保证文字高对比可读 */
.slideshow .slide.has-img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.slideshow .slide.has-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .34) 55%, rgba(0, 0, 0, .12) 100%);
    z-index: 0;
}
.slideshow .slide.has-img > * { position: relative; z-index: 1; }

@media (max-width: 600px) {
    .slideshow { height: 160px; }
    .slideshow .slide { padding-right: 48px; }
    .slideshow .slide .emoji { font-size: 2rem; }
    .slideshow .slide .s-title { font-size: 1.3rem; }
}
