/* 基础样式 - 移动优先 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px !important; /* 确保根字体大小为 16px */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px !important; /* 确保 body 字体大小为 16px */
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏 */
.navbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: #be185d;
    transition: color 0.3s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: #9f1239;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.navbar-menu a {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s;
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: #be185d;
    background: #fdf2f8;
}

.navbar-divider {
    width: 1px;
    background: #eee;
    margin: 0.5rem 0;
}

.btn-register {
    background: #be185d !important;
    color: #fff !important;
}

.btn-register:hover {
    background: #9f1239 !important;
    color: #fff !important;
}

.btn-login {
    border: 1px solid #be185d !important;
    color: #be185d !important;
}

.btn-login:hover {
    background: #fdf2f8 !important;
}

/* 首页Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: #f8f9fa;
}

.hero-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.slogan-line {
    display: block;
    margin: 0.5rem 0;
}

.hero-cta {
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 0.5rem;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

/* 表单样式 */
.form-group {
    margin: 1rem 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    color: #666;
    font-size: 0.9rem;
}

/* 资料列表 */
.profile-list,
.profile-grid,
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.profile-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.profile-card h3 {
    margin: 1rem 0 0.5rem;
}

.profile-card h3 a {
    color: #333;
    text-decoration: none;
}

.profile-card h3 a:hover {
    color: #007bff;
}

.profile-meta {
    color: #666;
    font-size: 0.9rem;
}

.profile-bio {
    margin-top: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

/* 分页 */
.pagination {
    margin: 2rem 0;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination span {
    padding: 0.5rem 1rem;
}

/* 文章样式 */
.article-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-cover img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1rem;
}

.article-content h3 {
    margin: 0 0 0.5rem;
}

.article-content h3 a {
    color: #333;
    text-decoration: none;
}

.article-content h3 a:hover {
    color: #007bff;
}

.article-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.article-excerpt {
    color: #555;
    margin-top: 0.5rem;
}

/* 详情页 */
.profile-view,
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    margin-bottom: 2rem;
}

.profile-photos {
    margin: 2rem 0;
}

.profile-photos img {
    max-width: 100%;
    height: auto;
    margin: 0.5rem 0;
    border-radius: 8px;
}

.profile-details ul {
    list-style: none;
    padding: 0;
}

.profile-details li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

/* 响应式 */
@media (max-width: 767px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-inner {
        flex-wrap: wrap;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .city-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.5rem;
    }
    
    .city-link-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
    
    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
        gap: 0;
        background: #fff;
        border-top: 1px solid #eee;
        padding-top: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-menu li {
        width: 100%;
    }
    
    .navbar-menu a {
        padding: 0.875rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
        font-size: 0.95rem;
    }
    
    .navbar-menu a.btn-register,
    .navbar-menu a.btn-login {
        text-align: center;
        margin: 0.5rem 1rem;
        border-radius: 6px;
        border: none;
    }
    
    .navbar-menu a.btn-register {
        background: #be185d !important;
        color: #fff !important;
    }
    
    .navbar-menu a.btn-login {
        background: #fff !important;
        border: 1px solid #be185d !important;
        color: #be185d !important;
    }
    
    .navbar-divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
        background: #eee;
    }
}

@media (min-width: 768px) {
    .navbar-menu {
        margin-top: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        max-width: 500px;
    }
}

/* 静态页面样式 */
.page-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.page-content h1 {
    margin-bottom: 2rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 1rem;
}

.page-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.page-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.page-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.page-content li {
    margin: 0.5rem 0;
}

.contact-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.contact-info h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.contact-info h3:first-child {
    margin-top: 0;
}

.faq {
    margin-top: 2rem;
}

.faq h3 {
    color: #007bff;
    margin-top: 1.5rem;
}

.login-form,
.register-form,
.profile-form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 登录表单优化 */
#loginForm input[type="text"],
#loginForm input[type="password"] {
    transition: all 0.3s ease;
}

#loginForm input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(190, 24, 93, 0.1);
}

#loginBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 移动端优化 */
@media (max-width: 640px) {
    .max-w-md {
        margin: 0 auto;
        padding: 1rem;
    }
    
    #loginForm {
        padding: 0;
    }
    
    #loginForm input {
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
    
    /* 移动端容器优化 */
    .container {
        padding: 0 10px;
    }
    
    /* 移动端按钮优化 */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        width: 100%;
        margin: 0.25rem 0;
    }
    
    /* 移动端卡片优化 */
    .profile-card,
    .article-card {
        margin-bottom: 1rem;
    }
    
    /* 移动端表格优化 */
    .profile-details,
    .profile-view {
        padding: 1rem;
    }
    
    /* 移动端表单优化 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 0.75rem;
    }
    
    /* 移动端标题优化 */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增加点击目标大小 */
    .navbar-menu a,
    .btn,
    button,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移除 hover 效果，使用 active */
    .btn:hover {
        opacity: 1;
    }
    
    .btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* 首页城市链接样式 */
.city-link-inline {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0 0.2rem;
}

.city-link-inline:hover {
    color: #be185d;
    text-decoration: underline;
}

/* Footer 样式 */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    color: #666;
    font-size: 0.9rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-about {
    max-width: 400px;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.footer-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-links-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-link-primary {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-link-primary:hover {
    color: #be185d;
    text-decoration: underline;
}

.footer-cities {
    max-width: 400px;
}

.city-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.city-link-item {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.city-link-item:hover {
    color: #be185d;
    border-color: #be185d;
    background: #fdf2f8;
}

.footer-bottom {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.footer-copyright {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-icp {
    margin-bottom: 0.5rem;
}

.footer-icp a,
.footer-icp span {
    color: #999;
    text-decoration: none;
    margin: 0 0.5rem;
    font-size: 0.85rem;
}

.footer-icp a:hover {
    color: #be185d;
    text-decoration: underline;
}

.footer-copyright p {
    margin: 0.5rem 0 0;
    color: #999;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .city-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .city-links-grid a {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-links-primary {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-icp {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .footer-icp a,
    .footer-icp span {
        margin: 0;
    }
}

