/* ============================================
   基础框架 - 响应式主样式
   移动优先，100%响应式适配
   ============================================ */

/* CSS Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}
a { color: #333; text-decoration: none; transition: color .2s; }
a:hover { color: #e4393c; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; outline: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.4; }

/* 容器 */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 顶部 */
.site-header { background: #fff; border-bottom: 1px solid #eee; }
.header-top { display: flex; justify-content: space-between; align-items: center; height: 36px; font-size: 12px; color: #999; }
.header-right a { margin-left: 15px; color: #666; }
.header-right .btn-publish { background: #e4393c; color: #fff; padding: 4px 12px; border-radius: 3px; }
.header-right .btn-publish:hover { color: #fff; opacity: .9; }
.header-main { display: flex; align-items: center; padding: 15px 0; gap: 30px; }
.logo h1 { font-size: 24px; color: #e4393c; }
.search-box { flex: 1; max-width: 500px; }
.search-box form { display: flex; }
.search-box input { flex: 1; height: 38px; padding: 0 15px; border: 2px solid #e4393c; border-right: none; border-radius: 3px 0 0 3px; }
.search-box button { height: 38px; padding: 0 25px; background: #e4393c; color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; }

/* 主导航 */
.main-nav { background: #e4393c; }
.nav-list { display: flex; flex-wrap: wrap; }
.nav-list li a { display: block; padding: 12px 20px; color: #fff; font-size: 15px; }
.nav-list li a:hover, .nav-list li a.active { background: rgba(255,255,255,.15); }

/* 主内容 */
.site-main { padding: 20px 0; min-height: 500px; }

/* 面包屑 */
.breadcrumb { background: #fff; padding: 10px 15px; border-radius: 4px; margin-bottom: 15px; font-size: 13px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; }
.breadcrumb li { margin-right: 8px; }
.breadcrumb li::after { content: '>'; margin-left: 8px; color: #ccc; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb li.active { color: #999; }
.breadcrumb li a { color: #666; }

/* 卡片 */
.card { background: #fff; border-radius: 4px; padding: 20px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }

/* 列表 */
.list-item { display: flex; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.list-item:last-child { border-bottom: none; }
.list-item .item-title { flex: 1; }
.list-item .item-title a { font-size: 14px; }
.list-item .item-meta { color: #999; font-size: 12px; margin-top: 4px; }
.list-item .item-date { color: #bbb; font-size: 12px; white-space: nowrap; margin-left: 15px; }

/* 分类网格 */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.category-card { background: #fff; border-radius: 4px; padding: 15px; text-align: center; transition: box-shadow .2s; }
.category-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.category-card h3 { font-size: 15px; margin-bottom: 8px; }
.category-card .sub-cats { font-size: 12px; color: #999; }
.category-card .sub-cats a { margin: 0 4px; color: #666; }

/* 详情页 */
.detail-header { margin-bottom: 20px; }
.detail-header h1 { font-size: 22px; margin-bottom: 10px; }
.detail-meta { color: #999; font-size: 13px; display: flex; flex-wrap: wrap; gap: 15px; }
.detail-content { font-size: 15px; line-height: 1.8; }
.detail-content p { margin-bottom: 15px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; }
.pagination .current { background: #e4393c; color: #fff; border-color: #e4393c; }
.pagination a:hover { border-color: #e4393c; color: #e4393c; }

/* 表单 */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input[type="text"], .form-group input[type="password"],
.form-group input[type="email"], .form-group textarea, .form-group select {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 3px;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 3px; cursor: pointer; font-size: 14px; transition: opacity .2s; }
.btn-primary { background: #e4393c; color: #fff; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-default { background: #f0f0f0; color: #333; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 两栏布局 */
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 15px; }
.sidebar .card { padding: 15px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; background: #f5f5f5; color: #666; border-radius: 3px; font-size: 12px; margin-right: 5px; }
.tag-hot { background: #ffebee; color: #e4393c; }
.tag-new { background: #e8f5e9; color: #4caf50; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 15px; }

/* 页脚 */
.site-footer { background: #fff; border-top: 1px solid #eee; padding: 30px 0; margin-top: 30px; text-align: center; color: #999; font-size: 13px; }
.footer-links { margin-bottom: 15px; }
.footer-links a { margin: 0 10px; color: #666; }

/* AI生成按钮 */
.ai-generate-btn { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; padding: 6px 14px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.ai-generate-btn:hover { opacity: .9; color: #fff; }
.ai-generate-btn:disabled { opacity: .5; cursor: not-allowed; }
.ai-tip { background: #fff3cd; color: #856404; padding: 8px 12px; border-radius: 3px; font-size: 12px; margin-bottom: 10px; }

/* ============================================
   响应式适配
   ============================================ */

/* 平板 */
@media (max-width: 992px) {
    .container { max-width: 100%; }
    .two-col { grid-template-columns: 1fr; }
    .header-main { flex-wrap: wrap; }
    .search-box { max-width: 100%; order: 3; width: 100%; }
}

/* 手机 */
@media (max-width: 768px) {
    body { font-size: 13px; }
    .container { padding: 0 10px; }
    .header-top { display: none; }
    .header-main { padding: 10px 0; gap: 10px; }
    .logo h1 { font-size: 20px; }
    .search-box input { height: 34px; }
    .search-box button { height: 34px; padding: 0 15px; }
    .nav-list li a { padding: 10px 14px; font-size: 14px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card { padding: 15px; }
    .detail-header h1 { font-size: 18px; }
    .detail-content { font-size: 14px; }
    .list-item { flex-wrap: wrap; }
    .list-item .item-date { width: 100%; margin-left: 0; margin-top: 5px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .category-grid { grid-template-columns: 1fr; }
    .nav-list { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .nav-list li { flex-shrink: 0; }
}

/* ============================================
   512hw 分类信息 - 扩展样式
   ============================================ */

/* 登录注册 */
.auth-box { max-width: 420px; margin: 40px auto; }
.auth-card { background: #fff; border-radius: 6px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.auth-card h2 { text-align: center; margin-bottom: 25px; color: #333; }
.auth-links { display: flex; justify-content: space-between; margin-top: 15px; font-size: 13px; }
.auth-links a { color: #e4393c; }
.btn-block { width: 100%; padding: 10px; font-size: 15px; }

/* 会员中心 */
.member-center { display: grid; grid-template-columns: 200px 1fr; gap: 15px; }
.member-sidebar { background: #fff; border-radius: 4px; padding: 20px; height: fit-content; }
.member-info { text-align: center; padding-bottom: 15px; border-bottom: 1px solid #eee; margin-bottom: 15px; }
.member-info .avatar { width: 60px; height: 60px; border-radius: 50%; background: #e4393c; color: #fff; font-size: 24px; line-height: 60px; margin: 0 auto 10px; }
.member-info .username { font-size: 16px; font-weight: 600; }
.member-info .user-meta { font-size: 12px; color: #999; margin-top: 5px; }
.member-menu li a { display: block; padding: 10px 15px; border-radius: 4px; color: #666; }
.member-menu li a:hover, .member-menu li.active a { background: #fff0f0; color: #e4393c; }

/* 发布页 */
.publish-page { max-width: 800px; margin: 0 auto; }
.publish-page textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 3px; font-family: inherit; }
.ai-gen-btn { position: absolute; top: 8px; right: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-actions { margin-top: 20px; }
.required { color: #e4393c; }

/* 搜索页 */
.search-form-lg { display: flex; gap: 10px; margin-bottom: 10px; }
.search-input-lg { flex: 1; height: 42px; padding: 0 15px; border: 2px solid #e4393c; border-radius: 3px; font-size: 15px; }
.hot-search { font-size: 13px; color: #999; }
.hot-search a { margin: 0 8px; color: #666; }
.price-tag { color: #e4393c; font-weight: 600; margin-left: 10px; }
.item-desc { color: #666; font-size: 13px; margin: 5px 0; line-height: 1.5; }
.page-num { display: inline-block; padding: 5px 10px; border: 1px solid #ddd; border-radius: 3px; margin: 0 3px; font-size: 13px; }
.page-num.active { background: #e4393c; color: #fff; border-color: #e4393c; }

/* 资讯 */
.news-item .item-title a { font-size: 15px; }
.article-title { font-size: 24px; margin-bottom: 15px; line-height: 1.4; }
.article-meta { color: #999; font-size: 13px; padding-bottom: 15px; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.article-meta span { margin-right: 15px; }
.article-content { font-size: 15px; line-height: 1.8; }
.article-content p { margin-bottom: 15px; }
.article-content img { max-width: 100%; border-radius: 4px; }

/* 信息详情联系卡片 */
.contact-card { background: #fff8f8; border: 1px solid #ffd6d6; border-radius: 4px; padding: 15px; margin: 15px 0; }
.contact-card .contact-row { display: flex; padding: 5px 0; font-size: 14px; }
.contact-card .contact-label { width: 80px; color: #999; }
.contact-card .contact-value { color: #333; font-weight: 500; }

/* 响应式补充 */
@media (max-width: 768px) {
    .member-center { grid-template-columns: 1fr; }
    .member-sidebar { display: flex; align-items: center; gap: 15px; }
    .member-info { border-bottom: none; padding-bottom: 0; margin-bottom: 0; text-align: left; }
    .member-menu { display: flex; gap: 5px; flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
    .auth-box { margin: 20px auto; padding: 0 15px; }
}

/* 首页大分类 */
.category-hero .category-grid-lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.category-card-lg { text-align: left; padding: 12px 15px; border: 1px solid #f0f0f0; }
.category-card-lg h3 { font-size: 15px; margin-bottom: 8px; color: #e4393c; }
.category-card-lg .sub-cats a { display: inline-block; margin: 2px 6px 2px 0; font-size: 12px; color: #666; }
.category-card-lg .sub-cats a:hover { color: #e4393c; }
