/* 主控制台页面 - 移动端响应式样式 */

/* ========================================
   平板设备 (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) {
    /* 导航栏 */
    .navbar {
        padding: 12px 24px !important;
    }
    
    .navbar-brand img {
        height: 44px !important;
    }
    
    .navbar-right {
        gap: 24px !important;
    }
    
    .credits-display {
        font-size: 0.9rem !important;
        padding: 6px 14px !important;
    }
    
    .btn-upgrade {
        padding: 6px 16px !important;
        font-size: 0.85rem !important;
    }
    
    .user-avatar {
        width: 36px !important;
        height: 36px !important;
    }
    
    .user-name {
        display: none !important;
    }
    
    /* 主容器 */
    .dashboard-container {
        padding: 40px 24px !important;
    }
    
    /* 头部区域 */
    .header-section {
        margin-bottom: 60px !important;
    }
    
    .intro-text h1 {
        font-size: 2.5rem !important;
    }
    
    .intro-text p {
        font-size: 1rem !important;
    }
    
    /* 功能卡片 */
    .feature-row {
        grid-template-columns: 280px 1fr !important;
        gap: 40px !important;
    }
    
    .feature-card {
        height: 180px !important;
    }
    
    .card-label {
        font-size: 1.3rem !important;
    }
    
    .feature-info h3 {
        font-size: 1rem !important;
    }
    
    .feature-info p {
        font-size: 0.9rem !important;
    }
    
    /* 案例展示 */
    .showcase-item {
        min-width: 240px !important;
        height: 140px !important;
    }
    
    /* 悬浮按钮 */
    .profile-quick-card {
        width: 64px !important;
        height: 64px !important;
        bottom: 30px !important;
        right: 30px !important;
    }
    
    .profile-card-icon svg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* ========================================
   手机设备 (小于768px)
   ======================================== */
@media (max-width: 768px) {
    /* 导航栏 - 完全重置 */
    .navbar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 12px !important;
        height: auto !important;
        min-height: 50px !important;
        background: #fff !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
    }
    
    .navbar-brand {
        display: flex !important;
        align-items: center !important;
    }
    
    .navbar-brand img {
        height: 32px !important;
        width: auto !important;
    }
    
    .navbar-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    /* 积分显示 - 简化 */
    .credits-wrapper {
        position: static !important;
    }
    
    .credits-display {
        display: flex !important;
        align-items: center !important;
        font-size: 0.8rem !important;
        padding: 4px 8px !important;
        background: #f5f5f7 !important;
        border-radius: 16px !important;
    }
    
    .credits-label {
        display: none !important;
    }
    
    .credits-value {
        font-weight: 600 !important;
    }
    
    .credits-display svg {
        display: none !important;
    }
    
    /* 升级按钮 - 隐藏或简化 */
    .btn-upgrade {
        display: none !important;
    }
    
    /* 用户区域 */
    .user-area {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    
    .user-profile-trigger {
        display: flex !important;
        align-items: center !important;
        padding: 4px !important;
    }
    
    .user-profile-trigger svg {
        display: none !important;
    }
    
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
        border-radius: 50% !important;
    }
    
    .user-name {
        display: none !important;
    }
    
    /* 积分下拉菜单 - 底部弹出 */
    #creditsDropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 16px) !important;
        background: #fff !important;
        border: none !important;
        box-shadow: 0 -10px 50px rgba(0,0,0,0.2) !important;
        /* 不使用 !important，让 JS 可以控制 */
        transform: translateY(100%);
        opacity: 1;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s;
    }
    
    #creditsDropdown.active {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 积分下拉菜单顶部拖动条 */
    #creditsDropdown::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #E0E0E0;
        border-radius: 2px;
        margin: 12px auto 8px;
    }
    
    #creditsDropdown .dropdown-item {
        padding: 18px 24px !important;
        font-size: 1.05rem !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #F5F5F5 !important;
    }
    
    #creditsDropdown .dropdown-item:last-child {
        border-bottom: none !important;
    }
    
    /* 积分标题样式 */
    #creditsDropdown > div:first-of-type {
        padding: 8px 24px 12px !important;
        background: #F9F9F9 !important;
        margin-top: 4px !important;
    }
    
    /* 升级按钮 */
    .btn-upgrade {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        margin-right: 8px !important;
    }
    
    /* 用户区域 */
    .user-area {
        gap: 8px !important;
    }
    
    .user-profile-trigger {
        padding: 4px !important;
    }
    
    .user-profile-trigger svg {
        display: none !important;
    }
    
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }
    
    .user-name {
        display: none !important;
    }
    
    /* 用户下拉菜单 - 底部弹出 */
    #userDropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 0 !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        background: #fff !important;
        border: none !important;
        box-shadow: 0 -10px 50px rgba(0,0,0,0.2) !important;
        /* 不使用 !important，让 JS 可以控制 */
        transform: translateY(100%);
        opacity: 1;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s;
    }
    
    #userDropdown.active {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 下拉菜单顶部拖动条 */
    #userDropdown::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #E0E0E0;
        border-radius: 2px;
        margin: 12px auto 8px;
    }
    
    .dropdown-item {
        padding: 18px 24px !important;
        font-size: 1.05rem !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #F5F5F5 !important;
    }
    
    .dropdown-item:last-child {
        border-bottom: none !important;
    }
    
    .dropdown-item .icon {
        font-size: 1.3rem !important;
        width: 32px !important;
    }
    
    .dropdown-divider {
        height: 8px !important;
        background: #F5F5F7 !important;
        margin: 0 !important;
    }
    
    /* ADMIN TOOLS 标题样式 */
    #userDropdown div[style*="ADMIN TOOLS"],
    #adminMenuItem > div:first-child {
        padding: 12px 24px 8px !important;
        background: #F9F9F9 !important;
    }
    
    /* 安全区域底部间距 */
    #userDropdown {
        padding-bottom: env(safe-area-inset-bottom, 16px) !important;
    }
    
    /* 主容器 */
    .dashboard-container {
        padding: 24px 16px !important;
        max-width: 100% !important;
    }
    
    /* 头部区域 */
    .header-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 32px !important;
        gap: 8px !important;
    }
    
    .intro-text {
        width: 100% !important;
    }
    
    .intro-text h1 {
        font-size: 1.8rem !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        margin: 0 0 8px 0 !important;
        color: #1D1D1F !important;
    }
    
    .intro-text h1 br {
        display: inline !important;
    }
    
    .intro-text p {
        font-size: 0.95rem !important;
        color: #666 !important;
        line-height: 1.5 !important;
        margin: 0 !important;
    }
    
    /* 功能卡片网格 */
    .features-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
        margin-bottom: 60px !important;
    }
    
    .feature-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .feature-card {
        width: 100% !important;
        height: 180px !important;
        border-radius: 20px !important;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border: 1px solid rgba(0,0,0,0.05) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .card-visual {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 0.15 !important;
        background-size: cover !important;
        background-position: center !important;
    }
    
    .card-label {
        font-size: 1.3rem !important;
        font-weight: 600 !important;
        color: #1D1D1F !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .feature-info {
        padding: 0 !important;
    }
    
    .feature-info h3 {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        margin-bottom: 8px !important;
        color: #1D1D1F !important;
    }
    
    .feature-info p {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
        color: #666 !important;
        margin-bottom: 12px !important;
    }
    
    .feature-info p br {
        display: none !important;
    }
    
    .feature-info p span {
        display: inline !important;
    }
    
    .feature-link {
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    /* 案例展示区域 */
    .showcase-section {
        margin-bottom: 40px !important;
        padding-top: 30px !important;
    }
    
    .showcase-header {
        margin-bottom: 24px !important;
    }
    
    .showcase-header h2 {
        font-size: 1.3rem !important;
    }
    
    .showcase-header p {
        font-size: 0.9rem !important;
    }
    
    .showcase-item {
        min-width: 200px !important;
        height: 120px !important;
        border-radius: 12px !important;
    }
    
    .showcase-overlay {
        padding: 10px !important;
        font-size: 0.8rem !important;
    }
    
    /* 悬浮按钮 */
    .profile-quick-card {
        width: 56px !important;
        height: 56px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .profile-card-icon svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Footer */
    footer {
        padding: 50px 16px 30px !important;
    }
    
    .footer-content {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    .footer-brand {
        max-width: 100% !important;
    }
    
    .footer-logo {
        font-size: 1.3rem !important;
    }
    
    .footer-desc {
        font-size: 0.9rem !important;
    }
    
    .footer-nav {
        flex-direction: column !important;
        gap: 24px !important;
        width: 100% !important;
    }
    
    .footer-column {
        gap: 12px !important;
    }
    
    .footer-column h4 {
        font-size: 0.9rem !important;
    }
    
    .footer-column a {
        font-size: 0.9rem !important;
    }
}

/* ========================================
   小屏手机 (小于480px)
   ======================================== */
@media (max-width: 480px) {
    .intro-text h1 {
        font-size: 1.75rem !important;
    }
    
    .intro-text p {
        font-size: 0.9rem !important;
    }
    
    .feature-card {
        height: 140px !important;
    }
    
    .card-label {
        font-size: 1.1rem !important;
    }
    
    .feature-info h3 {
        font-size: 0.95rem !important;
    }
    
    .feature-info p {
        font-size: 0.85rem !important;
    }
    
    .showcase-item {
        min-width: 180px !important;
        height: 100px !important;
    }
    
    .profile-quick-card {
        width: 50px !important;
        height: 50px !important;
    }
    
    .profile-card-icon svg {
        width: 22px !important;
        height: 22px !important;
    }
}

/* ========================================
   横屏模式优化
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .dashboard-container {
        padding: 20px 24px !important;
    }
    
    .header-section {
        margin-bottom: 30px !important;
    }
    
    .intro-text h1 {
        font-size: 1.75rem !important;
    }
    
    .features-grid {
        gap: 20px !important;
    }
    
    .feature-row {
        grid-template-columns: 200px 1fr !important;
        gap: 20px !important;
    }
    
    .feature-card {
        height: 120px !important;
    }
    
    .showcase-item {
        min-width: 200px !important;
        height: 100px !important;
    }
}


/* ========================================
   下拉菜单遮罩层
   ======================================== */
@media (max-width: 768px) {
    /* 遮罩层 */
    .dropdown-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .dropdown-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 确保下拉菜单在遮罩层之上 */
    #userDropdown,
    #creditsDropdown {
        z-index: 2000 !important;
    }
    
    /* 下拉菜单底部安全区域 */
    #userDropdown,
    #creditsDropdown {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ========================================
   骨架屏移动端适配
   ======================================== */
@media (max-width: 768px) {
    .skeleton-card {
        border-radius: 14px !important;
    }
    
    .skeleton-thumbnail {
        border-radius: 14px 14px 0 0 !important;
    }
    
    .skeleton-info {
        padding: 10px 12px !important;
    }
    
    .skeleton-title {
        height: 14px !important;
    }
    
    .skeleton-meta {
        height: 10px !important;
    }
    
    /* 页面切换淡入效果 */
    .grid-fade-in {
        animation: gridFadeIn 0.2s ease-out;
    }
    
    .content-fade-in {
        animation: contentFadeIn 0.25s ease-out;
    }
}
