/* ============================================================
   全局重置 & 基础样式
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   头部
   ============================================================ */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}
.logo .icon { font-size: 28px; }
.logo .badge {
    background: rgba(255,255,255,0.15);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary {
    background: #4f6ef7;
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #3b5de7; }
.btn-success {
    background: #52c41a;
    color: #fff;
}
.btn-success:hover:not(:disabled) { background: #45a817; }
.btn-outline {
    background: transparent;
    color: #4f6ef7;
    border: 1.5px solid #4f6ef7;
}
.btn-outline:hover:not(:disabled) {
    background: #4f6ef7;
    color: #fff;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.card-body { padding: 20px 24px; }

/* ============================================================
   表单
   ============================================================ */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d9d9d9;
    border-radius: 10px;
    font-size: 14px;
    transition: border 0.2s;
    background: #fafafa;
}
.form-control:focus {
    outline: none;
    border-color: #4f6ef7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}
.search-wrapper {
    display: flex;
    gap: 12px;
}
.search-wrapper .form-control { flex: 1; }
@media (max-width: 500px) { .search-wrapper { flex-direction: column; } }

/* ============================================================
   搜索提示
   ============================================================ */
.search-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #ff0000;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.search-hint .tag {
    background: #f0f2f5;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
}

/* ============================================================
   结果列表
   ============================================================ */
.result-list { margin-top: 16px; }
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
    flex-wrap: wrap;
    gap: 10px;
}
.result-item:hover {
    background: #f0f2ff;
    border-left-color: #4f6ef7;
}
.result-item .info { flex: 1; min-width: 200px; }
.result-item .title {
    font-weight: 500;
    font-size: 15px;
    color: #1a1a2e;
    word-break: break-word;
}
.result-item .meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.result-item .actions { flex-shrink: 0; display: flex; gap: 8px; }

/* ============================================================
   状态标签
   ============================================================ */
.result-item .status-badge {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    background: #e8e8e8;
    color: #666;
}
.result-item .status-badge.done {
    background: #f6ffed;
    color: #ff0000;
}
.result-item .status-badge.processing {
    background: #fff7e6;
    color: #faad14;
}
.result-item .status-badge.error {
    background: #fff1f0;
    color: #ff4d4f;
}

/* ============================================================
   来源标签
   ============================================================ */
.source-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.source-badge.api1 { background: #e6f7ff; color: #1890ff; }
.source-badge.api2 { background: #f6ffed; color: #52c41a; }

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   分享链接框
   ============================================================ */
.share-link-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f6ffed;
    border-radius: 8px;
    border: 1px solid #b7eb8f;
    font-size: 13px;
    word-break: break-all;
}
.share-link-box a { color: #4f6ef7; text-decoration: none; }
.share-link-box a:hover { text-decoration: underline; }

/* ============================================================
   Toast 通知
   ============================================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.82);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: fadeInUp 0.3s ease;
    max-width: 90%;
    text-align: center;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   加载动画
   ============================================================ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   页脚
   ============================================================ */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

/* ============================================================
   验证码弹窗
   ============================================================ */
#captchaModal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
#captchaModal .modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
#captchaModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
#captchaModal .modal-header h3 { font-size: 18px; margin: 0; }
#captchaModal .modal-close {
    background: none; border: none;
    font-size: 24px; cursor: pointer; color: #999;
}
#captchaModal .modal-close:hover { color: #333; }
#captchaModal .captcha-image-wrap { text-align: center; margin-bottom: 16px; }
#captchaModal .captcha-image-wrap p {
    font-size: 13px; color: #666; margin-bottom: 12px;
}
#captchaModal .captcha-image-box {
    background: #f5f6fa; border-radius: 8px;
    padding: 8px; display: inline-block;
}
#captchaModal .captcha-image-box img {
    max-width: 100%; height: auto; border-radius: 4px;
}
#captchaModal .captcha-input-wrap { margin-bottom: 16px; }
#captchaModal .captcha-input-wrap input {
    text-align: center; font-size: 20px; letter-spacing: 8px;
}
#captchaModal .captcha-actions { display: flex; gap: 10px; }
#captchaModal .captcha-actions .btn { flex: 1; }
#captchaModal .captcha-actions .btn-primary { flex: 2; }
#captchaModal .captcha-error {
    color: #ff4d4f; font-size: 13px;
    margin-top: 12px; text-align: center; display: none;
}
#captchaModal .captcha-info {
    margin-top: 12px; font-size: 12px; color: #999; text-align: center;
}

/* ============================================================
   滚动条
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============================================================
   调试信息
   ============================================================ */
.debug-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff7e6;
    border-radius: 8px;
    border: 1px solid #ffd591;
    text-align: left;
    font-size: 12px;
}
.debug-info strong { color: #d48806; }
.debug-info .error-line { margin-top: 4px; color: #666; }