/* ============================================================
   O2O健康服务系统 用户前端样式（通栏 + H5 自适应 + 4 套风格）
   风格：1 黑绿 / 2 粉红 / 3 天蓝 / 4 红黑（对应 sysconfig.Styles）
   ============================================================ */

body {
    --c1: #27ae60;            /* 主色 */
    --c2: #1e8449;            /* 强调/深主色 */
    --bg: #f4f8f4;            /* 页面背景 */
    --txt: #2c3e50;           /* 正文 */
    --muted: #8a9a8a;         /* 次要文字 */
    --top-bg: #152b1d;        /* 顶栏背景 */
    --top-txt: #eff7ef;       /* 顶栏文字 */
    --card-bg: #ffffff;
    --line: #e6ede6;
    background: var(--bg);
    color: var(--txt);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

/* 粉红风 */
body[data-theme="2"] {
    --c1: #e84393; --c2: #d81b60; --bg: #fdf4f7; --txt: #4a2b3a;
    --muted: #c08aa5; --top-bg: #40203a; --top-txt: #fdeef5; --line: #f6dfe9;
}

/* 天蓝风 */
body[data-theme="3"] {
    --c1: #3498db; --c2: #2980b9; --bg: #f0f7fc; --txt: #23455c;
    --muted: #7fa3bd; --top-bg: #12344d; --top-txt: #eef7fd; --line: #dcebf5;
}

/* 红黑风 */
body[data-theme="4"] {
    --c1: #e74c3c; --c2: #c0392b; --bg: #f7f4f3; --txt: #3a3333;
    --muted: #a68f8a; --top-bg: #1b1b1b; --top-txt: #f5efee; --line: #ece2e0;
}

/* ===== 顶部栏 ===== */
.site-top {
    background: var(--top-bg);
    color: var(--top-txt);
    padding: .6rem 0;
}
.site-brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.site-brand img.logo { height: 42px; width: auto; border-radius: 8px; }
.site-brand .site-name {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--top-txt);
    white-space: nowrap;
    letter-spacing: 1px;
}
.site-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .25rem; scrollbar-width: none; margin-left: 1.2rem; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
    color: var(--top-txt);
    text-decoration: none;
    font-size: 1.05rem;
    padding: .35rem .75rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.site-nav a.active { background: #fff; color: var(--c1); font-weight: 700; }

.site-search .form-control {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    color: var(--top-txt);
}
.site-search .form-control::placeholder { color: rgba(255, 255, 255, .6); }
.site-search .form-control:focus { background: #fff; color: var(--txt); }

.site-btn {
    background: var(--c1);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: .4rem .9rem;
    font-size: .92rem;
    text-decoration: none;
    display: inline-block;
    transition: .2s;
}
.site-btn:hover { background: var(--c2); color: #fff; }
.site-btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.45); }
.site-btn.ghost:hover { background: rgba(255,255,255,.15); }

/* 白色面板内的 ghost 按钮：深色头部区白字白框在浅色背景上不可见，改为主题色边框+文字 */
.detail-panel .site-btn.ghost {
    color: var(--c1);
    border-color: var(--c1);
}
.detail-panel .site-btn.ghost:hover {
    background: var(--c1);
    color: #fff;
    border-color: var(--c1);
}

.site-style-select {
    background: rgba(255,255,255,.12);
    color: var(--top-txt);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 6px;
    font-size: .85rem;
    padding: .3rem .5rem;
}
.site-style-select option { color: #333; background: #fff; }

/* 移动端折叠菜单 */
.site-mobile-menu { border-top: 1px solid rgba(255,255,255,.12); margin-top: .5rem; padding-top: .4rem; }
.site-mobile-menu .site-nav { flex-direction: column; }
.site-mobile-menu .site-nav a { padding: .5rem .5rem; }

/* ===== 通知栏 ===== */
.notice-bar {
    background: linear-gradient(90deg, var(--c1), var(--c2));
    color: #fff;
    font-size: .92rem;
}
.notice-inner { display: flex; align-items: center; gap: .6rem; height: 38px; overflow: hidden; }
.notice-inner .notice-tag {
    background: rgba(255,255,255,.25);
    padding: .1rem .5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
}
.notice-list { list-style: none; margin: 0; padding: 0; transition: transform .6s ease; }
.notice-list li { height: 38px; line-height: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 快捷栏（省份/服务/热门） ===== */
.quick-bar {
    display: flex; flex-wrap: wrap;
    gap: .5rem; padding: .15rem 0;
}
.quick-bar .chip,
.area-panel .chip {
    border: 1px solid var(--line);
    background: var(--card-bg);
    color: var(--txt);
    padding: .35rem .9rem;
    border-radius: 20px;
    font-size: .9rem;
    white-space: nowrap;
    text-decoration: none;
    transition: .2s;
}
.quick-bar .chip:hover,
.area-panel .chip:hover { border-color: var(--c1); color: var(--c1); }
.quick-bar .chip.active { background: var(--c1); border-color: var(--c1); color: #fff; }

/* ===== 市/区/县级联下拉面板 ===== */
.area-panel {
    display: none;
    margin: .4rem 0 .2rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card-bg);
}
.area-panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.area-panel-head .chip { border-color: var(--c1); color: var(--c1); padding: .2rem .7rem; font-size: .82rem; }
.area-panel-title { font-weight: 700; color: var(--txt); }
.area-city-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .3rem 0; border-top: 1px dashed var(--line); }
.area-city-row:first-of-type { border-top: none; }
.area-empty { color: var(--txt-dim, #999); font-size: .9rem; padding: .3rem 0; }

/* ===== 产品卡片 ===== */
.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: .25s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,.1); }
.product-card .pc-img-wrap { aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); position: relative; }
.product-card .pc-img { width: 100%; height: 100%; object-fit: contain; }
.product-card .pc-img-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 2.2rem; }
.product-card .pc-body { padding: .65rem .8rem .8rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.product-card .pc-title {
    font-size: 1rem; font-weight: 600; color: var(--txt);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-card .pc-summary {
    font-size: .85rem; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.4em;
}
.product-card .pc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.product-card .pc-area { font-size: .82rem; color: var(--muted); }
.product-card .pc-county { color: var(--c1); font-weight: 700; background: var(--line); border-radius: 4px; padding: 0 .3rem; margin-left: .15rem; font-size: .78rem; white-space: nowrap; }
.product-card .pc-hits { font-size: .82rem; color: var(--c1); }
.product-card .pc-date { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* ===== 详情页收藏按钮 ===== */
.fav-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    border: 1px solid var(--line); background: var(--card-bg);
    border-radius: 20px; padding: .3rem .8rem;
    font-size: .88rem; color: var(--muted); cursor: pointer;
    white-space: nowrap;
}
.fav-btn:hover { border-color: var(--c1); color: var(--c1); }
.fav-btn.on { border-color: var(--c1); color: var(--c1); }
.fav-btn.on i { color: #e0245e; }

/* ===== 极简富文本工具栏（详情页评论弹窗共用） ===== */
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid #dee2e6; border-bottom: 0; border-radius: 8px 8px 0 0; background: #f8f9fa; }
.rich-toolbar button { border: 1px solid #dee2e6; background: #fff; border-radius: 4px; padding: 2px 8px; font-size: .8rem; line-height: 1.6; color: #495057; cursor: pointer; }
.rich-toolbar button:hover { background: #e9ecef; }
.rich-editor { min-height: 150px; border: 1px solid #dee2e6; border-radius: 0 0 8px 8px; padding: 8px; overflow-y: auto; }
.rich-editor:focus { outline: none; border-color: var(--c1); }
.rich-editor img { max-width: 100%; }
.comment-content.rich { line-height: 1.7; }

/* ===== 评论点赞/踩按钮（必选） ===== */
.comment-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    color: #495057;
    font-size: .9rem;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
}
.comment-vote-btn:hover { border-color: var(--c1); color: var(--c1); }
.comment-vote-btn:has(input:checked) {
    border-color: var(--c1);
    background: var(--c1);
    color: #fff;
}

/* ===== 区块标题 ===== */
.section-title {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1.1rem; font-weight: 700; color: var(--txt);
    margin: 1.2rem 0 .7rem;
}
.section-title::before { content: ""; width: 5px; height: 1.1rem; border-radius: 3px; background: var(--c1); }

/* ===== 底部栏 ===== */
.site-footer {
    background: var(--top-bg);
    color: rgba(255,255,255,.85);
    text-align: center;
    padding: 1.1rem 1rem;
    font-size: .88rem;
    line-height: 1.8;
    margin-top: 1.5rem;
}
.site-footer .foot-contact { color: rgba(255,255,255,.75); }

/* ===== 登录弹窗 ===== */
.login-modal .modal-content { border-radius: 12px; border: none; }
.login-modal .modal-header { background: var(--c1); color: #fff; border-radius: 12px 12px 0 0; }
.han-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.han-grid button {
    height: 2.9rem;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--txt);
    transition: .15s;
}
.han-grid button:hover { border-color: var(--c1); }
.han-grid button.picked { background: var(--c1); color: #fff; border-color: var(--c1); }
.han-grid button:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 通用 ===== */
.text-theme { color: var(--c1); }
.site-empty { text-align: center; color: var(--muted); padding: 3rem 0; }
.badge-soft-theme { background: color-mix(in srgb, var(--c1) 14%, #fff); color: var(--c1); }
.badge-soft-warm { background: #fdf0dd; color: #b0781f; }
.badge-soft-info { background: #e8eef7; color: #4a6da7; }

/* 广告位 */
.ad-block { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ad-block img { display: block; width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }
.ad-block a { display: block; }

/* 详情页 */
.detail-img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; }
.detail-panel { background: var(--card-bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .9rem; color: var(--muted); }
.detail-meta b { color: var(--c1); font-weight: 600; }
.section-title { font-size: 1.05rem; font-weight: 700; position: relative; padding-left: .6rem; }
.section-title::before { content: ''; position: absolute; left: 0; top: .2rem; bottom: .2rem; width: 4px; border-radius: 2px; background: var(--c1); }

/* 相册块 */
.gallery-list { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.gallery-thumb { width: 86px; height: 64px; object-fit: contain; border-radius: 8px; cursor: pointer; border: 2px solid transparent; flex: 0 0 auto; opacity: .85; transition: border-color .15s, opacity .15s; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--c1); opacity: 1; }

/* 联系方式块 */
.contact-list { display: flex; flex-direction: column; gap: .55rem; font-size: .95rem; }
.contact-item { display: flex; align-items: center; gap: .4rem; color: var(--text); word-break: break-all; }
.contact-item i { color: var(--c1); }
.contact-item span { color: var(--muted); flex: 0 0 auto; }
.contact-item b { color: var(--c1); font-weight: 600; }
.contact-link { display: inline-block; background: var(--line); color: var(--c1); border-radius: 6px; padding: .1rem .55rem; margin-right: .4rem; font-size: .85rem; }

/* 评论块 */
.comment-list { display: flex; flex-direction: column; }
.comment-item { padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.comment-item:last-child { border-bottom: none; padding-bottom: .2rem; }
.comment-user { font-weight: 600; font-size: .95rem; }
.comment-content { margin-top: .45rem; color: var(--text); line-height: 1.7; font-size: .95rem; }
.badge-good { background: #e8f7ee; color: #1d9d55; }
.badge-bad { background: #fdeeee; color: #d64545; }

/* 注册页 */
.auth-card { max-width: 460px; margin: 2rem auto; background: var(--card-bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem; }

/* 分页（Bootstrap5 分页主题化） */
.pagination .page-link { color: var(--c1); }
.pagination .active > .page-link { background: var(--c1); border-color: var(--c1); color: #fff; }
