/* =========================================================
   蒲化回家平台（用户端）全局样式
   浅色主题 · 移动端优先 · 底部导航
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    color-scheme: light;

    /* 主色：暖金，用于强调关键动作 */
    --primary: #b3843c;
    --primary-dark: #96682a;
    --primary-soft: rgba(179, 132, 60, .10);

    --success: #16a34a;
    --danger: #d94848;

    --text: #23282f;
    --text-light: #7b8494;

    --border: #e6e8ee;
    --bg: #f6f7f9;
    --card: #ffffff;
    --card-2: #f8f9fb;

    --shadow: 0 6px 20px rgba(24, 39, 75, .06);

    --tabbar-h: 64px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg);
    /* 背景图：淡蒙层 + 山水图；使用 scroll 让图片随整个页面展开，长页也能看到完整画面 */
    background-image:
        radial-gradient(900px 460px at 12% -8%, rgba(179, 132, 60, .12), transparent 62%),
        linear-gradient(180deg, rgba(246, 247, 249, .62) 0%, rgba(246, 247, 249, .72) 55%, rgba(246, 247, 249, .82) 100%),
        url("/static/images/background.jpg");
    background-size: auto, auto, cover;
    background-position: center top, center top, center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 宽屏下把焦点移到山谷公路，避免只剩一片山脊 */
@media (min-width: 768px) {
    body { background-position: center top, center top, center 58%; }
}

a { color: var(--primary); text-decoration: none; }

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ------------------------- 顶部品牌栏 ------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #2c323b;
    white-space: nowrap;
}

.logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #d8b26a, #b3843c);
    box-shadow: 0 2px 10px rgba(179, 132, 60, .28);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-area .nickname {
    color: var(--text-light);
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-area a { color: var(--text-light); }
.user-area a:hover { color: var(--primary); }
.user-area a.btn-primary { color: #ffffff; }

main.container {
    padding-top: 18px;
    /* 底部导航占位交给 .footer 处理，这里只留常规间距 */
    padding-bottom: 10px;
    min-height: calc(100vh - 58px - var(--tabbar-h) - 96px);
}

/* ------------------------- 底部导航 ------------------------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(24, 39, 75, .05);
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
}

.tabbar-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 0 8px;
    color: #98a0ae;
    font-size: 11px;
    letter-spacing: .5px;
    transition: color .18s;
}

.tabbar-item svg {
    width: 22px;
    height: 22px;
    transition: transform .18s;
}

.tabbar-item:hover { color: #5f6875; }

.tabbar-item.active { color: var(--primary); }
.tabbar-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.tabbar-item.active svg {
    transform: translateY(-1px);
}

/* ------------------------- 按钮 ------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    transition: all .18s ease;
}

.btn:hover {
    border-color: rgba(179, 132, 60, .45);
    color: var(--primary-dark);
    background: #fdfaf4;
}

.btn-primary {
    background: linear-gradient(135deg, #cfa75f, #b3843c);
    border-color: rgba(179, 132, 60, .55);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(179, 132, 60, .22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d9b673, #a3762f);
    border-color: rgba(179, 132, 60, .75);
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(179, 132, 60, .30);
}

.btn-danger {
    background: #fff7f7;
    border-color: rgba(217, 72, 72, .28);
    color: #c53a3a;
}

.btn-danger:hover {
    background: #feecec;
    border-color: rgba(217, 72, 72, .55);
    color: #b02f2f;
}

.btn-block { display: flex; width: 100%; }

.btn:disabled {
    background: #f3f4f6;
    border-color: #e8eaef;
    color: #b4bac4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }

/* ------------------------- 提示信息 ------------------------- */
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fdf2f2;
    border: 1px solid #f6d7d7;
    color: #c53737;
}

.alert-success {
    background: #f0fbf4;
    border: 1px solid #cceddb;
    color: #15803d;
}

/* ------------------------- 页面标题 ------------------------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.page-head h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .5px;
}

.page-head p { color: var(--text-light); font-size: 13px; }

/* ------------------------- 页签切换 ------------------------- */
.tabs {
    display: flex;
    gap: 6px;
    background: #eef0f4;
    border: 1px solid var(--border);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 14px;
    transition: all .18s;
}

.tab-item:hover { color: #4d5563; }

.tab-item.active {
    background: #ffffff;
    color: var(--primary-dark);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(24, 39, 75, .08);
}

/* ------------------------- 搜索栏 ------------------------- */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar input {
    flex: 1;
    padding: 9px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all .18s;
}

.search-bar input::placeholder { color: #a8b0bc; }

.search-bar input:focus {
    border-color: rgba(179, 132, 60, .55);
    box-shadow: 0 0 0 3px rgba(179, 132, 60, .10);
}

/* 大厅搜索区：关键字 + 出发时间筛选 */
.search-panel { margin-bottom: 16px; }

.search-panel .search-bar { margin-bottom: 10px; }

.search-date {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.search-date .label {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 2px;
}

.search-date .chip {
    flex: 0 0 auto;
    padding: 5px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    transition: border-color .15s, background-color .15s, color .15s;
}

.search-date .chip:hover { border-color: rgba(179, 132, 60, .45); color: var(--primary-dark); }

.search-date .chip.active {
    border-color: rgba(179, 132, 60, .55);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.search-date input[type="date"] {
    flex: 0 0 auto;
    max-width: 165px;
    padding: 4px 10px;
    border: 1px dashed var(--border);
    border-radius: 999px;
    background: var(--card-2);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.search-date input[type="date"]:focus {
    border-style: solid;
    border-color: rgba(179, 132, 60, .55);
}

/* ------------------------- 行程卡片 ------------------------- */
.trip-list { display: flex; flex-direction: column; gap: 12px; }

.trip-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    transition: border-color .18s, transform .18s, box-shadow .18s;
}

.trip-card:hover {
    border-color: rgba(179, 132, 60, .32);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(24, 39, 75, .09);
}

.trip-route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.trip-route .arrow { color: var(--primary); font-weight: 400; }

.trip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 10px;
}

.trip-meta strong { color: var(--text); font-weight: 500; }

.trip-remark {
    background: #f8f9fb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    color: #5f6875;
    font-size: 13px;
    margin-bottom: 12px;
}

.trip-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.price { color: var(--primary); font-weight: 600; }

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 18px;
    border: 1px solid transparent;
}

.tag-open {
    background: rgba(179, 132, 60, .10);
    color: var(--primary-dark);
    border-color: rgba(179, 132, 60, .24);
}

.tag-full {
    background: #fff5ea;
    color: #c2711f;
    border-color: #f7ddc2;
}

.tag-cancel {
    background: #f2f4f7;
    color: #7b8494;
    border-color: #e3e6ec;
}

.tag-done {
    background: #f0fbf4;
    color: #15803d;
    border-color: #cdebd9;
}

/* ------------------------- 表单 ------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.form-item { margin-bottom: 18px; }

.form-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #3a4150;
}

.form-item label .required { color: var(--danger); margin-left: 2px; }

.form-item input,
.form-item textarea,
.form-item select {
    width: 100%;
    padding: 10px 12px;
    background: #fbfcfd;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all .18s;
}

.form-item input::placeholder,
.form-item textarea::placeholder { color: #a8b0bc; }

.form-item input:focus,
.form-item textarea:focus,
.form-item select:focus {
    border-color: rgba(179, 132, 60, .55);
    box-shadow: 0 0 0 3px rgba(179, 132, 60, .10);
    background: #ffffff;
}

.form-item textarea { resize: vertical; min-height: 80px; }

.form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-light);
}

.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ------------------------- 详情 ------------------------- */
.detail-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; letter-spacing: .5px; }

.detail-list { display: flex; flex-direction: column; gap: 10px; }

.detail-row {
    display: flex;
    gap: 12px;
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}

.detail-row .label { width: 84px; color: var(--text-light); flex-shrink: 0; }
.detail-row .value { flex: 1; word-break: break-all; }

/* ------------------------- 空状态 ------------------------- */
.empty {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
    box-shadow: var(--shadow);
}

.empty p { margin-bottom: 16px; }

/* ------------------------- 分页 ------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 13px;
}

/* ------------------------- 页脚 ------------------------- */
/* 底部导航是固定定位，页脚必须留出 tabbar 高度，否则内容变长时会被盖住 */
.footer {
    text-align: center;
    color: #8a93a1;
    font-size: 12px;
    padding: 18px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
    letter-spacing: .5px;
}

@media (max-width: 480px) {
    .topbar-inner { height: 54px; }
    .logo { font-size: 15px; }
    .user-area .nickname { display: none; }
    .detail-row .label { width: 70px; }
    .page-head h1 { font-size: 18px; }
    /* 移动端底部已有「发布」入口，隐藏页内的冗余发布按钮 */
    .hide-sm { display: none; }
}
