/*
 * 移动端优化和白蓝色主题
 * 幻隐引流系统 UI优化
 */

/* ====================================
   基础变量和主题色
   ==================================== */
:root {
    --primary-blue: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --sky-blue: #dbeafe;
    --light-blue: #eff6ff;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ====================================
   全局样式优化
   ==================================== */
body {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--sky-blue) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    margin: 1rem;
    overflow: hidden;
}

/* ====================================
   左侧导航优化
   ==================================== */
#app .left {
    width: 240px;
    background: linear-gradient(180deg, var(--white) 0%, var(--light-blue) 100%);
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

#app .left .dhview {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#app .left .logo {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    border-radius: var(--radius-lg);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* 导航列表 */
#navList {
    flex: 1;
    padding: 0 1rem;
}

#navList a {
    display: block;
    text-decoration: none;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

#navList a:hover {
    background: var(--sky-blue);
    color: var(--primary-blue);
    transform: translateX(4px);
}

#navList a.selected {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

#navList .nav-li {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}

/* 账号信息 */
#app .left .account {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ====================================
   右侧内容区域
   ==================================== */
#right {
    flex: 1;
    padding: 2rem;
    background: var(--white);
    overflow-y: auto;
}

#right h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--sky-blue);
    position: relative;
}

#right h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--primary-blue);
}

/* 数据卡片 */
.data-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.data-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 按钮样式 */
.default-btn, .tint-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.default-btn {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.default-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tint-btn {
    background: var(--gray-100);
    color: var(--gray-700);
}

.tint-btn:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

/* ====================================
   表格样式优化
   ==================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: var(--light-blue);
    color: var(--gray-700);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--sky-blue);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* ====================================
   表单样式优化
   ==================================== */
.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--white);
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ====================================
   插件卡片样式
   ==================================== */
.plugin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.plugin_card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plugin_card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.plugin_logo {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.plugin_logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plugin_name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
}

.plugin_desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
    line-height: 1.5;
    flex: 1;
}

.plugin_btn {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.action_btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 80px;
    text-align: center;
}

.action_btn:not(.action_uninstall) {
    background: var(--primary-blue);
    color: var(--white);
}

.action_btn:not(.action_uninstall):hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.action_uninstall {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.action_uninstall:hover {
    background: var(--error);
    color: var(--white);
}

/* ====================================
   响应式设计 - 移动端适配
   ==================================== */

/* 平板设备 (641px - 1024px) */
@media screen and (max-width: 1024px) {
    #app {
        margin: 0.5rem;
        border-radius: var(--radius-md);
    }
    
    #app .left {
        width: 200px;
    }
    
    #right {
        padding: 1.5rem;
    }
    
    #right h3 {
        font-size: 1.5rem;
    }
    
    .plugin-list {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
    }
}

/* 手机设备 (640px及以下) */
@media screen and (max-width: 640px) {
    body {
        background: var(--light-blue);
    }
    
    #app {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }
    
    /* 移动端导航 - 顶部横向 */
    #app .left {
        width: 100%;
        height: auto;
        padding: 0.75rem 0;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        background: var(--white);
    }
    
    #app .left .dhview {
        flex-direction: row;
        align-items: center;
        padding: 0 1rem;
        gap: 1rem;
    }
    
    #app .left .logo {
        width: 40px;
        height: 40px;
        margin: 0;
        font-size: 1.25rem;
    }
    
    #navList {
        display: flex;
        gap: 0.5rem;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    #navList::-webkit-scrollbar {
        display: none;
    }
    
    #navList a {
        margin-bottom: 0;
        white-space: nowrap;
        background: var(--gray-50);
    }
    
    #navList .nav-li {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    
    #navList .nav-li .nav-text {
        display: none;
    }
    
    #app .left .account {
        display: none;
    }
    
    /* 右侧内容区域 */
    #right {
        flex: 1;
        padding: 1rem;
        overflow-y: auto;
        padding-bottom: 80px; /* 为底部导航留空间 */
    }
    
    #right h3 {
        font-size: 1.25rem;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    
    #right h3::after {
        width: 60px;
    }
    
    .data-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-lg);
    }
    
    /* 插件列表 - 手机端单列 */
    .plugin-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .plugin_card {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .plugin_logo {
        width: 50px;
        height: 50px;
        margin: 0;
    }
    
    .plugin_info {
        flex: 1;
        text-align: left;
    }
    
    .plugin_name {
        font-size: 1rem;
        text-align: left;
        margin-bottom: 0.25rem;
    }
    
    .plugin_desc {
        font-size: 0.75rem;
        text-align: left;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .plugin_btn {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action_btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    /* 表格优化 */
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* 表单优化 */
    .form-control,
    .form-select {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 按钮优化 */
    .default-btn,
    .tint-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 响应式表格滚动 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }
    
    /* 底部固定操作栏 */
    .mobile-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        padding: 0.75rem;
        display: flex;
        gap: 0.75rem;
        z-index: 100;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    }
}

/* 超小屏幕 (375px及以下) */
@media screen and (max-width: 375px) {
    #right {
        padding: 0.75rem;
    }
    
    #navList {
        gap: 0.25rem;
    }
    
    #navList a {
        font-size: 0.75rem;
    }
    
    .plugin_card {
        flex-direction: column;
        text-align: center;
    }
    
    .plugin_info {
        text-align: center;
    }
    
    .plugin_name,
    .plugin_desc {
        text-align: center;
    }
    
    .plugin_btn {
        flex-direction: row;
        justify-content: center;
    }
}

/* ====================================
   动画效果
   ==================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plugin_card,
.data-card,
.table tbody tr {
    animation: fadeIn 0.3s ease forwards;
}

.plugin_card:nth-child(n) { animation-delay: calc(n * 0.05s); }

/* ====================================
   加载和状态样式
   ==================================== */
.loading {
    text-align: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================================
   提示和通知样式
   ==================================== */
.showNotification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    color: var(--gray-800);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-blue);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.success-notification {
    border-left-color: var(--success);
}

.error-notification {
    border-left-color: var(--error);
}
