/* ===================================
   AI工具库 v2.0 - 主样式文件
   =================================== */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 容器 */
.container {
    max-width: 1400px;
}

/* 卡片阴影 */
.card-shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #8b5cf6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7c3aed;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.dark .btn-outline {
    border-color: #4b5563;
    color: #d1d5db;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.dark .btn-outline:hover:not(:disabled) {
    background-color: #374151;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .badge-primary {
    background-color: #1e3a8a;
    color: #93c5fd;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.dark .badge-success {
    background-color: #064e3b;
    color: #6ee7b7;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.dark .badge-warning {
    background-color: #78350f;
    color: #fcd34d;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.dark .badge-danger {
    background-color: #7f1d1d;
    color: #fca5a5;
}

/* 星级评分 */
.stars {
    display: inline-flex;
    align-items: center;
    color: #fbbf24;
}

.star {
    font-size: 1rem;
}

.star.filled {
    color: #fbbf24;
}

.star.empty {
    color: #d1d5db;
}

.dark .star.empty {
    color: #4b5563;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    color: #374151;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.dark .tag {
    background-color: #374151;
    color: #d1d5db;
}

/* 分隔线 */
.divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 1rem 0;
}

.dark .divider {
    background-color: #374151;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 代码块 */
pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.dark th,
.dark td {
    border-bottom-color: #374151;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.dark th {
    background-color: #1f2937;
    color: #d1d5db;
}

tr:hover {
    background-color: #f9fafb;
}

.dark tr:hover {
    background-color: #1f2937;
}

/* 打印样式 */
@media print {
    header,
    nav,
    aside,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
    }
    
    .card-shadow {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 返回顶部按钮动画 */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 提示消息动画 */
@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.animate-slide-out {
    animation: slide-out 0.3s ease-in;
}

/* 选中文本样式 */
::selection {
    background-color: #3b82f6;
    color: white;
}

::-moz-selection {
    background-color: #3b82f6;
    color: white;
}

