/* AI工具试用页面样式 - AI风格 */

/* 页面头部 */
.ai-tools-header {
    background: var(--gradient-hero);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.ai-tools-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.ai-tools-header .page-title {
    color: white;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.ai-tools-header .page-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 20px;
    position: relative;
    z-index: 1;
}

/* 重点工具区域 */
.featured-tools {
    padding: 80px 0;
    background: var(--light-bg);
}

.featured-tools .section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 16px;
}

.featured-tools .section-subtitle {
    font-size: 18px;
    color: #666;
}

/* 工具网格布局 */
.tools-grid {
    display: grid;
    gap: 24px;
    margin-top: 48px;
}

.tools-grid.featured {
    grid-template-columns: repeat(3, 1fr);
}

.tools-grid.secondary {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 重点工具卡片 - 科技感渐变边框 */
.tool-card.featured-card {
    position: relative;
    background: var(--light-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: var(--gradient-hero);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.tool-card.featured-card:hover::before {
    opacity: 1;
}

.tool-card.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(26, 115, 232, 0.15);
}

/* 发光效果 */
.tool-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(26, 115, 232, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.tool-card.featured-card:hover .tool-glow {
    opacity: 1;
}

.tool-content {
    position: relative;
    z-index: 1;
    padding: 40px 32px;
    background: var(--light-card);
    border-radius: var(--radius-xl);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 工具图标 */
.tool-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.3);
}

.tool-icon-wrapper.small {
    width: 60px;
    height: 60px;
}

.tool-icon-wrapper i {
    font-size: 36px;
    color: white;
}

.tool-icon-wrapper.small i {
    font-size: 28px;
}

/* 工具名称和描述 */
.tool-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 12px;
}

.tool-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

/* 工具元信息 */
.tool-meta {
    margin-bottom: 20px;
}

.tool-usage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    background: rgba(26, 115, 232, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius-full);
}

.tool-usage i {
    color: var(--accent-color);
}

.usage-count {
    color: var(--primary-color);
    font-weight: 600;
}

/* 工具按钮 */
.tool-btn {
    width: 100%;
    justify-content: center;
}

/* 次要工具卡片 */
.more-tools {
    padding: 80px 0;
    background: white;
}

.more-tools .section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 16px;
}

.tool-card.secondary-card {
    background: var(--light-card);
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s ease;
}

.tool-card.secondary-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tool-card.secondary-card .tool-content {
    padding: 0;
    background: transparent;
}

.tool-card.secondary-card .tool-name {
    font-size: 18px;
    margin-bottom: 8px;
}

.tool-card.secondary-card .tool-desc {
    font-size: 14px;
    margin-bottom: 16px;
}

.tool-card.secondary-card .tool-meta {
    margin-bottom: 16px;
}

/* 使用说明区域 */
.usage-guide {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--light-bg) 0%, white 100%);
}

.usage-guide .section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 16px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.guide-card {
    text-align: center;
    padding: 40px 24px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-4px);
}

.guide-step {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.guide-icon {
    width: 70px;
    height: 70px;
    background: rgba(26, 115, 232, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto 24px;
}

.guide-icon i {
    font-size: 32px;
    color: var(--primary-color);
}

.guide-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 12px;
}

.guide-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* 提示信息 */
.guide-notice {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    max-width: 800px;
    margin: 48px auto 0;
    padding: 24px 32px;
    background: rgba(251, 188, 5, 0.1);
    border: 1px solid rgba(251, 188, 5, 0.3);
    border-radius: var(--radius-lg);
}

.notice-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-icon i {
    font-size: 24px;
    color: white;
}

.notice-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 8px;
}

.notice-content p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* CTA区域 */
.cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
}

.cta-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 32px;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta .btn-outline {
    border-color: white;
    color: white;
}

.cta .btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* ========== 模态框样式 ========== */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tool-modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--light-border);
    background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #1a73e8, #4285f4);
    border-radius: 2px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger-color);
}

.modal-close i {
    font-size: 20px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.modal-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--light-border);
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
}

.usage-info {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-info i {
    color: var(--accent-color);
}

/* 输入区域样式 */
.input-section {
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--light-text);
    margin-bottom: 8px;
    font-size: 15px;
}

.input-group .required::after {
    content: ' *';
    color: var(--danger-color);
}

.tool-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    background: white;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.tool-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.tool-input::placeholder {
    color: #999;
}

textarea.tool-input {
    min-height: 120px;
    resize: vertical;
}

.select-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 生成按钮区域 */
.generate-section {
    text-align: center;
    margin: 24px 0;
}

.generate-btn {
    min-width: 200px;
    position: relative;
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-btn.loading {
    color: transparent;
}

.generate-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 结果展示区域 */
.result-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px dashed var(--light-border);
}

.result-section.hidden {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--light-text);
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-content {
    background: #f8f9fa;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: var(--light-text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-content:empty::before {
    content: '生成结果将显示在这里...';
    color: #999;
    font-style: italic;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    animation: toastSlideIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    font-size: 15px;
    color: var(--light-text);
}

.toast-content i {
    font-size: 22px;
    color: var(--secondary-color);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .tools-grid.featured {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-tools-header {
        padding: 100px 0 60px;
    }
    
    .ai-tools-header .page-title {
        font-size: 32px;
    }
    
    .ai-tools-header .page-subtitle {
        font-size: 16px;
    }
    
    .tools-grid.featured {
        grid-template-columns: 1fr;
    }
    
    .tools-grid.secondary {
        grid-template-columns: 1fr;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-content {
        padding: 28px 24px;
    }
    
    .modal-container {
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px 24px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .guide-notice {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .notice-icon {
        margin: 0 auto;
    }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .tool-card.featured-card .tool-content,
    .tool-card.secondary-card {
        background: var(--dark-card);
        color: var(--dark-text);
    }
    
    .tool-name {
        color: var(--dark-text);
    }
    
    .tool-desc {
        color: #aaa;
    }
    
    .tool-usage {
        background: rgba(26, 115, 232, 0.2);
        color: #ccc;
    }
    
    .modal-container {
        background: var(--dark-card);
    }
    
    .modal-header {
        background: linear-gradient(135deg, #292a2d 0%, var(--dark-card) 100%);
        border-bottom-color: var(--dark-border);
    }
    
    .modal-title {
        color: var(--dark-text);
    }
    
    .modal-footer {
        background: #252629;
        border-top-color: var(--dark-border);
    }
    
    .usage-info {
        color: #aaa;
    }
    
    .tool-input {
        background: var(--dark-card);
        border-color: var(--dark-border);
        color: var(--dark-text);
    }
    
    .tool-input:focus {
        border-color: var(--primary-color);
    }
    
    .result-content {
        background: #252629;
        border-color: var(--dark-border);
        color: var(--dark-text);
    }
    
    .guide-card {
        background: var(--dark-card);
    }
    
    .guide-title {
        color: var(--dark-text);
    }
    
    .guide-desc {
        color: #aaa;
    }
    
    .toast-content {
        background: var(--dark-card);
        color: var(--dark-text);
    }
}
