/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .logo {
        font-size: 2rem;
    }
    .search-engines {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    .engine-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
        flex: 0 0 auto;
        min-width: fit-content;
    }
    .search-input {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    .search-btn {
        padding: 12px 25px;
    }
    .site-links {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .tools-nav .nav-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 0;
        max-width: 100%;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: fit-content;
        border-radius: 15px;
    }
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .tool-card {
        padding: 20px;
    }
    .tool-card h3 {
        font-size: 1.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tool-card p {
        font-size: 0.9rem;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.5;
    }
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 0 20px;
    border-bottom: none;
}

.logo {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 201, 255, 0.3);
    margin-bottom: 15px;
}

.header-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.weather-info, .datetime-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-icon {
    font-size: 1.2rem;
}

.weather-text, .date-text, .time-text {
    color: #ddd;
    font-size: 0.9rem;
}

.datetime-info {
    gap: 15px;
}

/* 搜索区域样式 */
.search-section {
    padding: 30px 0;
    display: flex;
    justify-content: center;
}

.search-container {
    width: 100%;
    max-width: 800px;
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.engine-btn {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.engine-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.engine-btn.active {
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    color: #000;
    font-weight: bold;
    border-color: transparent;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 18px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(0, 201, 255, 0.3);
    border-color: rgba(0, 201, 255, 0.5);
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    padding: 18px 40px;
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    border: none;
    border-radius: 50px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 201, 255, 0.4);
}

/* 推荐站点样式 */
.recommended-sites {
    padding: 30px 0;
    margin-bottom: 30px;
}

.section-title {
    text-align: center;
    color: #00c9ff;
    font-size: 1.8rem;
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    border-radius: 2px;
}

.sites-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.site-category h3 {
    color: #92fe9d;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid #92fe9d;
}

.site-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.site-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #ddd;
    transition: all 0.3s ease;
}

.site-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 201, 255, 0.2);
}

.site-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.site-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 6px;
}

.site-link span {
    font-size: 0.9rem;
    text-align: center;
}

/* 工具区域样式 */
.tools-section {
    padding: 30px 0 20px;
    margin-bottom: 20px;
}

.tools-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: #fff;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(0, 201, 255, 0.1), rgba(146, 254, 157, 0.1));
    border: 1px solid rgba(0, 201, 255, 0.3);
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 201, 255, 0.3), rgba(146, 254, 157, 0.2));
    color: #00c9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 201, 255, 0.4);
    border-color: rgba(0, 201, 255, 0.6);
}

.nav-link.active {
    background: linear-gradient(135deg, #00c9ff, #92fe9d);
    color: #000;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(0, 201, 255, 0.5);
}

/* 主内容区 */
.main-content {
    position: relative;
}

.category {
    display: none;
}

.category.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.tool-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 201, 255, 0.3);
}

.tool-card h3 {
    color: #00c9ff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.tool-card p {
    color: #aaa;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.tool-btn {
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

.tool-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 201, 255, 0.4);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50, #1a2a6c);
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalAppear 0.4s ease;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #fff;
}

.modal h2 {
    color: #00c9ff;
    margin-bottom: 20px;
    text-align: center;
}

.modal p {
    margin-bottom: 15px;
    color: #ddd;
    line-height: 1.6;
}

.modal-btn {
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 201, 255, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 30px 0 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .search-engines {
        gap: 8px;
    }
    
    .engine-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .search-input {
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .search-btn {
        padding: 15px 30px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .site-links {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .site-link {
        padding: 15px 10px;
    }
    
    .site-icon {
        font-size: 1.5rem;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        max-width: 100%;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 15px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 10px;
    }
}

/* 移动端横屏模式优化 */
@media (max-width: 850px) and (orientation: landscape) {
    .logo {
        font-size: 1.8rem;
    }
    
    .header {
        padding: 20px 0 10px;
    }
    
    .search-section {
        padding: 20px 0;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .nav-list {
        gap: 5px;
        max-width: 100%;
    }
    
    .nav-link {
        padding: 7px 10px;
        font-size: 0.8rem;
        border-radius: 12px;
    }
}

/* 小屏幕手机端优化 */
@media (max-width: 400px) {
    .search-engines {
        justify-content: flex-start;
    }
    
    .engine-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .tools-grid {
        gap: 15px;
    }
    
    .tool-card {
        padding: 15px;
    }
    
    .nav-link {
        padding: 7px 10px;
        font-size: 0.8rem;
        border-radius: 12px;
    }
}

/* 工具面板样式 */
.tool-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 450px;
    height: 100vh;
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    z-index: 999;
    padding: 30px;
    overflow-y: auto;
    transition: right 0.4s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.tool-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-title {
    color: #00c9ff;
    font-size: 1.5rem;
}

.close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #ddd;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group button {
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.form-group button:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 201, 255, 0.4);
}

.result-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-container h4 {
    color: #92fe9d;
    margin-bottom: 10px;
}

.result-content {
    color: #ddd;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 底部样式 */
.footer {
    margin-top: 60px;
    padding: 30px 0;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-info {
    text-align: center;
}

.footer-info p {
    margin: 10px 0;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.8;
}

.copyright {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 15px !important;
}

.beian {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.beian a {
    color: #92fe9d;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.beian a:hover {
    color: #00c9ff;
    text-shadow: 0 0 10px rgba(0, 201, 255, 0.5);
}

.beian-icon {
    font-size: 0.9rem;
}

.separator {
    color: #555;
    margin: 0 8px;
}

.site-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px !important;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    display: inline-flex;
}

.site-stats span {
    color: #ddd;
}

#busuanzi_value_site_pv,
#busuanzi_value_site_uv {
    color: #00c9ff;
    font-weight: bold;
    margin: 0 5px;
}

/* 资源搜索视图样式 */
.results-view {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    overflow: hidden;
}

.results-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.back-btn {
    padding: 8px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.iframe-container {
    height: 500px;
    width: 100%;
    background: #fff;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 工具详情内联显示样式 */
.tool-detail-view {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-header h2 {
    color: #00c9ff;
    margin: 0;
}

.back-to-tools {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.back-to-tools:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tools-grid-container.hidden {
    display: none;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00c9ff, #92fe9d);
    border: none;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 201, 255, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 201, 255, 0.6);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* 推荐标签样式 */
.site-link.recommended {
    position: relative;
    overflow: visible;
}

.recommend-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    white-space: nowrap;
    z-index: 10;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 响应式补充 */
@media (max-width: 768px) {
    .results-header {
        padding: 10px;
    }
    .iframe-container {
        height: 400px;
    }
    .tool-detail-view {
        padding: 15px;
    }
    .tool-header h2 {
        font-size: 1.2rem;
    }
    
    /* 移动端返回顶部按钮调整 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    /* 移动端推荐标签调整 */
    .recommend-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        top: -6px;
        right: -6px;
    }
}