/* ==========================================================
   中国合租专家网 - 前台样式
   ========================================================== */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-light: #eff6ff;
    --ink: #0f172a;
    --ink-2: #334155;
    --ink-3: #64748b;
    --line: #e2e8f0;
    --bg: #f6f8fb;
    --white: #fff;
    --ok: #16a34a;
    --warn: #f59e0b;
    --danger: #dc2626;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ---------- 顶部 ---------- */
.topbar {
    background: #0f172a;
    color: #cbd5e1;
    font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.topbar .sep { margin: 0 8px; color: #475569; }

header.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .container { display: flex; align-items: center; height: 72px; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); }
.logo .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 800;
}
.logo small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; letter-spacing: .5px; }

nav.main-nav { display: flex; gap: 4px; flex: 1; }
nav.main-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 15px;
    white-space: nowrap;
}
nav.main-nav a:hover { background: var(--brand-light); color: var(--brand); }
nav.main-nav a.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
    font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s;
    background: var(--brand); color: #fff; line-height: 1.4;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

/* ---------- 英雄区 ---------- */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    padding: 56px 0 64px;
}
.hero h1 { font-size: 34px; line-height: 1.35; margin: 0 0 14px; font-weight: 700; letter-spacing: -.5px; }
.hero p { color: #cbd5e1; font-size: 16px; margin: 0 0 28px; max-width: 620px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; }
.hero-search input {
    flex: 1; height: 46px; border-radius: 8px; border: none; padding: 0 16px; font-size: 15px;
}
.hero-search .btn { height: 46px; }
.hero-tags { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #94a3b8; }
.hero-tags span { background: rgba(255,255,255,.08); padding: 4px 12px; border-radius: 999px; }

/* ---------- 通用区块 ---------- */
section.block { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.section-head h2 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.3px; }
.section-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; }
.section-head .more { font-size: 14px; color: var(--ink-3); }
.section-head .more:hover { color: var(--brand); }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

/* ---------- 分类卡 ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.cate-card { padding: 20px; }
.cate-card h3 { margin: 0 0 6px; font-size: 17px; }
.cate-card .desc { color: var(--ink-3); font-size: 13px; min-height: 40px; }
.cate-card ul { list-style: none; margin: 14px 0 0; padding: 0; }
.cate-card li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.cate-card li a { color: var(--ink-2); }
.cate-card li a:hover { color: var(--brand); }
.cate-card li em { font-style: normal; color: var(--danger); font-weight: 600; }

/* ---------- 套餐表 ---------- */
.price-table { width: 100%; border-collapse: collapse; background: #fff; }
.price-table th, .price-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.price-table th { background: #f8fafc; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.price-table tr:hover td { background: #fbfdff; }
.price-table .price { color: var(--danger); font-weight: 700; font-size: 16px; }
.price-table .price small { font-weight: 400; font-size: 12px; color: var(--ink-3); }

/* ---------- 计划卡 ---------- */
.plan-card { display: flex; flex-direction: column; padding: 24px; position: relative; }
.plan-card.recommend { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.plan-card .badge-rec {
    position: absolute; top: -11px; right: 20px; background: var(--brand); color: #fff;
    font-size: 12px; padding: 2px 10px; border-radius: 999px;
}
.plan-card h4 { margin: 0 0 4px; font-size: 16px; }
.plan-card .amount { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -1px; margin: 8px 0 2px; }
.plan-card .amount small { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.plan-card ul { list-style: none; padding: 0; margin: 18px 0; flex: 1; }
.plan-card li { padding: 6px 0; font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; }
.plan-card li::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* ---------- 新闻 / FAQ ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.news-list li:last-child { border-bottom: none; }
.news-list a { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list a:hover { color: var(--brand); }
.news-list time { color: var(--ink-3); font-size: 13px; white-space: nowrap; }

.faq-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-item .q { font-weight: 600; display: flex; gap: 10px; }
.faq-item .q span {
    flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--brand-light);
    color: var(--brand); font-size: 12px; display: grid; place-items: center; font-weight: 700;
}
.faq-item .a { color: var(--ink-3); margin: 8px 0 0 32px; font-size: 14px; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); font-weight: 500; }
.form-control {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink);
    outline: none; transition: .15s;
}
textarea.form-control { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-tip { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.auth-wrap { max-width: 420px; margin: 56px auto; }
.auth-wrap .card-pad { padding: 32px; }
.auth-wrap h2 { margin: 0 0 6px; font-size: 22px; }
.auth-wrap .sub { color: var(--ink-3); font-size: 14px; margin: 0 0 24px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row img { height: 42px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.table th { background: #f8fafc; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.table tbody tr:hover { background: #fbfdff; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-warn { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: var(--brand-light); color: var(--brand); }

/* ---------- 面包屑 / 标题 ---------- */
.crumb { font-size: 13px; color: var(--ink-3); padding: 16px 0; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--brand); }
.page-title { font-size: 26px; margin: 0 0 8px; font-weight: 700; }
.page-sub { color: var(--ink-3); margin: 0 0 28px; }

/* ---------- 侧栏布局 ---------- */
.sidebar-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; padding: 28px 0 56px; }
.side-menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-menu .head { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.side-menu a { display: block; padding: 11px 18px; color: var(--ink-2); font-size: 14px; border-left: 3px solid transparent; }
.side-menu a:hover { background: #f8fafc; color: var(--brand); }
.side-menu a.active { background: var(--brand-light); color: var(--brand); border-left-color: var(--brand); font-weight: 500; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { padding: 18px 20px; }
.stat-card .label { color: var(--ink-3); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-info { background: var(--brand-light); color: #1e40af; }
.alert-warn { background: #fffbeb; color: #92400e; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-ok { background: #f0fdf4; color: #166534; }

/* ---------- 页脚 ---------- */
footer.site-footer { background: #0f172a; color: #94a3b8; padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
footer h5 { color: #fff; font-size: 14px; margin: 0 0 14px; font-weight: 600; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 9px; font-size: 13.5px; }
footer a { color: #94a3b8; }
footer a:hover { color: #fff; }
footer .about { font-size: 13.5px; line-height: 1.8; }
.footer-bottom {
    border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 20px;
    display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 8px;
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .icon { font-size: 40px; opacity: .35; margin-bottom: 10px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 34px; height: 34px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 7px; font-size: 13px; color: var(--ink-2); background: #fff;
}
.pagination .active span, .pagination li.active span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination li { list-style: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
    .grid-4, .grid-3, .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar-layout { grid-template-columns: 1fr; }
    nav.main-nav { display: none; }
    .hero h1 { font-size: 26px; }
}
@media (max-width: 620px) {
    .grid-4, .grid-3, .grid-2, .stat-grid { grid-template-columns: 1fr; }
    .site-header .container { height: 62px; }
    .hero { padding: 36px 0 44px; }
    .hero-search { flex-direction: column; }
    .hero-search .btn { width: 100%; }
}
