html {
    pointer-events: none;
    scroll-behavior: smooth;
}

html * {
    pointer-events: auto;
}

:root {
    --border-soft: #dbe3f0;
    --border-strong: #bfd1ff;
    --surface-panel: rgba(255, 255, 255, 0.82);
    --surface-panel-strong: rgba(255, 255, 255, 0.96);
}

#devtools-detect {
    display: none;
}

@media screen and (min-width: 0px) and (max-width: 1000px) {
    #devtools-detect {
        display: block;
    }
}

#encrypted-container {
    max-width: 860px;
    margin: 24px auto 40px;
    padding: 24px;
    background: var(--surface-panel);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

#loader {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.alert {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 15px;
    margin: 15px 0;
    color: #5d4037;
    border-radius: 0 4px 4px 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
        'Open Sans', 'Helvetica Neue', sans-serif;
    color: #334155;
    background:
        radial-gradient(circle at top, rgba(226, 233, 255, 0.9), transparent 42%),
        linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    min-height: 100vh;
    padding: 18px 14px 28px;
}

a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-soft);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 1em 0 0.8em;
    color: #2c3e50;
    line-height: 1.3;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-strong);
    padding-bottom: 0.55em;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 1.7rem;
    color: #283593;
    padding-left: 0;
}

h3 {
    font-size: 1.4rem;
    color: #303f9f;
}

h4 {
    font-size: 1.2rem;
    color: #3949ab;
}

h5 {
    font-size: 1rem;
    color: #3f51b5;
}

h6 {
    font-size: 0.9rem;
    color: #5c6bc0;
}

p {
    margin: 0.8em 0;
    word-wrap: break-word;
    color: #475569;
}

ul,
ol {
    margin: 0.8rem 0;
    padding-left: 1.8rem;
}

li {
    margin: 0.4rem 0;
    font-weight: 400;
    color: #475569;
}

blockquote {
    border-left: 4px solid #3b82f6;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    color: #334155;
    background-color: #eff6ff;
    font-size: 1em;
    font-weight: 400;
    border-radius: 0 6px 6px 0;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.72);
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    margin: 0;
}

th,
td {
    border: 1px solid var(--border-soft);
    padding: 14px 16px;
    text-align: left;
}

th {
    background-color: #eff4ff;
    font-weight: 600;
    color: #1e3a8a;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-strong);
}

tr:nth-child(even) {
    background-color: #fbfdff;
}

tr:hover {
    background-color: #eef4ff;
}

pre {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 1.6;
    position: relative;
    border: 1px solid var(--border-soft);
}

code {
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #eef2ff;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    line-height: 1.6;
    vertical-align: baseline;
    color: #c026d3;
}

pre code {
    background: none;
    padding: 0;
    color: #334155;
}

details {
    margin: 1.2rem 0;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

details:hover {
    border-color: var(--border-strong);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

summary {
    cursor: pointer;
    padding: 0.8rem 1rem;
    font-weight: 600;
    color: #0f172a;
    list-style: none;
    position: relative;
    background: linear-gradient(90deg, #eff4ff 0%, #f8fbff 100%);
    border-radius: 10px;
    margin: -0.5rem;
    border: 1px solid rgba(191, 209, 255, 0.6);
    -webkit-user-select: none;
    user-select: none;
}


summary * {
    -webkit-user-select: none;
    user-select: none;
}

details > :not(summary) {
    -webkit-user-select: text;
    user-select: text;
}
summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '▶';
    position: absolute;
    right: 1rem;
    color: #64748b;
    transition: transform 0.2s;
}

details[open]>summary::after {
    transform: rotate(90deg);
}

details[open] {
    background: rgba(255, 255, 255, 0.92);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2rem 0;
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

p img,
li img,
td img {
    max-width: 90%;
    max-height: 300px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

:not(p):not(li):not(td)>img {
    max-width: 80%;
    max-height: 500px;
}

a img {
    max-width: 200px;
}

a:hover img {
    transform: scale(1.03);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.code-wrapper {
    position: relative;
}

.code-wrapper pre {
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.code-wrapper code {
    pointer-events: none;
}

.copy-btn {
    background: var(--surface-panel-strong);
    border: 1px solid var(--border-strong);
    color: #1d4ed8;
    position: absolute;
    right: 12px;
    top: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s;
    opacity: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
    pointer-events: auto;
}

.code-wrapper .copy-btn {
    top: 12px;
    right: 12px;
}

.copy-btn:hover {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.copy-alert {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--surface-panel-strong);
    color: #0f172a;
    padding: 12px 18px;
    border-radius: 999px;
    display: none;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
    border: 1px solid var(--border-soft);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    max-width: 220px;
}

.copy-alert.copy-success {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.24);
}

.copy-alert.copy-error {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.24);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 图片放大覆盖层样式 */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay.active {
    opacity: 1;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.image-overlay.active img {
    transform: scale(1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 12px 10px 20px;
    }

    .container {
        padding: 1.5rem;
        margin: 0 12px;
        border-radius: 6px;
    }

    #encrypted-container {
        margin: 12px auto 24px;
        padding: 18px;
        border-radius: 14px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-wrapper pre {
        padding-right: 5.25rem;
        padding-top: 3rem;
    }

    .copy-alert {
        top: 16px;
        right: 16px;
        max-width: 180px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .code-wrapper .copy-btn {
        right: 8px;
        top: 8px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px 6px 16px;
    }

    .container {
        padding: 1rem;
        margin: 0 8px;
    }

    #encrypted-container {
        padding: 14px;
        border-radius: 12px;
    }

    ul,
    ol {
        padding-left: 1.5rem;
    }

    th,
    td {
        padding: 12px 14px;
        font-size: 14px;
    }

    pre {
        padding: 1rem;
    }

    blockquote {
        padding: 0.8rem 1rem;
        margin: 1.2rem 0;
    }
}

/* 添加一些微妙的动画效果 */
.container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* 选中文本样式 */
::selection {
    background: #e3f2fd;
    color: #1a237e;
}

::-moz-selection {
    background: #e3f2fd;
    color: #1a237e;
}