.serp-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #6366f1; --p-text: #0f172a; width: 100%; max-width: 1400px; margin: 0 auto; background: var(--p-bg); border-radius: 24px; padding: 32px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); transition: 0.3s; }
.serp-header-main { font-size: 1.6rem; font-weight: 700; color: var(--p-text); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.serp-badge { background: #e0e7ff; color: #4338ca; padding: 4px 12px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; border: 1px solid #c7d2fe; }
.serp-subtitle { color: #64748b; font-size: 1rem; padding-bottom: 20px; border-bottom: 1px solid var(--p-border); margin-bottom: 24px; text-align: center; max-width: 900px; margin-left: auto; margin-right: auto; line-height: 1.6; }

.serp-panel { background: #f8fafc; border: 1px solid var(--p-border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; margin-bottom: 24px; }
.serp-panel-title { font-weight: 700; color: var(--p-text); font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--p-border); }

/* 配置栏与输入框 */
.serp-api-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.serp-input-sm { padding: 10px 14px; font-size: 0.9rem; border-radius: 10px; min-width: 320px; background: #f1f5f9; border: 1px solid #cbd5e1; outline: none; transition: 0.2s; }
.serp-input-sm:focus { border-color: var(--p-primary); background: #ffffff; }
.serp-api-link { font-size: 0.9rem; color: var(--p-primary); text-decoration: none; font-weight: 600; }
.serp-api-link:hover { text-decoration: underline; }

.serp-search-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
@media(max-width: 800px) { .serp-search-row { flex-direction: column; } }

.serp-input-lg { flex: 1; min-width: 280px; padding: 14px 16px; background: #ffffff; border: 2px solid #cbd5e1; color: var(--p-text); border-radius: 12px; outline: none; font-size: 1.05rem; transition: 0.2s; }
.serp-input-lg:focus { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

.serp-select { padding: 0 16px; border: 2px solid #cbd5e1; border-radius: 12px; background: #ffffff; font-size: 0.95rem; color: var(--p-text); outline: none; cursor: pointer; min-width: 140px; }
.serp-select:focus { border-color: var(--p-primary); }

.serp-btn-primary { background: var(--p-primary); color: white; border: none; padding: 14px 32px; border-radius: 12px; font-weight: bold; font-size: 1.05rem; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); white-space: nowrap; }
.serp-btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }
.serp-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.serp-loading-box { text-align: center; padding: 40px 0; background: #ffffff; border-radius: 12px; border: 1px dashed #cbd5e1; margin-top: 20px; }
.serp-spinner { width: 40px; height: 40px; border: 4px solid rgba(99, 102, 241, 0.2); border-left-color: var(--p-primary); border-radius: 50%; animation: serpSpin 1s linear infinite; margin: 0 auto; }
@keyframes serpSpin { to { transform: rotate(360deg); } }
.serp-error-box { margin-top: 20px; padding: 16px; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; border-radius: 12px; font-size: 0.95rem; line-height: 1.6; }

/* 核心看板布局 */
.serp-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
@media(max-width: 1000px) { .serp-layout { grid-template-columns: 1fr; } }

.serp-section-title { font-weight: 800; font-size: 1.2rem; color: var(--p-text); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #e2e8f0; }

/* 自然搜索排名卡片 (高度还原 Google 质感并美化) */
.serp-organic-list { display: flex; flex-direction: column; gap: 16px; }
.serp-result-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; transition: 0.2s; position: relative; overflow: hidden; }
.serp-result-card:hover { border-color: #cbd5e1; box-shadow: 0 8px 20px rgba(0,0,0,0.04); transform: translateY(-2px); }
.serp-rank-badge { position: absolute; top: 0; right: 0; background: #f1f5f9; color: #64748b; font-weight: 800; font-size: 0.9rem; padding: 6px 16px; border-bottom-left-radius: 16px; border-left: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }

.serp-card-url { font-size: 0.85rem; color: #475569; margin-bottom: 6px; display: block; text-decoration: none; word-break: break-all; }
.serp-card-title { font-size: 1.25rem; font-weight: 600; color: #2563eb; text-decoration: none; line-height: 1.4; display: block; margin-bottom: 10px; }
.serp-card-title:hover { text-decoration: underline; }
.serp-card-desc { font-size: 0.95rem; color: #334155; line-height: 1.6; }

/* 侧边栏卡片 */
.serp-side-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.serp-side-title { font-weight: 700; color: var(--p-text); font-size: 1.05rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }

.serp-paa-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.serp-paa-item { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; font-size: 0.95rem; color: #475569; font-weight: 500; cursor: default; transition: 0.2s; }
.serp-paa-item:hover { border-color: #cbd5e1; background: #f1f5f9; color: var(--p-primary); }

.serp-tags-box { display: flex; flex-wrap: wrap; gap: 8px; }
.serp-tag { background: #ffffff; border: 1px solid #cbd5e1; color: #475569; font-size: 0.85rem; padding: 6px 14px; border-radius: 20px; text-decoration: none; transition: 0.2s; font-weight: 500; }
.serp-tag:hover { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }

/* 黑夜模式 */
[data-theme="dark"] .serp-tool-wrapper { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .serp-panel, [data-theme="dark"] .serp-side-card { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .serp-panel-title, [data-theme="dark"] .serp-section-title, [data-theme="dark"] .serp-side-title { border-bottom-color: #475569; }
[data-theme="dark"] .serp-input-sm, [data-theme="dark"] .serp-input-lg, [data-theme="dark"] .serp-select { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .serp-input-sm:focus, [data-theme="dark"] .serp-input-lg:focus, [data-theme="dark"] .serp-select:focus { border-color: var(--p-primary); }
[data-theme="dark"] .serp-loading-box { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .serp-result-card { background: #1e293b; border-color: #475569; }
[data-theme="dark"] .serp-result-card:hover { border-color: #64748b; }
[data-theme="dark"] .serp-rank-badge { background: #334155; color: #cbd5e1; border-color: #475569; }
[data-theme="dark"] .serp-card-url { color: #94a3b8; }
[data-theme="dark"] .serp-card-title { color: #60a5fa; }
[data-theme="dark"] .serp-card-desc { color: #cbd5e1; }
[data-theme="dark"] .serp-paa-item { background: #1e293b; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .serp-paa-item:hover { background: #334155; border-color: #64748b; color: #c4b5fd; }
[data-theme="dark"] .serp-tag { background: #1e293b; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .serp-tag:hover { background: rgba(99, 102, 241, 0.2); color: #c4b5fd; border-color: #6366f1; }