/* ========================================
   Mobile Design System v2.0
   浪尖趋势研究所 - 统一移动端UI
   ======================================== */

/* === Design Tokens === */
:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --primary-rgb: 99, 102, 241;
    
    --accent: #10B981;
    --accent-dark: #059669;
    --accent-light: #34D399;
    
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    --info: #3B82F6;
    
    --bg-base: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;
    
    --border-light: #E2E8F0;
    --border-default: #CBD5E1;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    
    --font-xs: 11px;
    --font-sm: 13px;
    --font-base: 15px;
    --font-lg: 17px;
    --font-xl: 20px;
    --font-2xl: 24px;
    --font-3xl: 32px;
    
    --header-height: 56px;
    --tabbar-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0F172A;
        --bg-card: #1E293B;
        --bg-elevated: #334155;
        
        --text-primary: #F8FAFC;
        --text-secondary: #94A3B8;
        --text-tertiary: #64748B;
        
        --border-light: #334155;
        --border-default: #475569;
    }
}

/* === Base Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: var(--font-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-touch-callout: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: transparent;
}

button {
    cursor: pointer;
    -webkit-touch-callout: none;
}

/* === Header === */
.m-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: background 0.3s, box-shadow 0.3s;
}

.m-header.scrolled {
    box-shadow: var(--shadow-md);
}

.m-header-left {
    flex-shrink: 0;
}

.m-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.m-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: var(--font-sm);
}

.m-logo-img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.m-logo-text {
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.m-header-center {
    flex: 1;
    min-width: 0;
}

.m-search-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-base);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    color: var(--text-tertiary);
    overflow: hidden;
    transition: background 0.2s, box-shadow 0.2s;
}

.m-search-box:active {
    background: var(--border-light);
}

.m-search-box i {
    font-size: 12px;
    flex-shrink: 0;
}

.m-search-box span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-header-right {
    flex-shrink: 0;
}

.m-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-inverse);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-header-btn:active {
    transform: scale(0.95);
}

.m-header-avatar {
    display: block;
}

.m-header-avatar img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: transform 0.2s;
}

.m-header-avatar:active img {
    transform: scale(0.9);
}

/* === Search Modal === */
.m-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-base);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.m-search-modal.active {
    transform: translateY(0);
}

.m-search-modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    z-index: 10;
}

.m-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-base);
    border-radius: var(--radius-full);
}

.m-search-input-wrap input {
    flex: 1;
    font-size: var(--font-base);
    color: var(--text-primary);
}

.m-search-input-wrap input::placeholder {
    color: var(--text-tertiary);
}

.m-search-input-wrap i {
    color: var(--text-tertiary);
    font-size: var(--font-sm);
}

.m-search-clear {
    padding: var(--space-1);
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.m-search-clear:active {
    color: var(--text-primary);
}

.m-search-cancel {
    padding: var(--space-2);
    font-size: var(--font-base);
    color: var(--text-secondary);
    transition: color 0.2s;
}

.m-search-cancel:active {
    color: var(--primary);
}

.m-search-content,
.m-search-results {
    padding: var(--space-4);
}

.m-search-section {
    margin-bottom: var(--space-6);
}

.m-search-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.m-search-clear-history {
    padding: var(--space-1);
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.m-search-clear-history:active {
    color: var(--danger);
}

.m-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.m-search-tag {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    color: var(--text-primary);
    transition: background 0.2s, transform 0.2s;
}

.m-search-tag:active {
    background: var(--border-light);
    transform: scale(0.95);
}

.m-search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-base);
    color: var(--text-primary);
    transition: background 0.2s;
}

.m-search-result-item:active {
    background: var(--bg-base);
}

.m-search-result-item i {
    width: 20px;
    color: var(--text-tertiary);
}

.m-search-empty {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-tertiary);
}

/* === Tab Bar === */
.m-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    padding-bottom: var(--safe-bottom);
    z-index: 1000;
}

.m-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2) 0;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    transition: color 0.2s, transform 0.2s;
}

.m-tabbar-item.active {
    color: var(--primary);
}

.m-tabbar-item:active {
    transform: scale(0.9);
}

.m-tabbar-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.m-tabbar-publish {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: var(--space-2);
}

.m-tabbar-publish-btn {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-tabbar-publish-btn:active {
    transform: translateY(-10px) scale(0.9);
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.4);
}

/* === Hero Section === */
.m-hero {
    position: relative;
    padding: 80px var(--space-5) 60px;
    background: linear-gradient(135deg, #1E1B4B 0%, var(--primary) 50%, var(--accent) 100%);
    overflow: hidden;
}

.m-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.m-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.m-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    color: var(--text-inverse);
    margin-bottom: var(--space-5);
}

.m-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.m-hero-title {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-inverse);
    line-height: 1.2;
    margin-bottom: var(--space-3);
    letter-spacing: -1px;
}

.m-hero-desc {
    font-size: var(--font-lg);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-6);
}

.m-hero-btns {
    display: flex;
    gap: var(--space-3);
    max-width: 320px;
    margin: 0 auto;
}

/* === Buttons === */
.m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--font-base);
    font-weight: 600;
    text-align: center;
    flex: 1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-btn:active {
    transform: scale(0.96);
}

.m-btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.m-btn-outline {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-inverse);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.m-btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.m-btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.m-btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-sm);
    border-radius: var(--radius-md);
}

.m-btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-lg);
    border-radius: var(--radius-xl);
}

/* === Stats === */
.m-stats {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    margin: -40px var(--space-4) var(--space-5);
    padding: var(--space-5) var(--space-4);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 2;
}

.m-stat-item {
    flex: 1;
    text-align: center;
}

.m-stat-divider {
    width: 1px;
    background: var(--border-light);
}

.m-stat-num {
    display: block;
    font-size: var(--font-2xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.m-stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === Quick Links === */
.m-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    padding: 0 var(--space-4) var(--space-4);
}

.m-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-2);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    font-size: var(--font-xs);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-quick-item:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-md);
}

.m-quick-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: var(--radius-lg);
    color: var(--text-inverse);
}

/* === Section === */
.m-section {
    padding: var(--space-5) var(--space-4);
}

.m-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.m-section-header h2 {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.m-section-header h2 i {
    color: var(--primary);
}

.m-section-header a {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    transition: color 0.2s;
}

.m-section-header a:active {
    color: var(--primary);
}

/* === Cards === */
.m-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

/* === Article List === */
.m-article-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.m-article-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-article-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.m-article-cover {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: var(--bg-base);
}

.m-article-no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 32px;
}

.m-article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.m-article-info h3 {
    font-size: var(--font-base);
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.m-article-meta {
    display: flex;
    gap: var(--space-2);
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    align-items: center;
}

.m-article-tag {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
}

/* === Plugin Grid === */
.m-plugin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.m-plugin-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-plugin-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.m-plugin-cover {
    height: 90px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-plugin-badges {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    gap: var(--space-1);
}

.m-badge-vip,
.m-badge-free {
    font-size: 10px;
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.m-badge-vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.m-badge-free {
    background: var(--accent);
    color: var(--text-inverse);
}

.m-plugin-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: 22px;
    font-weight: 700;
}

.m-plugin-info {
    padding: var(--space-3);
}

.m-plugin-info h4 {
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--text-primary);
}

.m-plugin-info p {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Topic Tags === */
.m-topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.m-topic-tag {
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-topic-tag:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

/* === Post List === */
.m-post-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.m-post-item,
.m-post-card {
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.m-post-item:active,
.m-post-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.m-post-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.m-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-base);
}

.m-post-user {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.m-post-time {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.m-post-content {
    font-size: var(--font-sm);
    line-height: 1.7;
    color: var(--text-secondary);
}

.m-post-actions {
    display: flex;
    gap: var(--space-5);
    margin-top: var(--space-3);
    font-size: var(--font-sm);
    color: var(--text-tertiary);
}

.m-post-actions i {
    margin-right: var(--space-1);
}

.m-post-badges {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.m-badge-top,
.m-badge-essence {
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 600;
}

.m-badge-top {
    background: var(--danger);
    color: var(--text-inverse);
}

.m-badge-essence {
    background: var(--warning);
    color: var(--text-inverse);
}

/* === Category Tabs === */
.m-category-tabs,
.m-topic-tabs {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.m-category-tabs::-webkit-scrollbar,
.m-topic-tabs::-webkit-scrollbar {
    display: none;
}

.m-category-tabs a,
.m-topic-tabs a {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-base);
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.m-category-tabs a.active,
.m-topic-tabs a.active {
    background: var(--primary);
    color: var(--text-inverse);
}

/* === Pagination === */
.m-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
}

.m-pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.m-pagination-btn:active {
    transform: scale(0.9);
}

.m-pagination-info {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

/* === Member Page === */
.m-member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) var(--space-4);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-inverse);
}

.m-member-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.m-member-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.m-member-details h2 {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.m-member-details p {
    font-size: var(--font-sm);
    opacity: 0.8;
}

.m-member-edit {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-inverse);
    transition: background 0.2s;
}

.m-member-edit:active {
    background: rgba(255, 255, 255, 0.3);
}

.m-member-stats {
    display: flex;
    background: var(--bg-card);
    margin: -24px var(--space-4) var(--space-4);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 2;
}

.m-member-stat {
    flex: 1;
    text-align: center;
}

.m-member-stat-num {
    font-size: var(--font-2xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.m-member-stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.m-member-menu {
    margin: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.m-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: background 0.2s;
}

.m-menu-item:last-child {
    border-bottom: none;
}

.m-menu-item:active {
    background: var(--bg-base);
}

.m-menu-item > i:first-child {
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.m-menu-item span {
    flex: 1;
}

.m-menu-item > i:last-child {
    color: var(--text-tertiary);
}

.m-menu-logout {
    color: var(--danger);
}

.m-menu-logout > i:first-child {
    color: var(--danger);
}

/* === Guest State === */
.m-guest-state {
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.m-guest-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-inverse);
}

.m-guest-state h3 {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.m-guest-state p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

/* === Publish Page === */
.m-publish-page {
    padding: var(--space-4);
}

.m-publish-header {
    margin-bottom: var(--space-5);
}

.m-publish-header h2 {
    font-size: var(--font-xl);
    font-weight: 700;
}

.m-publish-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.m-form-group label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.m-form-group input,
.m-form-group select,
.m-form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.m-form-group input:focus,
.m-form-group select:focus,
.m-form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.m-form-group textarea {
    min-height: 200px;
    resize: vertical;
}

/* === Detail Page === */
.m-detail-page {
    background: var(--bg-base);
    min-height: 100vh;
    padding-bottom: calc(80px + var(--safe-bottom));
}

.m-detail-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    z-index: 50;
}

.m-back-btn,
.m-share-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--font-lg);
    transition: background 0.2s;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.m-back-btn:active,
.m-share-btn:active {
    background: var(--border-light);
}

.m-detail-header h1 {
    font-size: var(--font-base);
    font-weight: 600;
}

/* === Empty State === */
.m-empty {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-tertiary);
    font-size: var(--font-sm);
}

.m-empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    background: var(--bg-card);
}

.m-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    background: var(--bg-base);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-empty-icon i {
    font-size: 32px;
    color: var(--text-tertiary);
}

.m-empty-state h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.m-empty-state p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

/* === Announcement === */
.m-announcement {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    font-size: var(--font-sm);
    color: #92400E;
}

.m-announcement i {
    color: var(--warning);
}

/* === Loading === */
.m-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.m-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Toast === */
.m-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--space-3) var(--space-5);
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s;
}

.m-toast.show {
    opacity: 1;
}

/* === Utilities === */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }

.bg-card { background: var(--bg-card); }
.bg-base { background: var(--bg-base); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.3s ease; }
.animate-slideDown { animation: slideDown 0.3s ease; }

/* === Page Specific Styles === */
.m-discover-page,
.m-news-page,
.m-plugins-page,
.m-community-page,
.m-member-page,
.m-search-page {
    background: var(--bg-base);
    min-height: 100vh;
}

.m-discover-header,
.m-community-header {
    padding: var(--space-8) var(--space-4);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-inverse);
    text-align: center;
}

.m-discover-header h1,
.m-community-header h1 {
    font-size: var(--font-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.m-discover-header p,
.m-community-header p {
    font-size: var(--font-sm);
    opacity: 0.9;
}

.m-discover-section {
    padding: var(--space-4);
    background: var(--bg-card);
    margin-bottom: var(--space-2);
}

/* Horizontal Scroll */
.m-plugin-scroll,
.m-article-scroll {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.m-plugin-scroll::-webkit-scrollbar,
.m-article-scroll::-webkit-scrollbar {
    display: none;
}

.m-plugin-scroll .m-plugin-card,
.m-article-scroll .m-article-card {
    flex-shrink: 0;
    width: 140px;
    background: var(--bg-base);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.m-plugin-scroll .m-plugin-cover {
    height: 100px;
}

.m-plugin-scroll .m-plugin-info {
    padding: var(--space-2);
}

.m-plugin-scroll .m-plugin-info h4 {
    font-size: var(--font-sm);
}

.m-plugin-scroll .m-plugin-info p {
    display: none;
}

.m-article-scroll .m-article-card {
    width: 200px;
}

.m-article-scroll .m-article-cover {
    height: 120px;
    width: 100%;
}

.m-article-scroll .m-article-info {
    padding: var(--space-2);
}

.m-article-scroll .m-article-info h3 {
    font-size: var(--font-sm);
}

/* === Responsive === */
@media (min-width: 768px) {
    .m-plugin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .m-quick-links {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .m-plugin-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === Android Interaction Optimization === */

/* Touch Action - Eliminate 300ms delay */
a, button, input, select, textarea, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Active State - Visual Feedback */
.m-btn:active,
.m-btn-primary:active,
.m-btn-outline:active,
.m-tabbar-item:active,
.m-tabbar-publish-btn:active,
.m-article-item:active,
.m-quick-item:active,
.m-section-header a:active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Pseudo Elements for Touch Feedback */
.m-article-item::after,
.m-quick-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: background 0.2s;
    pointer-events: none;
}

.m-article-item:active::after,
.m-quick-item:active::after {
    background: rgba(0, 0, 0, 0.05);
}

/* Increase Touch Target Size */
.m-btn,
.m-btn-primary,
.m-btn-outline {
    min-height: 44px;
    min-width: 44px;
}

.m-tabbar-item {
    min-height: 56px;
}

.m-quick-item {
    min-height: 80px;
}

.m-article-item {
    min-height: 80px;
}

/* Scroll Optimization */
.m-section,
.m-article-list,
.m-plugin-scroll,
.m-post-list {
    -webkit-overflow-scrolling: touch;
    will-change: transform;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Hardware Acceleration */
.m-hero,
.m-stats,
.m-quick-links {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Touch Active Animation */
.touch-active {
    opacity: 0.7 !important;
    transform: scale(0.98) !important;
}

/* Input Focus Optimization */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Prevent Text Selection on Interactive Elements */
.m-btn,
.m-tabbar-item,
.m-quick-item,
.m-article-item,
.m-plugin-card {
    -webkit-user-select: none;
    user-select: none;
}

/* Fix Android Input Zoom */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Android-Specific Button Press Animation */
@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.m-btn:active,
.m-btn-primary:active,
.m-btn-outline:active {
    animation: buttonPress 0.2s ease;
}

/* Improve Scroll Performance */
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Fix Android Back Button */
@media (max-width: 768px) {
    .m-header,
    .m-tabbar {
        position: fixed;
        -webkit-position: fixed;
    }
}

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ripple:active::before {
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Weibo-style Media Grid */
.m-media-single-img {
    border-radius: 8px;
    overflow: hidden;
    max-height: 250px;
    cursor: pointer;
}
.m-media-single-img img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}
.m-media-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    cursor: pointer;
}
.m-media-video-wrap .m-video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}
.m-media-video-wrap .m-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}
.m-media-video-wrap .m-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    pointer-events: none;
    border: 2px solid rgba(255,255,255,0.4);
}
.m-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.m-media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
}
.m-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.m-media-item.m-media-item-video {
    background: #1a1a1a;
}
.m-media-item .m-video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.m-media-item .m-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}
.m-media-item:active {
    opacity: 0.85;
}

