/* =========================================
   1. 全局基础变量与重置 (从 index.html 完整复制)
   ========================================= */
:root {
    --primary-color: #0066cc;
    --secondary-color: #ff9900;
    --bg-color: #f5f7fa;
    --white: #ffffff;
    --text-main: #333;
    --text-sub: #666;
    --border-color: #eee;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =========================================
   2. 头部 Header
   ========================================= */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    height: 40px;
    margin-right: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo img {
    height: 100%;
    width: auto;
    display: block;
}

.search-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 20px;
}

.search-box {
    flex-grow: 1;
    background: var(--bg-color);
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    border: 1px solid transparent;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.search-box input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    padding-left: 10px;
    border-left: 1px solid #ddd;
    white-space: nowrap;
}

.btn-publish {
    background-color: var(--secondary-color);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    margin-left: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(255, 153, 0, 0.3);
    display: flex;
    align-items: center;
}

.btn-publish:hover {
    background-color: #e68a00;
    transform: translateY(-1px);
}

.auth-box {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-sub);
    white-space: nowrap;
}

.auth-box a {
    margin: 0 5px;
    padding: 5px 10px;
}

.auth-box .btn-reg {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
}

.auth-box .btn-reg:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
}

.user-menu-btn:hover {
    background: var(--bg-color);
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 200;
    overflow: hidden;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
    .user-menu:hover .user-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0s;
    }
}

.user-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 18px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: var(--text-main);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

/* =========================================
   2.2 导航栏
   ========================================= */
.header-nav-bar {
    background: var(--white);
}

.nav-inner {
    display: flex;
    height: 48px;
    align-items: center;
}

.nav-item {
    font-size: 16px;
    color: #333;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: bold;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* =========================================
   3. 筛选区域
   ========================================= */
.filter-section {
    background: var(--white);
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    line-height: 28px;
    flex-shrink: 0;
    margin-right: 5px;
}

.filter-item {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    text-decoration: none;
}

.filter-item:hover {
    color: var(--primary-color);
}

.filter-item.active {
    background: #e6f0fa;
    color: var(--primary-color);
    font-weight: bold;
}

/* =========================================
   4. 列表与卡片
   ========================================= */
.list-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: #ddd;
}

.card-header {
    margin-bottom: 10px;
}

.card-tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    vertical-align: text-bottom;
    margin-right: 5px;
}

.card-tag.supply {
    background-color: var(--primary-color);
}

.card-tag.demand {
    background-color: var(--secondary-color);
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 11px;
    padding: 3px 8px;
    font-weight: 500;
    color: #fff;
    border-radius: 0 8px 0 8px;
}

.card-badge.top {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-badge.rec {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
}

.card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding-top: 12px;
    border-top: 1px dashed #eee;
}

.meta-user {
    display: flex;
    align-items: center;
    color: #555;
    font-weight: 500;
    max-width: 55%;
}

.user-avatar-xs {
    width: 20px;
    height: 20px;
    background: #e6f0fa;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    flex-shrink: 0;
}

.user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-data {
    color: #999;
    display: flex;
    gap: 8px;
}

.meta-views {
    display: none;
}

/* Main Content Box (detail page style) */
.main-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* =========================================
   5. 分页
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 60px;
    gap: 8px;
    flex-wrap: wrap;
}

.page-item {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    min-width: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
}

.page-item:hover:not(.disabled):not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: bold;
}

.page-item.disabled {
    color: #ccc;
    background: #f9f9f9;
    cursor: not-allowed;
    border-color: #eee;
}

.page-dots {
    color: #999;
    letter-spacing: 2px;
    margin: 0 5px;
}

/* =========================================
   6. 登录注册表单样式
   ========================================= */
.auth-page {
    padding: 40px 0 60px;
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.auth-card.wide {
    max-width: 520px;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0052a3 100%);
    color: #fff;
    padding: 30px 30px 25px;
    text-align: center;
}

.auth-card-header h1 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 8px;
}

.auth-card-header p {
    font-size: 14px;
    opacity: 0.9;
}

.auth-card-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-submit:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

/* 通用按钮样式 */
.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #0052a3;
    color: #fff;
}

.btn-secondary {
    display: inline-block;
    background: #f1f5f9;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #333;
}

.btn-danger {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

.auth-footer {
    text-align: center;
    padding: 20px 30px 25px;
    background: #fafbfc;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* =========================================
   7. 页脚
   ========================================= */
footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 30px 0;
    margin-top: 40px;
}

footer .container {
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    margin: 0 15px;
    color: #666;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary-color);
}

footer .copyright {
    color: #999;
    font-size: 13px;
}

/* =========================================
   8. 响应式适配
   ========================================= */
@media (max-width: 992px) {
    .list-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .meta-views {
        display: inline;
    }

    .search-group {
        margin: 0 15px;
    }
}

@media (max-width: 768px) {
    .header-top {
        padding: 10px 0;
        border-bottom: none;
    }

    .logo {
        order: 1;
    }

    .auth-box {
        order: 2;
        margin-left: auto;
    }

    .user-menu {
        order: 2;
        margin-left: auto;
    }

    .search-group {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 10px 0 0 0;
    }

    .search-box {
        width: auto;
    }

    .header-nav-bar {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid #f0f0f0;
    }

    .nav-inner {
        width: auto;
        padding: 0 10px;
        height: 44px;
    }

    .nav-item {
        padding: 0 12px;
        font-size: 15px;
        flex-shrink: 0;
    }

    .list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card {
        padding: 15px;
    }

    .card-desc {
        -webkit-line-clamp: 2;
    }

    .meta-views {
        display: none;
    }

    .filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 5px;
        align-items: center;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    .filter-item {
        white-space: nowrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-page {
        padding: 20px 15px 40px;
    }

    .auth-card {
        border-radius: 8px;
    }

    .auth-card-header {
        padding: 25px 20px 20px;
    }

    .auth-card-body {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .list-grid {
        grid-template-columns: 1fr;
    }

    .meta-views {
        display: inline;
    }

    .page-item {
        padding: 0 8px;
        font-size: 12px;
        height: 32px;
        min-width: 32px;
    }
}

/* =========================================
   9. 用户中心布局
   ========================================= */
.user-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    margin: 30px auto;
}

/* 侧边栏 */
.sidebar {
    background: var(--white);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.user-card {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.user-avatar-lg {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.user-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.user-card p {
    font-size: 13px;
    color: #999;
}

.user-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: #999;
}

/* 用户中心统计卡片 */
.user-stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.user-stat-card {
    border-radius: 10px;
    padding: 22px;
    color: #fff;
}

.user-stat-card.primary {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
}

.user-stat-card.secondary {
    background: linear-gradient(135deg, #f0a54b 0%, #e8912d 100%);
}

.user-stat-card .label {
    font-size: 13px;
    opacity: 0.9;
}

.user-stat-card .value {
    font-size: 32px;
    font-weight: bold;
    margin-top: 8px;
}

.side-menu {
    list-style: none;
}

.side-menu li {
    margin-bottom: 5px;
}

.side-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 6px;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
}

.side-menu a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.side-menu a.active {
    background: #e6f0fa;
    color: var(--primary-color);
    font-weight: 500;
}

.side-menu .icon {
    margin-right: 10px;
    font-size: 16px;
}

/* 主内容区 */
.user-main-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 500px;
}

.content-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

.data-table td {
    font-size: 14px;
}

.data-table tr:hover td {
    background: #fafbfc;
}

.data-table .actions a {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 13px;
}

.data-table .actions a.delete {
    color: #e74c3c;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 300;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* 用户中心响应式 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .user-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 200;
        border-radius: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .user-main-content {
        min-height: auto;
    }

    /* 移动端表格改为卡片式布局 */
    .data-table {
        border: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .data-table tr {
        display: block;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 15px;
        border: 1px solid #eee;
    }

    .data-table tr:hover td {
        background: transparent;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px dashed #e0e0e0;
        font-size: 14px;
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
        margin-top: 5px;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #666;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .data-table .actions {
        justify-content: flex-end;
    }

    .data-table .actions::before {
        display: none;
    }
}

/* =========================================
   Auth Form Styles (Login/Register)
   ========================================= */
.auth-form-wrapper {
    max-width: 450px;
    margin: 0 auto;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.auth-form-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.auth-form-header p {
    font-size: 14px;
    color: #888;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.auth-form .form-group label .required {
    color: #e74c3c;
}

.auth-form .form-group input,
.auth-form .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.auth-form .form-group input:focus,
.auth-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.auth-form .btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.auth-form .btn-submit:hover {
    background: #0052a3;
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.auth-links a {
    color: var(--primary-color);
    font-weight: 500;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* =========================================
   Post Form Styles
   ========================================= */
.post-form-card {
    background: var(--white);
    max-width: 600px;
    margin: 0 auto;
}

.post-form-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.post-form .form-group {
    margin-bottom: 20px;
}

.post-form .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.post-form .form-group input,
.post-form .form-group select,
.post-form .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.post-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Global form-row-3 for any form */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.post-form .form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.post-form .radio-group {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.post-form .radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
}

.post-form .radio-group input {
    width: auto;
}

.post-form .btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.post-form .btn-submit:hover {
    background: #0056b3;
}

/* File upload button style */
.file-upload-btn {
    display: inline-block;
    padding: 8px 16px;
    cursor: pointer;
}

.file-upload-btn input[type="file"] {
    display: none;
}

.file-upload-btn span {
    pointer-events: none;
}

.post-form .error-msg {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.post-form .tips {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.post-form .file-input {
    border: 2px dashed #ddd;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
}

.post-form .file-input:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.post-form .file-input input {
    display: none;
}

@media (max-width: 768px) {

    .post-form .form-row,
    .post-form .form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Search Filter Styles
   ========================================= */
.search-filter-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.phone-error {
    color: #c00;
    display: none;
}

.image-preview {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.page-spacing {
    padding-top: 30px;
    padding-bottom: 60px;
}

/* =========================================
   Detail Page Styles
   ========================================= */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: #888;
}

.breadcrumb span {
    margin: 0 5px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 40px;
}

.info-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.info-title {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-bottom: 15px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
}

.badge {
    display: inline-block;
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    margin-right: 10px;
    transform: translateY(3px);
    flex-shrink: 0;
}

.badge.supply {
    background-color: var(--primary-color);
}

.badge.demand {
    background-color: var(--secondary-color);
}

.info-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-left span {
    margin-right: 20px;
}

.meta-actions {
    display: flex;
    gap: 15px;
}

.action-link {
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    background: none;
    border: none;
    font-size: 13px;
    padding: 0;
}

.action-link:hover {
    color: var(--primary-color);
}

.action-link.favorited {
    color: #f39c12;
}

.action-link.report:hover {
    color: #e02020;
}

.safety-tip {
    background-color: #fff8e6;
    border: 1px solid #ffebc2;
    color: #b97609;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.safety-icon {
    margin-right: 8px;
    font-size: 16px;
}

.contact-box {
    background: #f0f6ff;
    border: 1px solid #dce9f9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.contact-locked {
    text-align: center;
    padding: 10px;
}

.contact-locked p {
    margin-bottom: 15px;
    color: #666;
}

.btn-pay {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.btn-pay:hover {
    background: #0056b3;
}

.contact-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.contact-row:last-child {
    margin-bottom: 0;
}

.c-label {
    color: #666;
    width: 80px;
    font-weight: bold;
}

.c-value {
    color: #333;
    font-weight: 500;
}

.c-value.phone {
    color: #e02020;
    font-weight: bold;
    font-size: 20px;
}

.pics-box {
    margin-bottom: 20px;
}

.pics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pics-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.info-body {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    min-height: 100px;
    white-space: pre-wrap;
}

.comment-section {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.comment-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.comment-form {
    margin-bottom: 30px;
}

.c-textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.c-textarea:focus {
    border-color: var(--primary-color);
}

.c-btn-wrapper {
    text-align: right;
    margin-top: 10px;
}

.c-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.comment-list {
    list-style: none;
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    gap: 15px;
}

.c-avatar {
    width: 40px;
    height: 40px;
    background: #f0f2f5;
    border-radius: 50%;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.c-content-box {
    flex-grow: 1;
}

.c-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.c-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.c-time {
    font-size: 12px;
    color: #999;
}

.c-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.sidebar,
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-sidebar .side-box {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.side-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.user-profile {
    text-align: center;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.user-nm,
.user-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.user-stats {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #eee;
    padding-top: 15px;
    font-size: 12px;
    color: #666;
}

.stat-num {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
    line-height: 1.4;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    display: block;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-list a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.list-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.modal-close {
    float: right;
    cursor: pointer;
    font-size: 20px;
    color: #999;
}

@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .info-title {
        font-size: 20px;
    }

    .pics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   Search Page Styles
   ========================================= */
.highlight {
    color: #e02020;
    font-style: normal;
    font-weight: 500;
}

.search-tool-bar {
    margin: 20px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
    gap: 10px;
}

.search-keyword {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 4px;
}

.search-count {
    font-weight: bold;
    color: #333;
    margin: 0 2px;
}

.empty-result {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
}

.empty-result p {
    color: #999;
    font-size: 16px;
    margin-bottom: 15px;
}

.empty-result a {
    color: var(--primary-color);
}

/* =========================================
   User Pic Item Styles
   ========================================= */
.pic-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.pic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.pic-item .pic-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
}

.pic-item .pic-delete:hover {
    background: #cc0000;
}

/* =========================================
   Footer Styles
   ========================================= */
footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 30px 0;
    margin-top: 40px;
}

footer .container {
    text-align: center;
}

footer .footer-links {
    margin-bottom: 15px;
}

footer .footer-links a {
    margin: 0 15px;
    color: #666;
    font-size: 14px;
}

footer .copyright {
    color: #999;
    font-size: 13px;
}

/* =========================================
   自定义弹窗样式
   ========================================= */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.custom-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.custom-modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: calc(100% - 40px);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.custom-modal-content {
    padding: 30px 25px 20px;
    text-align: center;
}

.custom-modal-icon {
    margin-bottom: 15px;
}

.custom-modal-icon svg {
    width: 48px;
    height: 48px;
}

.custom-modal-message {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    word-break: break-word;
}

.custom-modal-buttons {
    display: flex;
    border-top: 1px solid #eee;
}

.custom-modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-modal-btn:hover {
    background: #f5f5f5;
}

.custom-modal-btn.primary {
    color: #0066cc;
    font-weight: 500;
}

.custom-modal-btn.secondary {
    color: #666;
    border-right: 1px solid #eee;
}

.custom-modal-btn:only-child {
    border-radius: 0 0 12px 12px;
}

.custom-modal-btn:first-child:not(:only-child) {
    border-radius: 0 0 0 12px;
}

.custom-modal-btn:last-child:not(:only-child) {
    border-radius: 0 0 12px 0;
}

/* 手机端适配 */
@media (max-width: 480px) {
    .custom-modal-container {
        width: calc(100% - 30px);
        max-width: none;
    }
    
    .custom-modal-content {
        padding: 25px 20px 15px;
    }
    
    .custom-modal-message {
        font-size: 14px;
    }
    
    .custom-modal-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* =========================================
   卡密充值页面
   ========================================= */
.recharge-tips {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 30px;
}

.recharge-tips h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-main);
}

.recharge-tips ul {
    margin: 0;
    padding-left: 20px;
}

.recharge-tips li {
    color: var(--text-sub);
    font-size: 13px;
    line-height: 2;
}

/* 卡密充值表单内联布局 */
.form-group-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group-inline label {
    flex-shrink: 0;
    width: 80px;
    font-weight: 500;
    color: var(--text-main);
}

.form-group-inline input {
    flex: 1;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group-inline input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group-inline input:disabled {
    background: #f5f5f5;
    font-weight: bold;
    color: #333;
}

@media (max-width: 768px) {
    .form-group-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .form-group-inline label {
        width: auto;
    }
    
    .form-group-inline input {
        max-width: none;
    }
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    border-radius: var(--radius);
    padding: 40px 30px;
    margin-bottom: 25px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.profile-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.profile-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 25px;
}
.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.profile-info h1 {
    font-size: 24px;
    margin: 0 0 8px 0;
    font-weight: 600;
}
.profile-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}
.profile-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}
.content-box {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    align-self: start;
}
.content-box:last-child {
    min-height: 300px;
}
.content-box-title {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-box-body {
    padding: 20px;
}
.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}
.contact-item:last-child {
    border-bottom: none;
}
.contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
}
.contact-icon.phone { background: #e8f5e9; }
.contact-icon.wx { background: #e3f2fd; }
.contact-icon.email { background: #fff3e0; }
.contact-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 2px;
}
.contact-value {
    font-weight: 500;
    color: var(--text-main);
}
.contact-locked-box {
    text-align: center;
    padding: 30px 20px;
}
.contact-locked-box .icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.contact-locked-box p {
    color: #666;
    margin: 0 0 8px 0;
}
.contact-locked-box .sub {
    font-size: 12px;
    color: #999;
}
.post-list {
    display: flex;
    flex-direction: column;
}
.post-item {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.post-item:last-child {
    border-bottom: none;
}
.post-item:hover {
    background: #fafafa;
}
.post-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}
.post-content {
    flex: 1;
    min-width: 0;
}
.post-title {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-cat {
    font-size: 12px;
    color: #999;
}
.post-right {
    text-align: right;
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
}
.post-right .time {
    margin-bottom: 4px;
}
.post-right .views {
    color: #bbb;
}
.empty-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-posts .icon {
    font-size: 48px;
    margin-bottom: 15px;
}
@media (max-width: 900px) {
    .profile-header {
        padding: 25px 20px;
        margin-bottom: 15px;
    }
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .profile-content {
        flex-direction: column;
        text-align: center;
    }
    .profile-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    .post-item a {
        flex-direction: column;
        gap: 8px;
    }
    .post-cat {
        display: none;
    }
    .post-right {
        text-align: left;
        display: flex;
        gap: 15px;
    }
    .post-right .time,
    .post-right .views {
        margin: 0;
    }
    .post-right::before {
        content: attr(data-cat);
        color: #999;
    }
}