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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    padding: 48px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 100;
    text-align: center;
}

.search-box {
    display: inline-block;
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
    background: white;
    color: #333;
}

.search-input:focus {
    border-color: #4CAF50;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 5px auto 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 101;
    display: none;
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 14px;
    color: #333;
}

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

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

.suggestion-item.active {
    background: #e3f2fd;
}

.suggestion-text {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.suggestion-highlight {
    background-color: #ffeb3b;
    font-weight: bold;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.search-button:hover {
    background: #45a049;
}

.search-results {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.content-container {
    padding: 30px;
    min-height: 400px;
}

.content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}

/* 夜间模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #14151B;
    }

    .container {
        background: #1E1F26;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .search-container {
        background: #1E1F26;
        border-bottom: 1px solid #2F333F;
    }

    .search-input {
        background: #2F333F;
        border: 2px solid #3A3F4F;
        color: #E0E0E0;
    }

    .search-input:focus {
        border-color: #4CAF50;
    }

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

    .search-suggestions {
        background: #2F333F;
        border: 1px solid #3A3F4F;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .suggestion-item {
        color: #E0E0E0;
        border-bottom: 1px solid #3A3F4F;
    }

    .suggestion-item:hover {
        background: #3A3F4F;
    }

    .suggestion-item.active {
        background: #4A5568;
    }

    .suggestion-text {
        color: #999;
    }

    .content {
        color: #E0E0E0;
    }

    .search-results {
        color: #B0B5C0;
        font-weight: 500;
    }

    .loading {
        color: #999;
    }

    .error {
        color: #ff6b6b;
    }

    .nav-button {
        background: #3A3F4F;
        border: 1px solid #4A5568;
        color: #F0F0F0;
        font-weight: 500;
    }

    .nav-button:hover {
        background: #4A5568;
        border-color: #5A6678;
        color: #FFFFFF;
    }

    .nav-button:disabled {
        background: #2A2F3A;
        border-color: #3A3F4F;
        color: #888;
        opacity: 0.6;
    }

    .nav-count {
        color: #D0D5E0;
        font-weight: 600;
    }

    .search-match {
        background-color: #ff9800;
    }

    .search-match:hover {
        background-color: #fb8c00;
    }

    .back-to-top {
        background: #4CAF50;
    }

    .back-to-top:hover {
        background: #45a049;
    }
}

.highlight {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.search-match {
    background-color: #ff9800;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-match:hover {
    background-color: #fb8c00;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.error {
    text-align: center;
    padding: 50px;
    color: #d32f2f;
}

.navigation {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.nav-button {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s;
}

.nav-button:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.nav-count {
    margin: 0 10px;
    line-height: 28px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
    transform: translateY(-1px);
}

