/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
}

/* 动态背景 */
body {
    background: linear-gradient(135deg, #2d1354, #5a2a84, #8c52ff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #e0e0ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 科技感背景图案 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/tech_background.svg'),
                      radial-gradient(circle at 25px 25px, rgba(157, 78, 221, 0.2) 2px, transparent 0),
                      radial-gradient(circle at 75px 75px, rgba(123, 44, 191, 0.15) 2px, transparent 0);
    background-size: cover, 100px 100px, 150px 150px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: -1;
    animation: floatBackground 60s linear infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 背景装饰元素 */
.bg-decor {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    z-index: -1;
}

.decor-1 {
    width: 500px;
    height: 500px;
    background: #9D4EDD;
    top: -250px;
    right: -250px;
    animation: float 15s ease-in-out infinite;
}

.decor-2 {
    width: 400px;
    height: 400px;
    background: #7B2CBF;
    bottom: -200px;
    left: -200px;
    animation: float 12s ease-in-out infinite reverse;
}

.decor-3 {
    width: 300px;
    height: 300px;
    background: #5A189A;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

@keyframes floatBackground {
    0% {
        background-position: center, 0 0, 0 0;
    }
    25% {
        background-position: center, 10px 10px, 15px 15px;
    }
    50% {
        background-position: center, 0 20px, 0 30px;
    }
    75% {
        background-position: center, -10px 10px, -15px 15px;
    }
    100% {
        background-position: center, 0 0, 0 0;
    }
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e0e0ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.btn-action {
    background-color: #b19cd9;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(177, 156, 217, 0.4);
}

.btn-action:hover {
    background-color: #9D4EDD;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
}

.btn-logout {
    background-color: #ff6b6b;
}

.btn-logout:hover {
    background-color: #ff4949;
}

/* 大按钮样式 */
.btn-large {
    background-color: #b19cd9;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(177, 156, 217, 0.5);
    display: inline-block;
}

.btn-large:hover {
    background-color: #9D4EDD;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(157, 78, 221, 0.7);
}

.user-actions {
    display: flex;
    gap: 15px;
}

/* 容器样式 - 全屏 */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem;
    background: rgba(10, 25, 41, 0.1);
    backdrop-filter: blur(12px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #9D4EDD, #7B2CBF, #5A189A);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.hero {
    margin-bottom: 5rem;
}

/* 搜索栏样式 */
.search-bar {
    margin-bottom: 3rem;
    position: relative;
}

.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #7B61FF;
    font-size: 1.2rem;
}

#stateSearch {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border: none;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    color: #e0e0ff;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(123, 97, 255, 0.2);
}

#stateSearch:focus {
    outline: none;
    box-shadow: 0 0 25px rgba(255, 122, 0, 0.4);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 122, 0, 0.4);
}

#stateSearch::placeholder {
    color: rgba(224, 224, 255, 0.4);
}

/* 广告发布页面样式 */
.post-ad-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
    flex-grow: 1;
}

.post-ad-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(123, 97, 255, 0.15);
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 100%;
}

.post-ad-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #e0e0ff;
    text-align: center;
    background: linear-gradient(90deg, #9D4EDD, #7B2CBF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #b8c6db;
}

.required {
    color: #ff6b6b;
}

.form-control-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 15px;
    color: #7B61FF;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0ff;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(123, 97, 255, 0.2);
}

/* 下拉菜单样式 */
select.form-control {
    background: rgba(255, 255, 255, 0.05);
    /* 确保下拉选项也使用相同背景 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 添加自定义箭头图标 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B61FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* 下拉选项样式 */
select.form-control option {
    background: rgba(0, 0, 0, 0.8);
    color: #e0e0ff;
    border: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.3);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(157, 78, 221, 0.5);
}

.form-control::placeholder {
    color: rgba(224, 224, 255, 0.4);
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: rgba(224, 224, 255, 0.6);
}

.file-input {
    padding-left: 15px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.add-image-btn {
    margin-left: 10px;
    padding: 8px 15px;
    background-color: rgba(123, 97, 255, 0.2);
    border: 1px solid rgba(123, 97, 255, 0.3);
}

.add-image-btn:hover {
    background-color: rgba(123, 97, 255, 0.4);
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-secondary {
    background-color: rgba(123, 97, 255, 0.2);
    border: 1px solid rgba(123, 97, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(123, 97, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.3);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.image-upload-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.image-upload-container .form-control-wrapper {
    margin-bottom: 10px;
}

/* 图片预览样式 */
#imagePreview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(123, 97, 255, 0.2);
    width: 100%;
    overflow-x: auto;
    min-height: 270px;
}

.preview-item {
    position: relative;
    height: 216px;
    flex: 0 0 auto;
}

.preview-img {
    height: 100%;
    max-width: 360px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(123, 97, 255, 0.3);
    transition: all 0.3s ease;
}

.preview-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
    border-color: rgba(157, 78, 221, 0.8);
}

/* 确保下拉菜单在各种状态下的样式一致性 */
select.form-control:focus {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.3);
    border-color: rgba(157, 78, 221, 0.5);
}

.delete-img-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
    transition: all 0.3s ease;
}

.delete-img-btn:hover {
    background-color: #ff4949;
    transform: scale(1.1);
}

/* 提示信息样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.alert-error {
    background-color: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ffcccc;
}

.alert-success {
    background-color: rgba(72, 187, 120, 0.2);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: #ccffcc;
    flex-direction: column;
    align-items: flex-start;
}

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

/* 州卡片样式 */
.states-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    flex-grow: 1;
}

.state-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(123, 97, 255, 0.15);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(5px);
}

.state-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #9D4EDD, #7B2CBF, #5A189A);
}

.state-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 122, 0, 0.3);
}

.state-card h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #e0e0ff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    font-weight: 600;
}

.cities-list {
    list-style-type: none;
}

.cities-list li {
    padding: 10px 0;
    color: #b8c6db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.cities-list li:hover {
    color: #FF7A00;
    transform: translateX(5px);
}

/* 页脚样式 */
footer.footer {
    text-align: center;
    margin-top: 1rem;
    padding: 15px 0;
    color: #FFFFFF;
    border-top: 1px solid rgba(157, 78, 221, 0.3);
    background-color: transparent;
    position: relative;
    z-index: 100;
    height: auto;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-logo i {
    margin-right: 0.5rem;
    color: #9c27b0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #9c27b0;
}

.footer-links i {
    margin-right: 0.5rem;
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 广告视图模式样式 */
.ads-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 标题模式 */
.ads-list.title-only-view {
    display: block;
}

.ads-list.title-only-view .ad-item {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ads-list.title-only-view .ad-image-container {
    display: none;
}

.ads-list.title-only-view .ad-content h3 {
    margin: 0;
    font-size: 1.2rem;
}

/* 列表模式 */
.ads-list.list-view {
    display: block;
}

.ads-list.list-view .ad-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ads-list.list-view .ad-image-container {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin-right: 15px;
}

/* 网格模式 */
.ads-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ads-list.grid-view .ad-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ads-list.grid-view .ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.ads-list.grid-view .ad-image-container {
    height: 180px;
}

.ads-list.grid-view .ad-content {
    padding: 15px;
}

/* 广告项公共样式 */
.ad-item {
    transition: all 0.3s ease;
}

.ad-image-container {
    position: relative;
    overflow: hidden;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-item:hover .ad-image {
    transform: scale(1.05);
}

.ad-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.3);
    font-size: 2rem;
}

.ad-content {
    color: #e0e0ff;
}

.ad-content h3 {
    margin-bottom: 10px;
}

.ad-content h3 a {
    color: #e0e0ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ad-content h3 a:hover {
    color: #9D4EDD;
}

.ad-description {
    font-size: 0.9rem;
    color: rgba(224, 224, 255, 0.7);
    margin: 0;
}

/* 视图控制按钮样式 */
.view-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.view-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(123, 97, 255, 0.2);
    color: #e0e0ff;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(157, 78, 221, 0.5);
}

.view-btn.active {
    background: rgba(157, 78, 221, 0.3);
    border-color: rgba(157, 78, 221, 0.7);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .state-card {
        width: calc(50% - 20px);
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        margin-top: 10px;
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .state-card {
        width: 100%;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .search-container {
        width: 100%;
    }
    
    .footer-content {
        padding: 10px;
    }
}