/**
 * Favicon获取工具 - 自定义样式
 * 
 * @author CodeBuddy
 * @created 2026-05-20
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 代码块样式 */
.mockup-code {
    border-radius: 0.5rem;
}

.mockup-code pre {
    padding: 1rem;
    overflow-x: auto;
}

.mockup-code code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 表格响应式 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 输入框聚焦效果 */
.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.2);
}

/* 按钮悬停效果 */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* 卡片悬停效果 */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 图标预览区域 */
#iconPreview {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 0.5rem;
    padding: 1rem;
}

[data-theme="dark"] #iconPreview {
    background: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
                linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
                linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* 预览图片 */
#iconPreview img {
    display: block;
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Toast动画 */
.toast {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 加载动画 */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 移动端优化 */
@media (max-width: 767px) {
    /* 按钮点击区域 */
    .btn,
    button,
    [role="button"] {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* 输入框 */
    .input,
    .select,
    .textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 表格 */
    .table {
        font-size: 0.875rem;
    }
    
    /* 卡片内边距 */
    .card-body {
        padding: 1rem;
    }
}

/* 平板端优化 */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        max-width: 720px;
    }
}

/* 桌面端优化 */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    #themeToggle,
    .btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* 无障碍：焦点可见 */
:focus-visible {
    outline: 2px solid #165DFF;
    outline-offset: 2px;
}

/* 无障碍：减少动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 选择文本颜色 */
::selection {
    background-color: rgba(22, 93, 255, 0.3);
    color: inherit;
}
