/* CLRA 工具分发平台样式文件 */

/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

.dark-theme {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #4a4a4a;
    --accent-color: #4dabf7;
    --accent-hover: #339af0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border-radius: 15px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

/* 调试信息样式 */
.debug-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 300px;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: none;
}

.debug-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow);
    margin-right: 60px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.tool-card:hover::before {
    left: 100%;
}

/* 错误卡片样式 */
.tool-card.error-card {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.tool-card.error-card:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

/* 回退卡片样式 */
.tool-card.fallback-card {
    border-color: #ff9500;
    background: rgba(255, 149, 0, 0.05);
}

.tool-card.fallback-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.2);
}

.tool-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.tool-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.tool-icon i {
    font-size: 2rem;
    color: var(--accent-color);
}

.tool-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.tool-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.version-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.developer {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.update-content {
    background: var(--bg-secondary);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.9rem;
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    display: none;
}

.error-message.active {
    display: block;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dc3545;
}

.cors-info {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.cors-info h4 {
    color: #856404;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cors-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.cors-info li {
    margin: 5px 0;
    color: #856404;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tool-card {
        padding: 20px;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .tool-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tool-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}