/* 需求发布页面专用样式 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 400px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
}

/* 顶部状态栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    font-size: 12px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.header-right span {
    margin-left: 15px;
    font-size: 16px;
}

/* App Bar */
.app-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 200px; /* 调整为200px，匹配广告轮播高度 */
}

.app-bar-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-text {
    display: flex;
    flex-direction: column;
}

.app-logo {
    font-size: 24px;
    color: #ffd700;
}

.app-title {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.app-subtitle {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.2;
}

.app-bar-right {
    display: flex;
    align-items: center;
}

.vip-button {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #8b6914;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    position: relative;
}

.vip-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* 需求头部样式 */
.demand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

.demand-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/* 筛选栏样式 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    background-color: #fff;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
    max-height: 100px;
    overflow-y: auto;
}

.filter-bar::-webkit-scrollbar {
    width: 4px;
}

.filter-bar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-bar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.filter-item {
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: fit-content;
    width: auto;
    /* 根据文字长度自适应宽度 */
    padding-left: calc(8px + 2px * var(--text-length, 0));
    padding-right: calc(8px + 2px * var(--text-length, 0));
}

.filter-item:hover {
    background-color: #e0e0e0;
}

.filter-item.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9a66 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* 需求列表样式 */
.demand-list {
    background-color: #fff;
    padding: 10px;
}

.demand-item {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.demand-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.demand-content {
    width: 100%;
}

.demand-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.demand-company {
    display: flex;
    align-items: center;
}

.company-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f0f0f0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-name {
    font-weight: bold;
    color: #333;
}

.demand-category {
    font-size: 12px;
    color: #ff6b35;
    background-color: #fff4ed;
    padding: 2px 8px;
    border-radius: 10px;
}

.demand-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.demand-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.demand-tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.demand-tag {
    padding: 4px 10px;
    background-color: #fff;
    border: 1px solid #ff6b35;
    border-radius: 15px;
    font-size: 12px;
    color: #ff6b35;
    margin-right: 8px;
    margin-bottom: 6px;
}

.demand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demand-time {
    font-size: 12px;
    color: #999;
}

.responses-count {
    font-size: 12px;
    color: #ff6b35;
    display: flex;
    align-items: center;
}

.responses-count i {
    margin-right: 4px;
}

/* 发布按钮样式 */
.publish-button {
    position: fixed;
    bottom: 60px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #ff9a66 100%);
    color: white;
    border: none;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.publish-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.publish-button:active {
    transform: scale(0.95);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding-top: 50px;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* 表单样式 */
.form-content {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff9a66 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 状态样式 */
.loading,
.error,
.empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.loading {
    color: #ff6b35;
}

.error {
    color: #f44336;
}

/* 查看详情按钮 */
.view-detail-btn {
    padding: 4px 12px;
    background-color: #ff6b35;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 5px;
    transition: background-color 0.2s ease;
}

.view-detail-btn:hover {
    background-color: #ff5a22;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .demand-item {
        flex-direction: column;
    }
    
    .demand-time {
        margin-left: 0;
        margin-top: 10px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* 底部导航栏样式 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #eee;
    background-color: #fff;
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 10px;
}

.bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

.bottom-nav .nav-item.active {
    color: #007bff;
}

/* 广告轮播样式 - 整合到App Bar中，按图片1200x400比例显示 */
.ad-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px; /* 调整为200px，匹配图片自动计算的高度 */
    overflow: hidden;
    z-index: 1;
}

.ad-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px; /* 调整为200px，匹配图片自动计算的高度 */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.ad-slide.active {
    opacity: 1;
}

.ad-slide img {
    width: 100%; /* 宽度占满容器 */
    height: auto; /* 高度自动，保持图片原始比例 */
    object-fit: contain; /* 保持图片比例，完整显示 */
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 15px 20px;
    text-align: left;
    z-index: 2;
}

.ad-indicators {
    position: absolute;
    bottom: 10px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}