/* ===============================================
   AI Story Club - 移动端优化
   =============================================== */

/* ========== 移动端导航优化 ========== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links .nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* Hamburger menu button */
    .nav-mobile-menu {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    .nav-user-name {
        display: none;
    }
}

/* ========== 触摸优化 ========== */
@media (max-width: 768px) {
    /* Minimum touch target size 44x44px */
    button, 
    .btn, 
    a, 
    input[type="button"], 
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for touch */
    .story-card {
        margin-bottom: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Larger form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }
}

/* ========== 响应式排版 ========== */
@media (max-width: 768px) {
    h1 {
        font-size: 24px;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 18px;
        line-height: 1.4;
    }
    
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .page-title {
        font-size: 24px;
    }
}

/* ========== 移动端卡片布局 ========== */
@media (max-width: 768px) {
    .stories-bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .story-card-content {
        padding: 16px;
    }
    
    .story-card-title {
        font-size: 16px;
    }
    
    .story-card-summary {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
}

/* ========== 移动端个人资料页面 ========== */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-bottom: 16px;
    }
    
    .profile-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .profile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-link {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ========== 移动端搜索页面 ========== */
@media (max-width: 768px) {
    .search-form {
        padding: 16px;
    }
    
    .advanced-filters {
        padding: 16px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input-group input {
        width: 100%;
    }
}

/* ========== 移动端通知页面 ========== */
@media (max-width: 768px) {
    .notifications-container {
        padding: 16px;
    }
    
    .notification-item {
        padding: 12px;
    }
    
    .notification-icon {
        font-size: 20px;
    }
    
    .notification-actions {
        flex-direction: column;
    }
}

/* ========== 移动端优化动画 ========== */
@media (max-width: 768px) {
    /* Reduce motion for performance */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Disable hover effects on touch devices */
    @media (hover: none) {
        .story-card:hover {
            transform: none;
        }
    }
}

/* ========== 移动端表格优化 ========== */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 12px;
    }
}

/* ========== 移动端表单优化 ========== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-check {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .form-check input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}

/* ========== 移动端模态框优化 ========== */
@media (max-width: 768px) {
    .modal-content {
        margin: 16px;
        padding: 20px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
}

/* ========== 移动端页脚优化 ========== */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* ========== 移动端工具提示优化 ========== */
@media (max-width: 768px) {
    .tooltip::after {
        display: none; /* Hide tooltips on mobile */
    }
}

/* ========== 移动端打印优化 ========== */
@media (max-width: 768px) {
    @media print {
        .nav-links,
        .nav-right,
        .notification-actions {
            display: none !important;
        }
    }
}
