:root{
    --bg-0: #f5f7fb;
    --bg-1: linear-gradient(135deg,#10203a 0%, #1b4b78 100%);
    --accent: #4299e1;
    --muted: #718096;
    --card-bg: #ffffff;
    --radius: 10px;
    --glass: rgba(255,255,255,0.06);
    --transition: 240ms cubic-bezier(.2,.9,.3,1);
    --shadow-sm: 0 6px 18px rgba(16,24,40,0.06);
    --shadow-md: 0 10px 30px rgba(16,24,40,0.1);
    --p2p-text: #063f4a;
    --p2p-muted: #0b6b79;
    --p2p-accent: #087b9a;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}
        
body{
    background: var(--bg-0);
    color: #0f1724;
    line-height:1.6;
    -webkit-font-smoothing:antialiased;
}
        
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
        
/* 导航栏 */
.navbar {
    background: rgba(26,54,93,0.96);
    color: white;
    padding: 18px 0;
    box-shadow: var(--shadow-md);
    position: relative;
    backdrop-filter: blur(6px);
}
        
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
        
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
        
.logo i {
    font-size: 28px;
    color: var(--accent);
    transition: transform var(--transition), color var(--transition);
}
        
.logo h1 {
    font-size: 24px;
    font-weight: 600;
}
        
nav {
    display: flex;
    gap: 25px;
    align-items: center;
}
        
nav a {
    color: rgba(203,213,224,0.9);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}
        
nav a:hover {
    color: white;
}
        
nav a.active {
    color: white;
    font-weight: 600;
}
        
.login-btn {
    background-color: var(--accent);
    color: white;
    padding: 10px 22px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
        
/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}
        
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #4299e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
        
/* 权限选择器 */
.access-selector {
    position: absolute;
    top: 74px;
    right: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    width: 320px;
    display: none;
    transform-origin: top right;
    transition: transform var(--transition), opacity var(--transition);
    opacity: 0;
}
        
.access-selector h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}
        
.access-level {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    border: 1px solid #eef2f7;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
}
        
.access-level:hover {
    background-color: #f7fafc;
}
        
.access-level.active {
    border-color: var(--accent);
    background: linear-gradient(90deg, rgba(66,153,225,0.06), rgba(66,153,225,0.02));
    box-shadow: 0 6px 18px rgba(66,153,225,0.06);
}
        
.access-level h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: #2d3748;
}
        
.access-level p {
    font-size: 14px;
    color: #718096;
}
        
.public-level {
    border-left: 4px solid #48bb78;
}
        
.internal-level {
    border-left: 4px solid #4299e1;
}
        
.secret-level {
    border-left: 4px solid #e53e3e;
}
        
/* 主要搜索区域 */
.hero {
    padding: 64px 0 48px;
    text-align: center;
    background: var(--bg-1);
    color: white;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}
        
.hero h2 {
    font-size: 34px;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-shadow: 0 4px 18px rgba(10,25,40,0.2);
}
        
.hero p {
    font-size: 18px;
    margin-bottom: 40px;
    color: #cbd5e0;
}
        
/* 搜索框 */
.search-container {
    max-width: 920px;
    margin: 0 auto 30px;
}
        
.search-box {
    display:flex;
    align-items:center;
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid rgba(10,20,40,0.04);
}
        
.search-box i {
    padding: 16px 20px;
    color: var(--muted);
    font-size: 18px;
    transition: color var(--transition), transform var(--transition);
}
        
.search-box input{
    flex:1;
    border:none;
    padding:16px 12px;
    font-size:16px;
    outline:none;
    background:transparent;
}
        
.search-box button{
    background: linear-gradient(90deg,var(--accent), #3182ce);
    color:white;
    border:none;
    padding:14px 26px;
    margin:10px;
    border-radius:999px;
    font-weight:700;
    cursor:pointer;
    box-shadow: 0 8px 26px rgba(66,153,225,0.12);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.search-box button:hover{ transform: translateY(-3px); opacity:0.98; }

.search-box:focus-within{ transform: translateY(-4px); box-shadow: 0 18px 40px rgba(10,25,40,0.12); }
        
/* 搜索引擎选择 */
.engine-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
        
.engine-btn {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.06);
    padding:8px 20px;
    border-radius:999px;
    cursor:pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    display:flex; align-items:center; gap:8px;
}
        
.engine-btn.active {
    background: rgba(66,153,225,0.14);
    border-color: rgba(66,153,225,0.28);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(66,153,225,0.08);
}
        
/* 结果区域 */
.results-section {
    padding: 40px 0;
}
        
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
        
.results-header h3 {
    font-size: 24px;
    color: #2d3748;
}
        
.access-info {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
        
/* 结果容器 */
.results-container {
    display: flex;
    gap: 30px;
}
        
/* 结果列表 */
.results-list {
    flex: 1;
}
        
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}
        
.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #cbd5e0;
}
        
.no-results p {
    font-size: 18px;
}
        
/* 结果项样式 */
.result-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInUp 420ms ease forwards;
}
        
.result-item:hover {
    box-shadow: 0 18px 48px rgba(10,20,40,0.08);
    transform: translateY(-4px);
}
        
.access-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
        
.public-badge {
    background-color: #c6f6d5;
    color: #22543d;
}
        
.internal-badge {
    background-color: #bee3f8;
    color: #2b6cb0;
}
        
.secret-badge {
    background-color: #fed7d7;
    color: #742a2a;
}
        
.result-title {
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
    padding-right: 80px;
}
        
.result-title a {
    color: #2d3748;
    text-decoration: none;
}
        
.result-title a:hover {
    color: #4299e1;
    text-decoration: underline;
}
        
.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #718096;
}
        
.result-excerpt {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.7;
}
        
.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}
        
.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
        
.result-tag {
    background-color: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}
        
.result-actions {
    display: flex;
    gap: 15px;
}
        
.result-actions button {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: color 0.3s;
}
        
.result-actions button:hover {
    color: #4299e1;
}
        
/* 页脚 */
footer {
    background-color: #2d3748;
    color: #cbd5e0;
    padding: 40px 0 20px;
    margin-top: 60px;
}

/* Animations */
@keyframes fadeInUp{ from{ opacity:0; transform: translateY(12px);} to{ opacity:1; transform: translateY(0);} }

/* access selector visible state managed by inline style; add subtle transition helper */
.access-selector.show{ opacity:1; transform: translateY(0); }

/* P2P panel and chat */
.p2p-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 360px;
    max-height: 72vh;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), opacity var(--transition);
    color: var(--p2p-text);
}

/* Buttons */
.p2p-panel button, .search-container button, .engine-btn, .btn {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn { padding:8px 12px; border-radius:8px; background:#f3f6fb; color:#0f1724; border:1px solid rgba(10,20,40,0.04); }
.btn:hover{ transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,0.06); }
.btn-primary{ background: linear-gradient(90deg,var(--accent),#3182ce); color:#fff; border:none; }
.btn-ghost{ background: transparent; color:var(--muted); border:1px solid rgba(10,20,40,0.04); }
.btn-sm{ padding:6px 10px; border-radius:6px; font-size:13px; }

/* Floating ball when panel minimized */
.p2p-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(180deg,var(--accent), #2b82c4);
    color: white;
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 12px 36px rgba(16,24,40,0.18);
    cursor: pointer;
    z-index: 9999;
    transition: transform var(--transition), opacity var(--transition);
}


.p2p-header {
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(66,153,225,0.06), rgba(250,250,250,0.02));
    display:flex; align-items:center; justify-content:space-between; gap:8px;
}

.p2p-body { padding: 12px; overflow:auto; flex:1; }

.peer-item { display:flex; align-items:center; gap:10px; padding:8px; border-radius:8px; margin-bottom:8px; background:rgba(245,252,255,0.8); }
.peer-name { font-weight:800; color: var(--p2p-text); }
.peer-status { font-size:12px; color: var(--p2p-muted); }

.chat-box { border-top:1px dashed rgba(10,20,40,0.04); padding-top:10px; }
.chat-messages { max-height:160px; overflow:auto; margin-bottom:8px; }
.chat-message { margin-bottom:6px; font-size:13px; color: var(--p2p-text); }
.chat-input { display:flex; gap:8px; }
.chat-input input { flex:1; padding:8px 10px; border-radius:8px; border:1px solid #eef2f7; }
.chat-input button { padding:8px 12px; border-radius:8px; background:var(--accent); color:#fff; border:none; }

.file-list { margin-top:8px; }
.file-item { display:flex; justify-content:space-between; gap:8px; padding:6px 8px; border-radius:6px; background:linear-gradient(180deg,#f8fbff,#f4fbff); margin-bottom:6px; font-size:13px; color: var(--p2p-text); }

/* torrent controls removed */
        
.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}
        
.footer-section {
    flex: 1;
    min-width: 250px;
}
        
.footer-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 18px;
}
        
.footer-section p {
    font-size: 14px;
    line-height: 1.7;
}
        
.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
    font-size: 14px;
}
        
/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
        
    .hero h2 {
        font-size: 28px;
    }
        
    .search-box {
        flex-direction: column;
    }
        
    .search-box button {
        padding: 15px;
        width: 100%;
    }
        
    .access-selector {
        top: 120px;
        left: 20px;
        right: 20px;
        width: auto;
    }
}

/* Additional P2P panel styles (previously inline near body end) */
.p2p-panel{ position:fixed; right:18px; bottom:18px; width:760px; max-height:96vh; display:flex; flex-direction:column; background:linear-gradient(180deg,#ffffffcc,#f7f9fccc); border-radius:12px; box-shadow:0 14px 60px rgba(19,35,66,0.18); overflow:hidden; font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; color:#0b1220; }
.p2p-header{ display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-bottom:1px solid rgba(15,23,42,0.06); background:linear-gradient(180deg,#fbfdff,#f4f8fb); }
.p2p-header strong{ font-size:15px; letter-spacing:0.2px; }
/* ensure header right side doesn't wrap and controls stay compact */
.p2p-header > div:last-child{ display:flex; gap:8px; align-items:center; flex-wrap:nowrap; }
#p2pHeaderControls{ display:flex; gap:8px; align-items:center; min-width:0; }
#p2pHeaderControls input{ height:30px; padding:4px 8px; border-radius:6px; border:1px solid rgba(15,23,42,0.06); background:rgba(255,255,255,0.9); font-size:12px; max-width:180px; width:140px; box-sizing:border-box; }
#p2pHeaderControls button{ height:34px; padding:6px 12px; border-radius:8px; border:none; background:linear-gradient(90deg,#2563eb,#1e40af); color:#fff; font-size:13px; cursor:pointer; min-width:86px; }
#p2pStatus{ padding:4px 8px; border-radius:999px; background:#f3f4f6; color:#374151; font-weight:600; }
.p2p-body{ padding:12px; display:flex; flex-direction:column; gap:10px; overflow:auto; }
#peersList .peer-item{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:8px; background:rgba(245,247,250,0.7); margin-bottom:8px; }
.peer-name{ font-weight:600; font-size:13px; }
.peer-status{ font-size:12px; color:#64748b; }
.chat-box{ border-top:1px dashed rgba(15,23,42,0.04); padding-top:8px; }
.chat-messages{ max-height:340px; overflow:auto; padding:10px; background:linear-gradient(180deg,#fff,#fbfdff); border-radius:10px; }
.chat-message{ padding:6px 8px; margin-bottom:6px; background:#eef2ff; border-radius:6px; font-size:13px; }
.chat-input{ display:flex; gap:8px; margin-top:8px; }
.chat-input input{ flex:1; height:34px; padding:6px 8px; border-radius:8px; border:1px solid rgba(15,23,42,0.06); }
.file-list .file-item{ padding:8px; border-radius:6px; background:rgba(255,255,255,0.6); margin-top:6px; display:flex; justify-content:space-between; align-items:center; }
/* floating button */
.p2p-float{ position:fixed; right:20px; bottom:20px; width:48px; height:48px; border-radius:50%; background:linear-gradient(180deg,#1e3a8a,#1e40af); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(30,58,138,0.25); cursor:pointer; z-index:12000; }
.p2p-float i{ font-size:18px; }
/* responsive */
@media (max-width:1200px){ .p2p-panel{ right:12px; left:12px; width:auto; bottom:12px; max-height:92vh; } }
