/* ============================================
   移动端主样式 - wangshifu.cn 分类信息
   纯CSS，Modern Mobile-First Design
   ============================================ */

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --accent: #3498db;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --border: #e8e8e8;
    --success: #27ae60;
    --warning: #f39c12;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    max-width: 100vw;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:active { opacity: .7; }
img { max-width: 100%; height: auto; }

/* ===== 顶部导航栏 ===== */
.m-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 48px;
    box-shadow: 0 2px 8px rgba(231,76,60,.3);
}
.m-header a { color: #fff; }
.m-header .logo {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.m-header .m-nav-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    cursor: pointer;
    font-size: 20px;
    border: none;
    color: #fff;
    transition: background .2s;
}
.m-header .m-nav-btn:active { background: rgba(255,255,255,.25); }

/* ===== 侧边导航 ===== */
.m-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.m-sidebar.open { transform: translateX(0); }
.m-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.4);
    z-index: 199;
    display: none;
}
.m-overlay.show { display: block; }
.m-sidebar .sidebar-head {
    background: var(--primary);
    color: #fff;
    padding: 20px 15px;
    font-size: 16px;
    font-weight: 700;
}
.m-sidebar .sidebar-nav {
    list-style: none;
    padding: 10px 0;
}
.m-sidebar .sidebar-nav li {
    border-bottom: 1px solid var(--border);
}
.m-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text);
    font-size: 15px;
    transition: background .2s;
}
.m-sidebar .sidebar-nav a:active { background: var(--bg); }
.m-sidebar .sidebar-nav .icon {
    width: 24px; text-align: center;
    margin-right: 12px;
    font-size: 18px;
}

/* ===== 搜索栏 ===== */
.m-search-bar {
    display: flex;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.m-search-bar input {
    flex: 1;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 20px 0 0 20px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
}
.m-search-bar input:focus { border-color: var(--primary-dark); }
.m-search-bar button {
    height: 40px;
    padding: 0 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 20px 20px 0;
    font-size: 14px;
    cursor: pointer;
}
.m-search-bar button:active { background: var(--primary-dark); }

/* ===== 分类标签 ===== */
.m-cats {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 8px;
    background: #fff;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}
.m-cats::-webkit-scrollbar { display: none; }
.m-cats a {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    white-space: nowrap;
    transition: all .2s;
}
.m-cats a.active, .m-cats a:active {
    background: var(--primary);
    color: #fff;
}

/* ===== 轮播图 ===== */
.m-banner {
    margin: 10px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.m-banner img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
}

/* ===== 统计栏 ===== */
.m-stats {
    display: flex;
    justify-content: space-around;
    padding: 14px 0;
    background: #fff;
    margin: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.m-stats .stat-item {
    text-align: center;
    flex: 1;
    border-right: 1px solid var(--border);
}
.m-stats .stat-item:last-child { border: none; }
.m-stats .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.m-stats .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 信息卡片 ===== */
.m-section {
    margin: 10px;
}
.m-section .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 8px;
    font-size: 17px;
    font-weight: 700;
}
.m-section .section-title .more {
    font-size: 13px;
    color: var(--text-muted);
}
.m-info-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.m-info-list .info-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.m-info-list .info-item:last-child { border: none; }
.m-info-list .info-item:active { background: var(--bg); }
.m-info-list .info-thumb {
    width: 70px; height: 55px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 12px;
    background: var(--bg);
}
.m-info-list .info-body {
    flex: 1;
    min-width: 0;
}
.m-info-list .info-title {
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.m-info-list .info-title .tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 4px;
    vertical-align: middle;
}
.m-info-list .tag-top { background: #ffe0e0; color: #c0392b; }
.m-info-list .tag-pro { background: #fff3cd; color: #856404; }
.m-info-list .info-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 8px;
}
.m-info-list .info-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 8px;
}

/* ===== 底部导航 ===== */
.m-tabbar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.05);
}
.m-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 4px;
    color: var(--text-muted);
    font-size: 11px;
    transition: color .2s;
}
.m-tabbar a .tab-icon {
    font-size: 22px;
    margin-bottom: 2px;
}
.m-tabbar a.active { color: var(--primary); }
.m-tabbar a.post-btn {
    color: #fff;
    position: relative;
}
.m-tabbar .post-btn .tab-icon {
    background: var(--primary);
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-top: -22px;
    box-shadow: 0 4px 12px rgba(231,76,60,.4);
}

/* ===== 信息详情页 ===== */
.m-detail {
    background: #fff;
    margin: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.m-detail .detail-header {
    padding: 18px 15px;
    border-bottom: 1px solid var(--border);
}
.m-detail h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}
.m-detail .detail-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.m-detail .detail-body {
    padding: 15px;
    font-size: 15px;
    line-height: 1.8;
    word-break: break-word;
}
.m-detail .detail-images {
    padding: 0 15px 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.m-detail .detail-images img {
    width: 100%;
    border-radius: 6px;
    aspect-ratio: 4/3;
    object-fit: cover;
}
.m-detail .detail-contact {
    padding: 15px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.m-detail .contact-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed var(--border);
}
.m-detail .contact-item:last-child { border: none; }
.m-detail .contact-label {
    width: 60px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 发布/登录表单 ===== */
.m-form {
    background: #fff;
    margin: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 15px;
}
.m-form .form-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}
.m-form .form-group {
    margin-bottom: 16px;
}
.m-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.m-form input[type="text"],
.m-form input[type="password"],
.m-form input[type="email"],
.m-form input[type="tel"],
.m-form select,
.m-form textarea {
    width: 100%;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
    font-family: var(--font);
    transition: border-color .2s;
    background: #fafafa;
}
.m-form textarea {
    height: 120px;
    padding: 12px;
    resize: vertical;
}
.m-form input:focus,
.m-form select:focus,
.m-form textarea:focus {
    border-color: var(--accent);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52,152,219,.1);
}
.m-form .btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 23px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: opacity .2s;
}
.m-form .btn:active { opacity: .85; }
.m-form .btn-primary { background: var(--primary); }
.m-form .btn-accent { background: var(--accent); }
.m-form .form-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 14px;
}
.m-form .form-hint a { color: var(--accent); font-weight: 500; }

/* ===== 分页 ===== */
.m-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
}
.m-pager a, .m-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    font-size: 14px;
    transition: all .2s;
}
.m-pager a {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.m-pager a:active { background: var(--primary); color: #fff; border-color: var(--primary); }
.m-pager .active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ===== 会员中心 ===== */
.m-member-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
}
.m-member-menu a {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    transition: transform .1s;
}
.m-member-menu a:active { transform: scale(.96); }
.m-member-menu .menu-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

/* ===== 消息提示页 ===== */
.m-msg-page {
    text-align: center;
    padding: 60px 20px;
}
.m-msg-page .msg-icon {
    font-size: 60px;
    margin-bottom: 20px;
}
.m-msg-page .msg-text {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}
.m-msg-page .btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* ===== 空状态 ===== */
.m-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.m-empty .empty-icon { font-size: 50px; margin-bottom: 12px; }

/* ===== 面包屑 ===== */
.m-crumb {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: #fff;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m-crumb a { color: var(--accent); }
.m-crumb span { margin: 0 4px; }

/* ===== 页脚 ===== */
.m-footer {
    text-align: center;
    padding: 20px 15px 80px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}
.m-footer a { color: var(--accent); }
