/* ==========================================
   首页专用样式
   ========================================== */

/* 标题区 */
.title-section {
    text-align: center;
    margin-bottom: 50px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.main-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* 工具卡片 */
.tool-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 30px;
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tool-icon {
    width: 40px;
    height: 40px;
    background: #6366f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.tool-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* 表单区 */
.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

.section-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

input[type="url"],
input[type="text"],
select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #fafafa;
}

input[type="url"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select {
    padding-left: 16px;
    cursor: pointer;
    background: #fafafa;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background: #5558e3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn svg {
    width: 18px;
    height: 18px;
}

/* 高级设置 */
.advanced-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    user-select: none;
}

.advanced-toggle:hover {
    background: #f5f5ff;
}

.advanced-toggle svg {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    transition: transform 0.3s;
}

.advanced-toggle.active svg {
    transform: rotate(180deg);
}

.advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.advanced-content.show {
    max-height: 800px;
}

.advanced-inner {
    padding-top: 20px;
}

/* 使用提示 */
.info-box {
    background: #f5f7fa;
    border-left: 3px solid #6366f1;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 20px;
}

.info-box-title {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.info-box-title svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    color: #6366f1;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.8;
}

/* 结果卡片 */
.result-card {
    display: none;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    animation: slideIn 0.4s ease-out;
}

.result-card.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-title {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #166534;
    margin-bottom: 15px;
}

.result-title svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.result-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.result-url-group {
    flex: 1;
    position: relative;
}

.result-url-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.result-url-icon svg {
    width: 20px;
    height: 20px;
    color: #6366f1;
}

.result-url {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6366f1;
}

.copy-btn {
    padding: 12px 24px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #5558e3;
}

.copy-btn.copied {
    background: #22c55e;
}

.result-meta {
    font-size: 0.875rem;
    color: #15803d;
    line-height: 1.6;
}

.result-meta div {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.result-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

/* 错误提示 */
.alert-danger {
    display: none;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    margin-top: 15px;
    color: #991b1b;
    font-size: 0.9rem;
}

.alert-danger.show {
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .tool-card {
        padding: 25px 20px;
    }

    .result-url-box {
        flex-wrap: wrap;
    }

    .result-url-group {
        width: 100%;
        order: 1;
    }

    .copy-btn {
        width: 100%;
        order: 2;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
