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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
    --shadow-hover: 0 15px 50px rgba(99, 102, 241, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin: 80px 0 50px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 4rem;
    font-weight: 200;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: -2px;
}

.main {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease-out;
    transition: box-shadow 0.3s ease;
}

.main:hover {
    box-shadow: var(--shadow-hover);
}

.search-box {
    display: flex;
    position: relative;
    height: 60px;
    /* 只在这里设置一次圆角，整个搜索框的圆角都由这里控制 */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

#search-input {
    flex: 1;
    padding: 0 24px;
    padding-right: 16px;
    font-size: 18px;
    border: none;
    border-radius: 0;
    outline: none;
    transition: all 0.3s ease;
    background: #f8fafc;
    height: 100%;
}

#search-input:focus {
    background: white;
}

#search-btn {
    width: 110px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 0;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

#search-btn:active {
    transform: scale(0.98);
}
.suggestions {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-top: -8px;
    margin-bottom: 24px;
    display: none;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.suggestion-item {
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8fafc;
}

/* ========== 以下是修复后的全卡片布局样式 ========== */

/* 搜索结果卡片容器 */
.results {
    margin-top: 40px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 普通搜索结果卡片 */
.result-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
    border: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

.result-card-content {
    flex: 1;
     min-width: 0;
    min-width: 0;
}

.result-card-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visit-btn {
    padding: 10px 20px;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
        margin-top: 20px;
}

.visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
    color: white;
    text-decoration: none;
}

.result-title {
    font-size: 20px;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 12px;
    display: inline-block;
    transition: color 0.2s ease;
    font-weight: 600;
}

.result-title:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.result-url {
    color: #10b981;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    /* 确保URL容器也不会溢出 */
    max-width: 100%;
    min-width: 0;
}

.result-url::before {
    content: "🔗";
    font-size: 12px;
    flex-shrink: 0;
}

.result-desc {
    color: #64748b;
    line-height: 1.7;
    font-size: 15px;
    /* 描述也防止超长文本溢出 */
    word-break: break-word;
}
.result-url-text {
    /* 核心：确保长文本省略在所有设备上都生效 */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0; /* 关键：解决flex布局下text-overflow不生效的问题 */
}
/* 手机端：最多显示2行URL */
@media (max-width: 768px) {
    .result-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-card-content {
        width: 100%;
    }
    
    .result-card-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .visit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .result-url-text {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
    }
}
/* 高德地图搜索结果卡片 */
.map-result-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: fadeIn 0.6s ease-out;
}

.map-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.map-card-icon {
    font-size: 36px;
    margin-right: 20px;
    opacity: 0.9;
}

.map-card-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.map-card-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

.map-card-body {
    margin-bottom: 25px;
}

.map-card-desc {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
}

.map-card-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.map-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: white;
    color: #059669;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.map-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: #047857;
}

.map-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.map-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 相关结果标题 */
.section-title {
    margin-bottom: 5px;
    color: #334155;
    font-weight: 600;
    font-size: 18px;
    padding-left: 4px;
}

/* 无结果提示卡片 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 18px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* 加载状态卡片 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary);
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.loading::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* ========== 以上是修复后的全卡片布局样式 ========== */

.footer {
    text-align: center;
    margin-top: 50px;
    color: #64748b;
    font-size: 14px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* 移动端适配 */
@media (max-width: 768px) {
    .logo {
        font-size: 2.8rem;
    }
    
    .main {
        padding: 30px 20px;
    }
    
    .search-box {
        height: 56px;
    }
    
    #search-input {
        padding: 0 20px;
        font-size: 16px;
    }
    
    #search-btn {
        width: 90px;
        font-size: 16px;
    }
    
    .result-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-card-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .visit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .map-result-card {
        padding: 20px;
    }
    
    .map-card-title {
        font-size: 20px;
    }
    
    .map-card-actions {
        flex-direction: column;
    }
    
    .map-btn {
        width: 100%;
        justify-content: center;
    }
}