﻿
/* 全局样式 */
:root {
    --primary-color: #1a365d;
    --primary-light: #2d4b8c;
    --secondary-color: #2d3748;
    --secondary-light: #4a5568;
    --accent-color: #3182ce;
    --accent-light: #63b3ed;
    --light-color: #f7fafc;
    --gray-color: #e2e8f0;
    --gray-light: #edf2f7;
    --text-color: #2d3748;
    --text-light: #718096;
    --success-color: #38a169;
    --warning-color: #ed8936;
    --danger-color: #e53e3e;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 15px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --transition: all 0.25s ease;
    --transition-slow: all 0.4s ease;
}

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

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.none {
    display: none
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    white-space: nowrap;
}

    .btn:hover {
        background-color: var(--primary-light);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .btn:active {
        transform: translateY(0);
    }

.btn-secondary {
    background-color: var(--secondary-color);
}

    .btn-secondary:hover {
        background-color: var(--secondary-light);
    }

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

    .btn-outline:hover {
        background-color: var(--accent-color);
        color: white;
    }

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    padding: 10px;
    border-radius: 50%;
    min-width: 40px;
    min-height: 40px;
}

/* 头部导航样式 */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.logo-icon {
    color: var(--accent-color);
    font-size: 1.8rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 头部功能按钮区域样式 */
.header-actions {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
    border-radius: var(--border-radius-sm);
}

    .mobile-menu-btn:hover {
        background-color: var(--gray-light);
    }



/* 主要内容区域 */
main {
    flex: 1;
    padding: 30px 0;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-color);
    position: relative;
}

    .page-title:after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 80px;
        height: 2px;
        background-color: var(--accent-color);
    }

/* 页脚样式 */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

    .footer-section h3 {
        margin-bottom: 18px;
        font-size: 1.2rem;
        position: relative;
        padding-bottom: 10px;
    }

        .footer-section h3:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background-color: var(--accent-color);
        }

    .footer-section p {
        color: #cbd5e0;
        line-height: 1.8;
    }

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
    color: #a0aec0;
    font-size: 0.85rem;
}

/* 搜索栏样式 */
.search-section {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border: 1px solid var(--gray-color);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.search-engine-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

    .search-engine-selector h3 {
        font-size: 1.1rem;
        color: var(--secondary-color);
        width: 100%;
        margin-bottom: 5px;
        flex-basis: 100%;
    }

.engine-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 30px;
    border: 2px solid var(--gray-color);
    transition: var(--transition);
    background-color: white;
    flex-shrink: 0;
}

    .engine-option:hover {
        border-color: var(--accent-light);
        background-color: #f0f7ff;
    }

    .engine-option.selected {
        border-color: var(--accent-color);
        background-color: #ebf8ff;
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    }

    .engine-option i {
        font-size: 1.1rem;
    }

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--gray-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: white;
}

    .search-input:focus {
        outline: none;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    }

    .search-input::placeholder {
        color: #a0aec0;
    }

/* 网址导航样式 */
.nav-section {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

    .section-header h2 {
        font-size: 1.5rem;
        color: var(--primary-color);
    }

    .section-header p {
        color: var(--text-light);
        margin-top: 5px;
    }

.edit-mode-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-light);
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 10px;
}

    .category-tabs::-webkit-scrollbar {
        height: 6px;
    }

    .category-tabs::-webkit-scrollbar-track {
        background: var(--gray-light);
        border-radius: 3px;
    }

    .category-tabs::-webkit-scrollbar-thumb {
        background: var(--accent-light);
        border-radius: 3px;
    }

.category-tab {
    padding: 10px 22px;
    border-radius: 30px;
    background-color: var(--gray-light);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

    .category-tab:hover {
        background-color: var(--accent-light);
        color: white;
        transform: translateY(-2px);
    }

    .category-tab.active {
        background-color: var(--accent-color);
        color: white;
        box-shadow: var(--shadow);
    }

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.website-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border-radius: var(--border-radius);
    border: 2px solid var(--gray-color);
    transition: var(--transition);
    cursor: pointer;
    background-color: white;
    position: relative;
    overflow: hidden;
}

    .website-card:hover {
        border-color: var(--accent-color);
        transform: translateY(-5px);
        box-shadow: var(--shadow);
    }

    .website-card:active {
        transform: translateY(-2px);
    }

.website-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ebf8ff, #bee3f8);
    border-radius: 12px;
    font-size: 1.6rem;
    color: var(--accent-color);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.website-info {
    flex: 1;
    min-width: 0;
}

    .website-info h3 {
        margin-bottom: 6px;
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .website-info p {
        color: var(--text-light);
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.website-category {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background-color: var(--gray-light);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* 编辑模式样式 */
.edit-mode-controls {
    padding: 15px 20px;
    background-color: #f0f9ff;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid #bee3f8;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background-color: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

    .modal-header h2 {
        color: var(--primary-color);
        font-size: 1.5rem;
    }

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .close-modal:hover {
        background-color: var(--gray-light);
        color: var(--danger-color);
    }

.form-group {
    margin-bottom: 22px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: var(--secondary-color);
    }

    .form-group input, .form-group select, .form-group textarea {
        width: 100%;
        padding: 14px 18px;
        border: 2px solid var(--gray-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        transition: var(--transition);
        font-family: inherit;
        background-color: white;
    }

        .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
        }

    .form-group small {
        display: block;
        margin-top: 6px;
        color: var(--text-light);
        font-size: 0.85rem;
    }

        .form-group small a {
            color: var(--accent-color);
            text-decoration: underline;
        }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

    .empty-state i {
        font-size: 3.5rem;
        color: var(--gray-color);
        margin-bottom: 20px;
    }

    .empty-state h3 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        color: var(--secondary-color);
    }

/* 加载动画 */
.loader {
    display: none;
    text-align: center;
    padding: 40px;
}

    .loader.active {
        display: block;
    }

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 删除按钮 */
.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.website-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* 移动端优化 */
@media (max-width: 992px) {
    .detail-container {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 10px 0;
    }

    .header-actions {
        display: none; /* 移动端隐藏功能按钮，保持界面简洁 */
    }

    main {
        padding: 20px 0;
    }

    .page-title {
        font-size: 1.7rem;
        margin-bottom: 25px;
    }

    .search-section, .nav-section, .detail-main, .detail-sidebar {
        padding: 20px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .edit-mode-controls {
        width: 100%;
        justify-content: center;
    }

    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .modal-content {
        padding: 25px 20px;
        max-height: 85vh;
    }

    .form-actions {
        flex-direction: column;
    }

        .form-actions .btn {
            width: 100%;
        }

    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .websites-grid {
        grid-template-columns: 1fr;
    }

    .website-card {
        padding: 18px;
    }

    .engine-option {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .search-engine-selector h3 {
        font-size: 1rem;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #2d3748;
        --primary-light: #4a5568;
        --secondary-color: #e2e8f0;
        --secondary-light: #cbd5e0;
        --accent-color: #63b3ed;
        --accent-light: #90cdf4;
        --light-color: #1a202c;
        --gray-color: #2d3748;
        --gray-light: #4a5568;
        --text-color: #e2e8f0;
        --text-light: #a0aec0;
    }

    body {
        background-color: #1a202c;
    }

    header, .search-section, .nav-section, .software-card,
    .detail-main, .detail-sidebar, .review-card, .modal-content {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .search-input, .form-group input, .form-group select, .form-group textarea {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

        .search-input::placeholder {
            color: #718096;
        }

    .website-icon {
        background: linear-gradient(135deg, #2d3748, #4a5568);
    }

    .edit-mode-controls {
        background-color: #2d3748;
        border-color: #4a5568;
    }
}

