/* ========== 美化全局样式 ========== */
:root {
    --primary: #6366f1;
    --primary-light: #a5b4fc;
    --primary-bg: #eef2ff;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-bg-solid: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
    --radius: 20px;
    --radius-sm: 14px;
    --footer-bg: rgba(255,255,255,0.5);
    --footer-text: #444444;
    --footer-link: #6366f1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 50%, #f8fafc 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar { width:8px; }
::-webkit-scrollbar-track { background:rgba(241,245,249,0.5); border-radius:10px; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:#94a3b8; }

.navbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.6);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-brand .icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(102,126,234,0.4);
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform:translateY(0); }
    50% { transform:translateY(-5px); }
}
.nav-links { display:flex; gap:16px; align-items:center; }
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}
.nav-links a:hover {
    background: var(--primary-bg);
    color: var(--primary);
}
.user-avatar {
    width: 38px; height:38px; border-radius:50%;
    background: var(--gradient);
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-size:17px; font-weight:700;
    cursor:pointer; object-fit:cover;
    box-shadow:0 3px 10px rgba(102,126,234,0.4);
}
.user-avatar:hover { transform:scale(1.08); }

.main-container { flex:1; max-width:960px; width:100%; margin:0 auto; padding:48px 24px 80px; }

.search-section { text-align:center; margin-bottom:56px; }
.logo-large { font-size:72px; margin-bottom:20px; animation:float 4s ease-in-out infinite; }
.search-section h1 {
    font-size:2.8rem; font-weight:800; margin-bottom:12px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.8px;
}
.subtitle { color:var(--text-light); margin-bottom:40px; font-size:1.1rem; }

.search-box { display:flex; gap:12px; max-width:760px; margin:0 auto 24px; }
.search-input-wrap {
    flex:1; display:flex; align-items:center;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border:2px solid var(--border);
    border-radius:60px;
    padding:4px 8px 4px 24px;
    box-shadow: var(--shadow-sm);
}
.search-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(99,102,241,0.12), 0 8px 24px rgba(99,102,241,0.15);
}
.search-icon { font-size:1.3rem; margin-right:12px; color:var(--text-muted); }
#searchInput { flex:1; border:none; outline:none; font-size:1.1rem; padding:16px 0; background:transparent; }
#searchInput::placeholder { color:#a0aec0; }
#clearBtn { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:10px 16px; border-radius:50%; font-size:1.1rem; display:none; }
#clearBtn.visible { display:block; }
#clearBtn:hover { background:#f1f5f9; }

#generateBtn {
    padding:16px 40px;
    background: var(--gradient);
    color:#fff; border:none; border-radius:60px;
    font-size:1.1rem; font-weight:600;
    cursor:pointer; white-space:nowrap;
    box-shadow:0 10px 28px rgba(102,126,234,0.45);
}
#generateBtn:hover { box-shadow:0 16px 36px rgba(102,126,234,0.55); }
#generateBtn:disabled { background:#c7d2fe; cursor:not-allowed; box-shadow:none; }

.hot-questions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:12px; }
.hot-tag {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border:1px solid var(--border);
    padding:8px 20px;
    border-radius:30px;
    font-size:0.9rem;
    color:var(--text-light);
    cursor:pointer;
}
.hot-tag:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: rgba(255,255,255,0.9);
}

#messageBox { text-align:center; margin:24px 0; min-height:36px; font-weight:500; }
.msg-success { color:#059669; } .msg-error { color:#dc2626; } .msg-info { color:var(--text-light); }

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding:32px 36px;
    box-shadow: var(--shadow);
    border:1px solid rgba(255,255,255,0.5);
    display:none;
    margin-bottom:40px;
}
.result-card.active { display:block; animation:fadeInUp 0.5s ease; }
@keyframes fadeInUp {
    from { opacity:0; transform:translateY(24px); }
    to { opacity:1; transform:translateY(0); }
}

.result-header { display:flex; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.result-badge {
    background: #d1fae5;
    color:#065f46;
    padding:8px 18px;
    border-radius:30px;
    font-weight:600;
}

.btn-primary, .btn-outline, .btn-danger {
    padding:10px 22px; 
    border-radius:30px;
    font-size:0.9rem;
    font-weight:500;
    text-decoration:none;
    display:inline-flex; 
    align-items:center; 
    gap:6px;
    cursor:pointer;
    white-space: nowrap;
}
.btn-primary {
    background: var(--gradient);
    color:#fff;
    border:none;
    box-shadow:0 6px 16px rgba(102,126,234,0.35);
}
.btn-outline {
    font-weight: normal;
    border:1px solid var(--border);
    background: var(--card-bg-solid);
    color: var(--text);
}
.btn-outline:hover { background:#f8fafc; }
.btn-danger {
    border:1px solid #fecaca;
    background:#fef2f2; 
    color:#dc2626; 
}
.btn-danger:hover { background:#fee2e2; }

.result-question {
    background: var(--primary-bg); border-radius: var(--radius-sm); padding:18px 22px;
    margin-bottom:20px; border-left:4px solid var(--primary);
    font-weight:500;
}
.result-preview {
    background: #fafbfc; border-radius: var(--radius-sm); padding:24px;
    border:1px solid var(--border); max-height:320px; overflow-y:auto;
    line-height:1.8; font-size:0.95rem; color:#334155;
}

.file-list-section {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding:32px 36px;
    box-shadow: var(--shadow);
    border:1px solid rgba(255,255,255,0.5);
}
.file-list-header { display:flex; justify-content:space-between; margin-bottom:28px; flex-wrap:wrap; gap:12px; }
.search-files-box {
    display:flex; align-items:center; gap:8px;
    background: rgba(241,245,249,0.8);
    backdrop-filter: blur(6px);
    border-radius:30px;
    padding:4px 4px 4px 18px;
    border:1px solid var(--border);
}
#fileSearchInput { border:none; outline:none; background:transparent; font-size:0.9rem; padding:8px 0; width:180px; }
#fileSearchBtn {
    background: var(--primary); color:#fff; border:none;
    padding:8px 18px; border-radius:24px;
    cursor:pointer; font-size:0.85rem;
}
#fileSearchBtn:hover { background:#4338ca; }

.notice-box {
    background:#fffbeb; border:1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding:12px 18px; margin-bottom:20px;
    font-size:0.85rem; color:#92400e;
    display: flex; align-items: center; gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
    flex-wrap: wrap;
    border-radius: var(--radius-sm);
    margin: 0 -12px;
}
.file-item:hover {
    background: rgba(241, 245, 249, 0.7);
    border-bottom-color: transparent;
}
.file-item:last-child { border-bottom: none; }

.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.file-info > span {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.file-name {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-name a {
    color: #000000;
    text-decoration: none;
    font-weight: normal;
}
.file-name a:hover { color: var(--primary); }

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.pagination { display:flex; justify-content:center; gap:10px; margin-top:28px; flex-wrap:wrap; }
.page-btn {
    padding:10px 18px; border:1px solid var(--border);
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    border-radius:12px; cursor:pointer;
    font-size:0.9rem; font-weight:500;
}
.page-btn.active { background: var(--gradient); color:#fff; border-color:transparent; box-shadow:0 6px 18px rgba(79,70,229,0.4); }
.page-btn:hover:not(:disabled) {
    background: var(--primary-bg);
    border-color: var(--primary-light);
}

.modal-overlay {
    display:none; position:fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(6px);
    z-index:200; align-items:center; justify-content:center;
}
.modal-overlay.active { display:flex; }
.modal {
    background: var(--card-bg);
    backdrop-filter: blur(28px);
    border-radius: var(--radius);
    padding:32px; max-width:420px; width:90%;
    text-align:center;
    box-shadow: var(--shadow-lg);
    border:1px solid rgba(255,255,255,0.7);
}
.modal input { width:100%; padding:12px 18px; border:2px solid var(--border); border-radius:14px; margin:14px 0; font-size:0.95rem; }
.modal input:focus { border-color: var(--primary); box-shadow:0 0 0 5px rgba(99,102,241,0.1); outline:none; }
.modal .btn-group { display:flex; gap:10px; justify-content:center; margin-top:20px; }

/* 页脚 - 半透明白底 */
.footer {
    text-align:center; padding:28px 20px;
    background: var(--footer-bg);
    color: var(--footer-text);
    font-size:0.85rem;
    border-top:1px solid rgba(0,0,0,0.05);
}
.footer a { 
    color: var(--footer-link); 
    text-decoration:none; 
}

/* 友情链接样式 - 间距5px */
.friend-links {
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    align-items: center;
}
.friend-links strong {
    color: #444444;
    margin-right: 4px;
}
.friend-links a {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: transparent;
    color: #444444;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.friend-links a:hover {
    background: rgba(36,120,224,0.1);
    color: #2478E0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .navbar { padding:0 18px; height:60px; }
    .nav-brand { font-size:1.1rem; }
    .main-container { padding:24px 16px 48px; }
    .search-section h1 { font-size:2rem; }
    .logo-large { font-size:52px; }
    .search-box { flex-direction:column; gap:14px; }
    #generateBtn { width:100%; justify-content:center; }
    .result-card, .file-list-section { padding:24px 20px; }
    .file-list-header { flex-direction:column; align-items:flex-start; }
    .search-files-box { width:100%; }
    #fileSearchInput { flex:1; }
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        margin: 0;
    }
    .file-info { width: 100%; }
    .file-name {
        max-width: 100%;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .file-actions { width: 100%; justify-content: flex-end; }
    .page-btn { padding:8px 14px; font-size:0.85rem; }
    .modal { padding:24px; }

    .friend-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .friend-links strong {
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    .friend-links a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}