/* ==========================================
   统一样式 · 自由供求信息（前台+后台）
   包含原 style_index.css 和 style_panel.css 所有规则
   ========================================== */

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #F9F6F0;
    color: #2C2418;
    line-height: 1.5;
    font-size: 16px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: .2s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ========== 前台 Hero ========== */
.hero {
    background: linear-gradient(135deg, rgba(0,0,0,.6), rgba(0,0,0,.4)), url('https://images.pexels.com/photos/4483610/pexels-photo-4483610.jpeg?auto=compress&cs=tinysrgb&w=1600') center/cover no-repeat;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 700px;
    padding: 20px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: .95;
}

.hero .btn-hero {
    background: #fff;
    color: #2C2418;
    padding: 12px 32px;
    border-radius: 40px;
    font-weight: 600;
    display: inline-block;
}

.hero .btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,.2);
    background: #F0F4F9;
}

/* ========== 头部 / 导航 ========== */
.site-header {
    background: linear-gradient(135deg, #2C2418, #3E3124);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,245,235,.15);
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 4px 14px rgba(0,0,0,.05);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 20px;
    position: relative;
}

.logo {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -.3px;
    color: #F9F2E5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logo svg {
    width: 32px;
    height: 32px;
    stroke: #D9C7A7;
    stroke-width: 1.8;
    fill: none;
}

.hamburger {
    display: none;
}

.nav-wrapper {
    display: flex;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    font-size: .95rem;
    font-weight: 500;
    color: #F1E8DC;
    padding: 8px 0;
}

.nav-links a:hover {
    color: #E4C9A7;
}

.earn-plan-link {
    background: rgba(255,215,150,.2);
    border-radius: 30px;
    padding: 6px 16px !important;
    font-weight: 600;
}

/* ========== 按钮系统 ========== */
.btn, .btn-outline, .btn-sm, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s cubic-bezier(.2,0,0,1);
    border: 1px solid transparent;
    min-height: 44px;
}

.btn {
    background: #6B4C3A;
    color: #fff;
    padding: 10px 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

.btn:hover {
    background: #8B5A3C;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(107,76,58,.2);
}

.btn-outline {
    background: 0 0;
    border-color: #CBB99A;
    color: #3E2E22;
    padding: 10px 24px;
}

.btn-outline:hover {
    background: #EFE6DA;
    border-color: #A5835E;
    color: #5C3A26;
}

.btn-sm {
    padding: 6px 18px;
    font-size: .8rem;
    border-radius: 12px;
    min-height: 36px;
}

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

.btn-danger {
    background: #A55A4A;
}

.btn-danger:hover {
    background: #874234;
}

.btn-gray {
    background: #EDE3D6;
    color: #3E2E22;
    border-color: #DBCDBB;
}

.btn-gray:hover {
    background: #E1D3C2;
}

/* ========== 卡片样式 ========== */
.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.03), 0 0 0 1px rgba(0,0,0,.02);
    padding: 20px;
    margin: 20px 0;
    transition: all .25s ease;
}

.card:hover {
    box-shadow: 0 12px 24px -10px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.02);
}

/* ========== 后台专用组件 ========== */
.admin-login {
    max-width: 400px;
    margin: 80px auto;
}

.admin-login .login-footer {
    text-align: center;
    margin-top: 20px;
}

.admin-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav a {
    background: #E9DFD0;
    padding: 10px 20px;
    border-radius: 40px;
    color: #4F3A28;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.admin-nav a.active {
    background: #6B4C3A;
    color: white;
}

.admin-nav a.logout {
    background: #A55A4A;
    color: white;
}

.admin-nav a:hover {
    background: #DCCDBB;
}

.stats-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 16px 20px;
    border-radius: 20px;
    min-width: 140px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid #EFE3D6;
    font-weight: 500;
}

/* 后台信息卡片网格 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform 0.1s ease;
    border: 1px solid #EEE3D6;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

.item-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #F0E8DE;
    cursor: pointer;
}

.item-card .item-info {
    padding: 16px;
}

.item-card .item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2C2418;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.item-card .item-meta {
    font-size: 0.8rem;
    color: #8E7A64;
    margin-bottom: 8px;
}

.item-card .item-price {
    font-weight: 700;
    color: #8B5A3C;
    font-size: 1.2rem;
    margin: 10px 0;
}

.item-card .item-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 类型标签（通用） */
.type-badge, .item-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 30px;
    background: #E6F4EA;
    color: #2E6B3E;
}
.type-badge.buy, .item-type-badge.type-buy {
    background: #FFE8E0;
    color: #C25A2C;
}
.type-supply {
    background: #E6F4EA;
    color: #2E6B3E;
}

/* 个人中心两栏布局 */
.profile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 24px 0;
}
.profile-left {
    flex: 1.2;
    min-width: 260px;
}
.profile-right {
    flex: 2;
    min-width: 280px;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 800;
    color: #C0392B;
    background: #FEF3F2;
    padding: 12px 20px;
    border-radius: 20px;
    text-align: center;
    margin: 12px 0;
    letter-spacing: 2px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.02);
}

.referral-code-box {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.referral-code-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #DDD0BF;
    border-radius: 12px;
    font-family: monospace;
    background: #F9F4EC;
    font-size: 1rem;
}
.referral-link {
    font-size: 0.8rem;
    word-break: break-all;
    background: #F2EBE2;
    padding: 8px;
    border-radius: 12px;
}

/* 用户详情网格 */
.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    background: #FEFBF7;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #EFE3D8;
}
.info-item {
    font-size: 0.95rem;
}
.info-item strong {
    color: #3E2E22;
    display: inline-block;
    min-width: 80px;
}

/* 表单全局 */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #3E2E22;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #E6D9CC;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #A5835E;
    outline: none;
    box-shadow: 0 0 0 3px rgba(165,131,94,0.1);
}

/* 表格响应式 */
.table-responsive {
    overflow-x: auto;
    margin: 12px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    min-width: 600px;
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #E6D9CC;
    text-align: left;
    vertical-align: top;
}
th {
    background: #F9F4EC;
    font-weight: 600;
}

/* 消息提示 */
.msg {
    background: #F4ECE2;
    border-left: 5px solid #8B5A3C;
    border-radius: 16px;
    padding: 14px 20px;
    margin: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.msg.error {
    background: #FEE;
    color: #A33;
    border: 1px solid #F5C6C6;
}
.msg.success {
    background: #E6F7E6;
    color: #2A6630;
    border: 1px solid #B8D8B8;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 36px 0 50px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px 14px;
    border-radius: 14px;
    background: #F2EAE0;
    font-weight: 500;
}
.pagination .current {
    background: #6B4C3A;
    color: #fff;
}

/* 模态框（前台+后台统一） */
.modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-content {
    background: #FFFCF8;
    margin: auto;
    padding: 28px;
    border-radius: 28px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}
.modal-content textarea {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 1.5px solid #E6D9CC;
    margin: 16px 0;
    font-family: inherit;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}
.close, .close-modal {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #8E7A64;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.close:hover, .close-modal:hover {
    color: #A55A4A;
    background: rgba(0,0,0,0.05);
}

/* 赚钱计划专用模态框 */
.earn-modal-content {
    max-width: 560px;
    background: #FFFCF8;
}
.earn-rules h4 {
    font-size: 1.2rem;
    margin: 20px 0 12px;
    color: #6B4C3A;
}
.earn-rules ul {
    margin-left: 24px;
    list-style: disc;
    line-height: 1.7;
}
.earn-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

/* 图片预览网格 */
.image-preview-grid, .images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}
.preview-item {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #E4D6C8;
    background: #F9F4EC;
}
.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
}

/* 灯箱 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.94);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 20px;
}
.lightbox .close-btn,
.lightbox .nav-btn {
    position: absolute;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(8px);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox .close-btn {
    top: 20px;
    right: 24px;
    width: 48px;
    height: 48px;
    font-size: 40px;
}
.lightbox .nav-btn {
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    padding: 12px 20px;
}
.lightbox .prev-btn { left: 16px; }
.lightbox .next-btn { right: 16px; }

/* 其他辅助 */
.help-text {
    background: #F9F2E9;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    color: #5A4A38;
}
.footer-guide {
    background: #F4ECE2;
    border-radius: 32px;
    padding: 32px;
    margin: 60px 0 30px;
}
.disclaimer, .simple-disclaimer {
    background: #FFFFFFD9;
    padding: 20px;
    border-radius: 20px;
    border-left: 4px solid #8B5A3C;
    margin-top: 20px;
}
.simple-disclaimer {
    background: #F0E8DE;
    text-align: center;
    border-left: none;
}
.sort-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 16px 0 8px;
}
.sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    padding: 8px 20px;
    border-radius: 40px;
    background: #F2EBE2;
    color: #4F3A28;
    font-weight: 500;
    min-height: 40px;
}
.sort-link.active {
    background: #6B4C3A;
    color: #fff;
}
.search-box {
    display: flex;
    border: 1px solid #E2D6C8;
    border-radius: 16px;
    overflow: hidden;
    margin: 36px auto 28px;
    max-width: 640px;
    background: #fff;
}
.search-box input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    outline: 0;
}
.search-box button {
    border: none;
    background: #6B4C3A;
    color: #fff;
    padding: 0 28px;
    font-weight: 500;
    cursor: pointer;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px auto 24px;
    justify-content: center;
}
.tag {
    padding: 8px 22px;
    background: #fff;
    border: 1px solid #DDD0BF;
    border-radius: 40px;
    font-size: .85rem;
    font-weight: 500;
    min-height: 40px;
}
.tag:hover {
    background: #EBDBCB;
}

/* 响应式 */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hamburger { display: block !important; background: rgba(255,255,255,0.2); border: none; color: white; padding: 8px 16px; border-radius: 30px; font-size: 1rem; cursor: pointer; }
    .nav-wrapper {
        display: none;
        width: 100%;
        margin-top: 12px;
    }
    .nav-wrapper.open { display: block; }
    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .nav-links a {
        background: rgba(255,255,255,0.1);
        border-radius: 14px;
        text-align: center;
        padding: 12px;
        display: block;
    }
    .stats-grid { gap: 12px; }
    .stat-card { min-width: calc(50% - 12px); padding: 12px; }
    .items-grid { grid-template-columns: 1fr; }
    .modal-content { width: 95%; padding: 20px; }
    .profile-grid { flex-direction: column; }
    .result-item-layout { flex-direction: column; align-items: stretch; }
    .result-thumb { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 12px; }
    .hero h1 { font-size: 2rem; }
    .hero { min-height: 360px; }
}
@media (min-width: 769px) {
    .nav-wrapper { display: flex !important; }
    .hamburger { display: none !important; }
}