* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: #f7fbff;
    min-height: 100vh;
    line-height: 1.6;
}

.header {
    background: linear-gradient(90deg, #4a90e2, #63b3ed);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(74, 144, 226, 0.1);
}

.logo {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.logo a:hover {
    opacity: 0.8;
}

.menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.menu a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.menu a:hover {
    opacity: 1;
}

.language-selector {
    position: relative;
    margin-left: 12px;
}

.language-selector select {
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 24px 6px 12px;
    outline: none;
    transition: all 0.3s ease;
}

.language-selector select option {
    background: #fff;
    color: #333;
    padding: 8px;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.language-selector select:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.language-selector::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #fff;
    pointer-events: none;
}

.menu .theme-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    opacity: 0.9;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
}

.menu .theme-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    position: absolute;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

body.dark-theme .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

body.dark-theme .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.search-bar {
    padding: 32px 0;
    text-align: center;
    background: #fff;
    box-shadow: 0 2px 12px rgba(74,144,226,0.06);
}

.search-bar form {
    display: inline-flex;
    position: relative;
    box-shadow: 0 2px 12px rgba(74,144,226,0.1);
    border-radius: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 500px;
    margin: 0 16px;
}

.search-bar form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74,144,226,0.15);
}

.search-bar input {
    padding: 14px 20px;
    font-size: 16px;
    width: 100%;
    border: 2px solid #4a90e2;
    border-right: none;
    border-radius: 24px 0 0 24px;
    outline: none;
    color: #333;
    background: #fff;
    margin: 0;
    position: relative;
}

.search-bar button {
    padding: 14px 28px;
    font-size: 16px;
    border: 2px solid #4a90e2;
    border-left: none;
    border-radius: 0 24px 24px 0;
    background: linear-gradient(90deg, #4a90e2, #63b3ed);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin: 0;
    position: relative;
    left: -1px;
    white-space: nowrap;
    min-width: 90px;
}

.search-bar button:hover {
    background: linear-gradient(90deg, #63b3ed, #4a90e2);
    transform: translateX(2px);
}

.content {
    max-width: 900px;
    margin: 40px auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(74,144,226,0.06);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e3eaf2;
    transition: background 0.3s;
}

.info-row:hover {
    background: #f7fbff;
}

.info-row span {
    flex: 1;
    font-size: 15px;
}

.risk {
    position: relative;
    padding: 8px 18px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    min-width: 100px;
    background: #f5f5f5;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.risk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: all 0.3s ease;
}

.risk span {
    position: relative;
    z-index: 2;
    color: #ffffff; /* Changed from #fff to #ffffff */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 五个安全等级的颜色 */
.risk[data-level="1"]::before {
    background: #27ae60;  /* 深绿 - 最安全 */
    right: 0;
}

.risk[data-level="2"]::before {
    background: #2ecc71;  /* 浅绿 - 较安全 */
    right: 0;
}

.risk[data-level="3"]::before {
    background: #f1c40f;  /* 黄色 - 一般 */
    right: 0;
}

.risk[data-level="4"]::before {
    background: #e74c3c;  /* 浅红 - 较危险 */
    right: 0;
}

.risk[data-level="5"]::before {
    background: #c0392b;  /* 深红 - 最危险 */
    right: 0;
}

.footer {
    background: #2a2e3b;
    color: #b0b7c3;
    padding: 48px 0 0 0;
    margin-top: 48px;
}

.footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer .footer-section {
    flex: 1;
    min-width: 220px;
}

.footer .footer-section h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer .footer-section p,
.footer .footer-section a {
    font-size: 14px;
    line-height: 1.6;
    color: #b0b7c3;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer .footer-section a:hover {
    color: #4a90e2;
}

.footer .footer-links .links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.footer .footer-bottom {
    text-align: center;
    padding: 24px 0;
    margin-top: 48px;
    border-top: 1px solid #3c4251;
    font-size: 13px;
    color: #7f8c9a;
}

/* 黑夜主题 */
body.dark-theme {
    background: #1a1e27;
    color: #d1d6dd;
}

body.dark-theme .header {
    background: linear-gradient(90deg, #2e3a5e, #4a5e9a);
}

body.dark-theme .search-bar {
    background: #2a2e3b;
}

body.dark-theme .search-bar input {
    background: #1a1e27;
    color: #d1d6dd;
    border-color: #4a5e9a;
}

body.dark-theme .search-bar button {
    background: linear-gradient(90deg, #2e3a5e, #4a5e9a);
    border-color: #4a5e9a;
}

body.dark-theme .content {
    background: #2a2e3b;
}

body.dark-theme .info-row {
    border-color: #3c4251;
}

body.dark-theme .info-row:hover {
    background: #1a1e27;
}

/* 移动端适配 */
@media (max-width: 900px) {
    .header {
        padding: 16px;
    }
    
    .logo {
        font-size: 24px;
    }

    .menu {
        gap: 16px;
    }

    .menu a {
        font-size: 15px;
        white-space: nowrap;
    }

    .search-bar {
        padding: 24px 0;
    }

    .search-bar form {
        width: calc(100% - 32px);
        max-width: none;
        margin: 0 16px;
    }

    .search-bar input {
        font-size: 15px;
    }

    .search-bar button {
        width: auto;
        min-width: 80px;
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .menu {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .menu a {
        font-size: 14px;
    }

    .search-bar input {
        width: calc(100% - 80px);
    }

    .search-bar button {
        width: 80px;
    }

    .content {
        margin: 20px 12px;
        padding: 20px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .api-content {
        padding: 0 1rem;
    }

    .api-section {
        padding: 1.5rem;
    }

    .api-example pre {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

/* API 文档页面样式 */
.api-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.api-content h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.api-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.dark-theme .api-section {
    background: #2d2d2d;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.api-section h2 {
    color: #4a90e2;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a90e2;
}

.dark-theme .api-section h2 {
    color: #63b3ed;
    border-bottom-color: #63b3ed;
}

.api-example {
    margin: 1.5rem 0;
}

.api-example h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.dark-theme .api-example h3 {
    color: #ecf0f1;
}

.api-example p {
    margin: 0.8rem 0;
    line-height: 1.6;
}

.api-example pre {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid #e9ecef;
}

.dark-theme .api-example pre {
    background: #1a1a1a;
    border-color: #333;
}

.api-example code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

.dark-theme .api-example code {
    color: #ff79c6;
}

.api-section ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.api-section ul li {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.api-section ul li::before {
    content: "•";
    color: #4a90e2;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.dark-theme .api-section ul li::before {
    color: #63b3ed;
}


