/* ============================================================
   建筑遗产列表 · 小程序专用
   冷峻深色 · 横向卡片 · 移动优先
   ============================================================ */

:root {
    --bg-0: #0A0B0C;
    --bg-1: #101214;
    --panel: #15181B;
    --panel-2: #1B1F23;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #E6E9EC;
    --text-dim: #A8B0B8;
    --text-mute: #6E767E;
    --accent: #A8B0B8;
    --accent-soft: rgba(168, 176, 184, 0.14);
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg-0);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior-y: contain;
}

a { text-decoration: none; color: inherit; }
img { display: block; }

/* ---------- 顶栏 ---------- */
.list-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 11, 12, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 8px;
}

.close-btn {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.8rem;
    transition: background 0.18s, color 0.18s;
}
.close-btn:active { background: var(--accent-soft); color: var(--text); }

.header-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.header-badge {
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--text-mute));
    flex: 0 0 auto;
}

.header-title {
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-count {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: var(--text-mute);
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

/* ---------- 搜索 ---------- */
.search-form {
    display: flex;
    gap: 8px;
    padding: 0 14px 8px;
}

.search-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.18s;
}
.search-wrap:focus-within { border-color: var(--border-strong); }
.search-wrap > i { color: var(--text-mute); font-size: 0.82rem; flex: 0 0 auto; }
.search-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.86rem;
    font-family: inherit;
}
.search-wrap input::placeholder { color: var(--text-mute); }

.search-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.search-btn:active { background: var(--accent-soft); color: var(--text); }

/* ---------- 筛选条 ---------- */
.filter-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 9px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* 右缘淡出，提示还能往右滑 */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
}
.filter-scroll::-webkit-scrollbar { display: none; }

.filter-label {
    flex: 0 0 auto;
    font-size: 0.68rem;
    color: var(--text-mute);
    letter-spacing: 1px;
    padding-right: 2px;
}

.filter-chip {
    flex: 0 0 auto;
    padding: 5px 12px;
    font-size: 0.76rem;
    color: var(--text-dim);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.filter-chip:active { background: var(--panel-2); }
.filter-chip.active {
    color: var(--bg-0);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* ---------- 列表容器 ---------- */
.list-container {
    padding: 12px 14px 0;
    max-width: 720px;
    margin: 0 auto;
}

.count-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    color: var(--text-mute);
}
.count-num { color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }

.clear-filter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.clear-filter:active { background: var(--panel-2); }

/* ---------- 卡片 ---------- */
.card-list { display: flex; flex-direction: column; gap: 9px; }

.b-card {
    display: flex;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.14s;
}
.b-card:active { transform: scale(0.988); border-color: var(--border-strong); }

.b-card-img {
    position: relative;
    flex: 0 0 116px;
    width: 116px;
    min-height: 116px;
    background: var(--bg-1);
    overflow: hidden;
}
.b-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.b-card-num {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 2px 6px;
    font-size: 0.58rem;
    letter-spacing: 0.3px;
    color: var(--text-dim);
    background: rgba(10, 11, 12, 0.72);
    border-radius: 5px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-variant-numeric: tabular-nums;
}

/* 保护级别：六段色阶，竖排在右上 */
.b-card-scale {
    position: absolute;
    right: 6px;
    top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 3px;
    border-radius: 5px;
    background: rgba(10, 11, 12, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.b-card-scale .seg {
    width: 3px;
    height: 6px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.15);
}
.b-card-scale .seg.filled { background: var(--c); }
.b-card-scale .seg.current { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }

/* 保存状态：压在图片底部 */
.b-card-status {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 7px 4px;
    font-size: 0.6rem;
    color: #FFFFFF;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}
.b-card-status .dot {
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--status-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.b-card-status > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.b-card-body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.b-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    letter-spacing: 0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.b-card-subtitle {
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--text-mute);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.b-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 5px;
    font-size: 0.68rem;
    color: var(--text-mute);
}
.meta-item { display: inline-flex; align-items: center; gap: 3px; }
.meta-item i { font-size: 0.62rem; opacity: 0.75; }
.meta-sep { color: var(--text-mute); opacity: 0.5; }

/* 开放状态 */
.b-card-visit {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
    padding: 2px 8px;
    font-size: 0.66rem;
    border-radius: 6px;
    color: var(--visit-color);
    background: var(--panel-2);
    background: color-mix(in srgb, var(--visit-color) 13%, transparent);
    border: 1px solid var(--border);
    border-color: color-mix(in srgb, var(--visit-color) 30%, transparent);
}
.b-card-visit i { font-size: 0.6rem; }

/* ---------- 空状态 ---------- */
.no-result {
    text-align: center;
    padding: 56px 24px;
}
.no-result-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-mute);
    font-size: 1.3rem;
}
.no-result h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.no-result p {
    font-size: 0.76rem;
    color: var(--text-mute);
    margin-bottom: 20px;
}
.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}
.reset-btn:active { background: var(--accent-soft); }

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 22px 14px calc(26px + env(safe-area-inset-bottom, 0px));
    max-width: 720px;
    margin: 0 auto;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    transition: background 0.18s, color 0.18s;
}
.page-btn:active { background: var(--panel-2); }
.page-btn.active {
    color: var(--bg-0);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}
.page-btn.disabled {
    opacity: 0.32;
    pointer-events: none;
}
.page-ellipsis {
    min-width: 24px;
    text-align: center;
    color: var(--text-mute);
    font-size: 0.8rem;
}

/* ---------- 大屏 ---------- */
@media (min-width: 640px) {
    .b-card-img { flex-basis: 148px; width: 148px; min-height: 132px; }
    .b-card-body { padding: 14px 18px; gap: 6px; }
    .b-card-title { font-size: 1.02rem; }
}
