:root {
    --sidebar-width: 250px;
    --sidebar-transition: 0.3s ease-in-out;
}

body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    /* Adjusted from 1.5 in original for consistency with later rules */
    transition: margin var(--sidebar-transition);
    color: #333;
    /* Added default color from later rules */
}

#header {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted));
    margin-bottom: 16px;
}

.promo-banner {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f4f8;
    /* Light blue, consistent with .note */
    border: 1px solid #bce8f1;
    border-radius: 8px;
}

.promo-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #2980b9;
    /* A strong blue */
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 1.1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.promo-button:hover {
    background-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    /* Override default link hover */
}

/* API Key Generator Styles */
.api-key-generator {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    border-left: 5px solid #16a085;
}

.api-key-generator h3 {
    margin-top: 0;
    color: #16a085;
}

.api-key-generator .input-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.api-key-generator .output-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.api-key-generator input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 1em;
    font-family: monospace;
}

.api-key-generator .url-copy-button,
.api-key-generator .url-generate-button {
    padding: 10px 15px;
    font-size: 1em;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.api-key-generator .url-copy-button {
    background-color: #2980b9;
}

.api-key-generator .url-copy-button:hover {
    background-color: #3498db;
}

.api-key-generator .url-generate-button {
    background-color: #16a085;
}

.api-key-generator .url-generate-button:hover {
    background-color: #1abc9c;
}

.api-key-generator pre {
    background-color: #fff;
    border: 1px solid #ddd;
}

.api-key-generator .output-group pre {
    flex-grow: 1;
    margin: 0;
}

#footer {
    margin-top: 64px;
    text-align: center;
    font-size: small;
    padding: 20px;
}

.postTitle {
    margin: auto 0;
    font-size: 2.5em;
    /* Keep this specific one */
    font-weight: bold;
    /* Removed color override - let h1 rule handle it */
    /* Removed border override - let h1 rule handle it */
    /* Removed padding override - let h1 rule handle it */
}

#postBody {
    padding: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--color-canvas-subtle, #f6f8fa);
    overflow-y: auto;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform var(--sidebar-transition);
    z-index: 1000;
}

#sidebar h2 {
    font-size: 1.2em;
    /* Keep specific size */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-default, #d0d7de);
    /* color: #2980b9; */
    /* Let general h2 rule handle color if consistent */
}

#sidebar ul {
    list-style-type: none;
    padding: 0;
    /* Overrides default list padding */
}

#sidebar li {
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

#sidebar li:hover {
    transform: translateX(5px);
}

#sidebar a {
    text-decoration: none;
    color: var(--color-fg-default, #1f2328);
    transition: color 0.2s ease;
}

#sidebar a:hover {
    color: var(--color-accent-fg, #0969da);
    /* text-decoration: underline; */
    /* Keep default no-underline? */
}

#content {
    transition: margin-left var(--sidebar-transition);
    margin-left: var(--sidebar-width);
    padding: 20px;
}

#sidebarToggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background-color: var(--color-canvas-default, #ffffff);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#sidebarToggle:hover {
    background-color: var(--color-canvas-subtle, #f6f8fa);
}

body.sidebar-open #sidebarToggle {
    left: calc(var(--sidebar-width) + 20px);
}

@media (min-width: 1201px) {
    #sidebarToggle {
        display: none;
    }
}

@media (max-width: 1200px) {
    body {
        margin-left: 0;
        padding-top: 60px;
    }

    #sidebar {
        transform: translateX(-100%);
        padding-top: 60px;
    }

    #content {
        margin-left: 0;
    }

    body.sidebar-open {
        margin-left: 0;
    }

    body.sidebar-open #sidebar {
        transform: translateX(0);
    }

    body.sidebar-open #content {
        margin-left: 0;
        opacity: 0.7;
        pointer-events: none;
    }
}

@media (max-width: 600px) {
    .postTitle {
        font-size: 1.5em;
        /* Override for small screens */
    }

    #content,
    #sidebar,
    #sidebar #content {
        /* Added #sidebar #content for specificity */
        padding: 10px;
    }
}

.copy-feedback {
    display: none;
    position: absolute;
    top: 10px;
    right: 50px;
    color: var(--color-fg-on-emphasis, #ffffff);
    background-color: var(--color-fg-muted, #656d76);
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 12px;
}

pre {
    position: relative;
    padding: 16px;
    background-color: var(--color-canvas-subtle, #f6f8fa);
    /* Use variable */
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 15px;
    /* Added consistency */
}

code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 85%;
    /* background-color: var(--color-neutral-muted); */
    /* Moved general code style down */
    /* padding: 2px 4px; */
    /* border-radius: 3px; */
}

/* AI 助手悬浮窗样式 */
#aiAssistant {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 350px;
    height: 500px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    border: 1px solid #d0d7de;
}

#aiAssistant.minimized {
    height: 60px;
}

#aiHeader {
    padding: 15px;
    background-color: #0969da;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#aiContent {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

#aiInput {
    display: flex;
    padding: 15px;
    border-top: 1px solid #d0d7de;
    background-color: #f6f8fa;
}

#userMessage {
    flex-grow: 1;
    margin-right: 10px;
    padding: 10px;
    border: 1px solid #d0d7de;
    border-radius: 20px;
    font-size: 14px;
    background-color: #ffffff;
    color: #1f2328;
}

#userMessage:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.2);
}

#sendMessage {
    background-color: #0969da;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

#sendMessage:hover {
    background-color: #0550ae;
}

.message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: #ddf4ff;
    color: #0969da;
    border: 1px solid #b6e3ff;
}

.ai-message {
    align-self: flex-start;
    background-color: #f6f8fa;
    color: #1f2328;
    border: 1px solid #e1e4e8;
}

.ai-message p {
    margin: 0 0 10px 0;
}

.ai-message ul,
.ai-message ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

/* Style for inline code within AI messages */
.ai-message code {
    background-color: #afb8c1;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 85%;
    /* Inherit size or be specific */
    color: #1f2328;
}

/* Style for code blocks within AI messages */
.ai-message pre {
    background-color: #f6f8fa;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
    /* Adjust margin */
    border: 1px solid #e1e4e8;
}

/* Reset background for code inside pre within AI messages */
.ai-message pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 100%;
    /* Reset to pre's font size */
}

.ai-message blockquote {
    border-left: 3px solid #d0d7de;
    margin: 0 0 10px 0;
    padding-left: 10px;
    color: #656d76;
}

#minimizeAI {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

#minimizeAI:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#clearChat {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#clearChat:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#clearChat svg {
    transition: transform 0.3s ease;
}

#clearChat:hover svg {
    transform: rotate(180deg);
}

/* Style for the copy button inside <pre> */
.copy-button {
    position: absolute;
    top: 8px;
    /* Adjusted */
    right: 8px;
    /* Adjusted */
    padding: 3px 8px;
    /* Adjusted */
    font-size: 12px;
    background-color: var(--color-canvas-default, #ffffff);
    /* Adjusted */
    border: 1px solid var(--color-border-default, #d0d7de);
    border-radius: 4px;
    /* Adjusted */
    cursor: pointer;
    opacity: 0.7;
    /* Make it less prominent */
    transition: opacity 0.2s, background-color 0.2s;
}

pre:hover .copy-button {
    opacity: 1;
    /* Show on hover */
}

.copy-button:hover {
    background-color: var(--color-neutral-muted, #afb8c1);
}

/* General Content Styling (from second set of rules) */
h1 {
    font-size: 2.5em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    /* Added margin */
}

h2 {
    font-size: 1.8em;
    color: #2980b9;
    margin-top: 40px;
    /* Increased margin */
    margin-bottom: 15px;
    /* Added margin */
    padding-bottom: 5px;
    /* Added padding */
    border-bottom: 1px solid #eee;
    /* Subtle separator */
}

h3 {
    font-size: 1.4em;
    color: #16a085;
    margin-top: 30px;
    /* Added margin */
    margin-bottom: 10px;
    /* Added margin */
}

p {
    margin-bottom: 15px;
}

strong {
    /* General strong tag style */
    color: #e74c3c;
    /* This was used for specific strong tags, apply generally? Or use a class? */
    font-weight: bold;
    /* Ensure it's bold */
}

/* Specific strong elements needing default color can override if needed */
.model-note strong {
    color: inherit;
    /* Example: Reset color if needed */
}

ul,
ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

li {
    margin-bottom: 10px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.highlight {
    /* Style for the highlight class span */
    background-color: #ffffd0;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    /* Added for emphasis */
}

.note {
    background-color: #e8f4f8;
    border-left: 5px solid #3498db;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 16px;
    /* explicit font size */
    border-radius: 4px;
    /* Added subtle rounding */
}

img.responsive-image,
/* Make all images responsive by default? */
.markdown-body img {
    /* Target images within markdown */
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
    /* Prevent extra space below */
}

.step {
    background-color: #f8f9fa;
    /* Default background for steps */
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 5px solid transparent;
    /* Default border */
}

.step-number {
    font-size: 1.2em;
    font-weight: bold;
    color: #3498db;
    /* Default step number color */
    margin-right: 10px;
    display: inline-block;
    /* Ensure spacing */
}

/* Styles moved from inline */
.model-note {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
    /* Added */
}

.quick-setup-note {
    background-color: #ffe6e6;
    border-left-color: #e74c3c;
}

.quick-setup-note .highlight-text {
    /* Style for the specific span */
    color: #e74c3c;
    font-weight: bold;
}

.step.step-highlight {
    /* More specific selector */
    border-left-color: #3498db;
    /* 改为蓝色边框 */
    background-color: #e8f4f8;
    /* 改为浅蓝色背景 (同 .note) */
}

.step.step-highlight .step-number {
    /* More specific selector */
    color: #3498db;
    /* 改为蓝色数字 */
    font-size: 1.3em;
    /* 保持稍大的字号以示强调 */
}



/* Error Troubleshooting Styles */
.error-troubleshooting-container {
    max-width: 100%;
    margin: 40px 0 20px 0;
    /* Adjusted margin */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.intro-text {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #444;
    line-height: 1.6;
}

.error-image {
    text-align: center;
    margin: 30px 0;
}

.responsive-image {
    /* Already defined above, ensure consistency */
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.error-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
    margin-bottom: 25px;
    overflow: hidden;
    border-left: 5px solid #3498db;
    /* Default blue border */
}

/* Specific error card styling if needed */
/* .error-card.type-warning { border-left-color: #f39c12; } */

.error-title {
    background-color: #f8f9fa;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.3em;
    color: #2c3e50;
    border-bottom: 1px solid #eaecef;
    font-weight: 600;
    /* Added weight */
}

.error-content {
    padding: 20px;
}

.error-message {
    background-color: #fdf7f7;
    /* Light red background */
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #e74c3c;
    /* Red accent border */
}

.error-message p {
    margin: 0;
    word-break: break-word;
    font-family: monospace;
    font-size: 0.9em;
    line-height: 1.5;
    /* Improved readability */
    color: #a94442;
    /* Darker red text */
}

.error-message strong {
    color: #e74c3c;
    /* Ensure strong tag is red here */
}

.solution {
    padding: 0 15px 0 0;
    /* Adjusted padding */
}

.solution p {
    /* The "解决方法：" text */
    font-weight: 600;
    font-size: 1.1em;
    color: #16a085;
    /* Green color for solution header */
    margin-bottom: 10px;
}

.solution ol {
    padding-left: 25px;
    /* Slightly more indent */
    margin-top: 0;
    /* Align with header */
}

.solution li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
    /* Slightly lighter text for steps */
}

.solution a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.solution a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .error-card {
        border-radius: 8px;
        border-left-width: 4px;
        /* Slightly thinner border */
    }

    .error-title,
    .error-content {
        padding: 15px;
    }

    .error-title {
        font-size: 1.2em;
    }

    .error-message {
        padding: 10px 12px;
    }

    .error-message p {
        font-size: 0.85em;
    }

    .solution p {
        font-size: 1.05em;
    }

    .solution li {
        font-size: 0.95em;
    }

    /* AI Assistant responsive styles */
    #aiAssistant {
        width: 90%;
        right: 5%;
        left: 5%;
        height: 400px;
    }

    #aiAssistant.minimized {
        height: 50px;
        width: 200px;
        right: 10px;
        left: auto;
    }
}