/* ===== 全局变量：午夜蓝 + 暖琥珀 高端汽车主题 ===== */
:root {
    /* 主色：午夜深海军蓝 —— 专业、沉稳、值得信赖 */
    --brand-dark: #0c1729;
    --brand-navy: #16294a;

    /* 强调色：暖琥珀橙 —— 活力、醒目但克制 */
    --accent: #ff7a18;
    --accent-dark: #e85d04;
    --accent-soft: rgba(255, 122, 24, .12);

    /* 价格色：暖朱红 —— 与强调色区分，突出价格信息 */
    --price: #e23b3b;

    /* 成功/信任色：松石绿 —— 车况承诺、品质保证 */
    --success: #1aa58a;
    --success-soft: #e8f7f3;

    /* 文字与中性色 */
    --ink: #1a2233;
    --ink-soft: #4a5568;
    --muted: #6b7689;
    --bg-gray: #f6f8fb;
    --card-bg: #ffffff;

    /* 边框：冷调微蓝，与午夜海军蓝呼应，比纯灰更有质感 */
    --border: #e2e8f1;
    --border-strong: #cdd8e6;

    --radius: 12px;
}

body {
    color: var(--ink);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a { text-decoration: none; }
.text-accent { color: var(--accent) !important; }

/* ===== 按钮 ===== */
.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-bg: var(--accent-dark);
    font-weight: 600;
}
.bg-accent { background-color: var(--accent) !important; }

/* 语言切换胶囊 */
.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: #eef2f7;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.lang-option {
    border: 0;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .2s, color .2s;
}
.lang-option:hover { background: rgba(12, 23, 41, .07); color: var(--brand-dark); }
.lang-option.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.lang-option.active:hover { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }

/* 右下角悬浮语言切换 */
.lang-float {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1050;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ===== 页面容器 ===== */
.page { padding-top: 32px; padding-bottom: 56px; }

/* ===== 首页搜索框 ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 440px;
    min-width: 0;
    margin-inline-start: auto;
    background: var(--bg-gray);
    border: 1px solid transparent;
    border-radius: 999px;
    padding-block: 4px;
    padding-inline: 14px 4px;
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-bar .search-icon { color: var(--muted); font-size: .95rem; flex-shrink: 0; }
.search-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: .92rem;
    color: var(--ink);
    padding: 6px 2px;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar input::-webkit-search-cancel-button { cursor: pointer; }
.search-btn { flex-shrink: 0; border-radius: 999px; padding: .45rem 1.15rem; font-size: .88rem; }

/* ===== 车辆卡片 ===== */
.vehicle-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    background: var(--card-bg);
    transition: transform .25s, border-color .25s;
}
.vehicle-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    color: var(--ink);
}
.card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef1f6;
}
.card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.vehicle-card:hover .card-img-wrap img { transform: scale(1.06); }
.vehicle-card .card-title {
    font-size: 1rem; font-weight: 700; color: var(--brand-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-specs { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card-specs i { color: var(--muted); margin-inline-end: 2px; }
.card-price {
    color: var(--price);
    font-size: 1.5rem; font-weight: 800;
    line-height: 1;
}
.card-price em { font-size: .8rem; font-style: normal; margin-inline-start: 2px; font-weight: 600; }

/* ===== 空状态 ===== */
.empty-state i { font-size: 3.4rem; color: var(--border-strong); }

/* ===== 详情页 ===== */
.gallery {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 20px;
    position: relative;
}
.gallery-main {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    background: #eef1f6;
}
.gallery-power { position: absolute; top: 22px; inset-inline-start: 22px; padding: .45em 1em; }
.gallery-thumbs {
    display: flex; gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumbs .thumb {
    width: 110px; height: 72px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: .72;
    transition: .2s;
}
.gallery-thumbs .thumb:hover { opacity: 1; }
.gallery-thumbs .thumb.active { border-color: var(--accent); opacity: 1; }

.info-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
}
.info-block h4 {
    font-size: 1.1rem; font-weight: 800; color: var(--brand-dark);
    margin-bottom: 18px;
    padding-inline-start: 10px;
    border-inline-start: 4px solid var(--accent);
}
.info-block h4 i { color: var(--accent); margin-inline-end: 6px; }
.spec-table { --bs-table-bg: transparent; }
.spec-table th {
    color: var(--muted); font-weight: 500;
    background: var(--bg-gray);
    width: 14%;
    white-space: nowrap;
    border-bottom-color: var(--border) !important;
}
.spec-table td { width: 36%; border-bottom-color: var(--border) !important; }

.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-tag {
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .88rem;
    color: var(--ink-soft);
}
.feature-tag i { color: var(--success); }
.highlight-tag {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: .88rem;
    font-weight: 600;
}
.highlight-tag i { color: var(--accent); }

.promise-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.promise-badge {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #bfe8dd;
    border-radius: 50px;
    padding: 7px 16px;
    font-size: .9rem;
    font-weight: 600;
}
.promise-badge i { color: var(--success); }
.condition-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.condition-item {
    background: var(--bg-gray);
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
}
.condition-item h6 { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.condition-item p { margin: 0; font-size: .92rem; line-height: 1.6; color: var(--ink); }

.buy-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 90px;
}
.buy-card h5 { font-weight: 800; color: var(--brand-dark); line-height: 1.4; }
.buy-price {
    color: var(--price);
    font-size: 2.2rem; font-weight: 800;
    margin: 10px 0 6px;
}
.buy-price em { font-size: 1rem; font-style: normal; margin-inline-start: 3px; }
.buy-specs { list-style: none; padding: 0; margin: 0; }
.buy-specs li {
    display: flex; justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    font-size: .92rem;
}
.buy-specs li:last-child { border-bottom: none; }
.buy-specs span { color: var(--muted); }
.buy-specs strong { color: var(--ink); }

/* ===== 响应式：平板及以下 ===== */
@media (max-width: 991.98px) {
    .buy-card { position: static; }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 767.98px) {
    .container.page { --bs-gutter-x: 2.25rem; }
    .page { padding-top: 24px; padding-bottom: 40px; }

    /* 首页搜索框 */
    .search-bar { margin-inline-start: 0; padding-block: 3px; padding-inline: 12px 3px; }
    .search-bar input { font-size: .9rem; }
    .search-btn { padding: .4rem 1rem; font-size: .85rem; }

    /* 悬浮语言切换 */
    .lang-float { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .lang-option { padding: .28rem .62rem; font-size: .74rem; }

    /* 车辆卡片：横向布局 */
    .vehicle-card { flex-direction: row; align-items: stretch; }
    .card-img-wrap { width: 38%; flex-shrink: 0; aspect-ratio: auto; min-height: 128px; }
    .vehicle-card .card-body { padding: 12px 14px; min-width: 0; }
    .vehicle-card .card-title {
        font-size: 1rem; line-height: 1.4;
        white-space: normal;
        display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    }
    .card-specs { font-size: .78rem; line-height: 1.5; gap: 4px 10px; }
    .card-specs i { display: none; }
    .card-price { font-size: 1.35rem; }
    .card-price em { font-size: .72rem; }

    /* 详情页 */
    .gallery { padding: 10px; margin-bottom: 16px; }
    .gallery-power { top: 16px; inset-inline-start: 16px; font-size: .75rem; padding: .35em .75em; }
    .gallery-thumbs { gap: 8px; }
    .gallery-thumbs .thumb { width: 96px; height: 64px; border-radius: 6px; }
    .info-block { padding: 20px 16px; margin-bottom: 16px; }
    .info-block h4 { font-size: 1.08rem; margin-bottom: 14px; }
    .spec-table { font-size: .9rem; }
    .spec-table tr { display: flex; flex-wrap: wrap; }
    .spec-table th { flex: 0 0 42%; }
    .spec-table td { flex: 0 0 58%; }
    .spec-table th, .spec-table td { display: block; padding: .6rem .5rem; }
    .spec-table td { font-weight: 600; }
    .tag-list { gap: 8px; }
    .feature-tag, .highlight-tag { font-size: .82rem; padding: 5px 10px; }
    .promise-badge { font-size: .82rem; padding: 6px 12px; }
    .condition-grid { grid-template-columns: 1fr; gap: 10px; }
    .condition-item { padding: 12px 14px; }
    .condition-item h6 { font-size: .8rem; }
    .condition-item p { font-size: .9rem; line-height: 1.65; }
    .buy-card { padding: 20px 18px; }
    .buy-card h5 { font-size: 1.08rem; }
    .buy-price { font-size: 1.9rem; margin: 8px 0 4px; }
    .buy-specs li { font-size: .9rem; padding: 10px 0; }
}

/* ===== 超小屏 ===== */
@media (max-width: 359.98px) {
    .card-img-wrap { width: 34%; }
    .lang-option { padding: .26rem .5rem; font-size: .7rem; }
}

/* ===== 全站去除阴影（保留边框） ===== */
.card,
.vehicle-card,
.gallery,
.info-block,
.buy-card,
.condition-item,
.promise-badge,
.lang-switch,
.badge,
.table,
.table td,
.table th,
.btn,
.btn-accent,
.form-control {
    box-shadow: none !important;
}

/* ===== 维吾尔语字体与 RTL 适配 ===== */
html[lang="ug"] body,
html[lang="ug"] button,
html[lang="ug"] input,
html[lang="ug"] select,
html[lang="ug"] textarea {
    font-family: "UKIJ Tuz Tom", "ALKATIP Basma Tuz", "Microsoft Uyghur",
        "Noto Naskh Arabic", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
