/*
 * 以下样式仅作用于页面ID为1242的页面。
 * 这是通过在每个选择器前添加  来实现的。
 */

/* General Layout and Main Containers */
.main {
    display: flex;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 60px);
    /* Adjust for header if any */
    box-sizing: border-box;
    /* Ensure padding is included in height */
    background-color: white;
}

* {
    font-family: "DM Sans Variable", sans-serif !important;
}

.sidebar {
    width: 300px;
    background-color: #1A1A1A;
    /* Slightly darker for a richer feel */
    padding: 20px;
    border-radius: 12px;
    /* Uniform rounded corners */
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Subtle depth */
}

.sidebar img {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User Info Box (if applicable) */
.aiinkeduser-info-box {
    display: none;
    /* Keep hidden as per previous setup */
    justify-content: space-between;
    align-items: center;
    padding: 2px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: auto;
    width: 100%;
}

.aiinkeduser-info-item {
    display: flex;
    align-items: center;
    margin-right: 2px;
}

.aiinkedchakra-icon {
    width: 26px;
    height: 26px;
    margin-right: 2px;
}

span {
    font-family: "DM Sans Variable", sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.modal-buttons {
    text-align: center;
    margin-top: 10px;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.modal-buttons button {
    margin: 5px;
    padding: 10px 20px;
    cursor: pointer;
}

.sidebar button {
    margin-bottom: 10px;
}

/* Main Content Area */
.content {
    flex: 1;
    background-color: #1A1A1A;
    /* Consistent with sidebar */
    border-radius: 12px;
    /* Consistent rounded corners */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
    position: relative;
    padding-bottom: 165px;
    /* Space for prompt input */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Subtle depth */
}

/* Content Image */
#content-image {
    max-width: 490px;
    max-height: 490px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 5px;
    display: block;
    transform: translateY(28px);
    /* 新增这行 */
    /* Adjusted as per previous request */
}

/* Download/Share Buttons */
.down-share-buttons {
    display: flex;
    position: absolute;
    top: 15px;
    /* Slightly more space from top */
    right: 15px;
    /* Slightly more space from right */
    z-index: 100;

}

.down-share-buttons button {
    margin-left: 8px;
    /* Increased spacing between buttons */
    padding: 6px 12px;
    /* Slightly larger hit area */
    background-color: transparent;
    color: #C0C0C0;
    /* Softer white */
    border: 1px solid rgba(192, 192, 192, 0.4);
    /* Subtle border */
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.down-share-buttons button:hover {
    background-color: rgba(60, 60, 60, 0.5);
    /* Clearer hover feedback */
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.chakra-button__icon {
    display: inline-flex;
    align-self: center;
    flex-shrink: 0;
    margin-inline-start: 0px;
    margin-right: 8px;
}

.chakra-icon {
    width: 16px;
    height: 16px;
}

/* Spacers */
.spacer {
    flex-grow: 1;
    min-height: 5px;
}

.top-spacer,
.bottom-spacer {
    flex-grow: 1;
}

/* Upload Image Button */
#upload-image {
    padding: 12px 25px;
    /* More generous padding */
    font-size: 16px;
    color: #E0E0E0;
    /* Consistent with other text */
    background-color: rgba(40, 40, 40, 0.7);
    /* Deeper background */
    border: 1px solid rgba(150, 150, 150, 0.4);
    /* Softer border */
    border-radius: 8px;
    /* Slightly larger border-radius */
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* Softer, more diffused shadow */
    transition: all 0.2s ease-out;
    /* Smoother transition */
    font-weight: 500;
}

#upload-image:hover {
    background-color: rgba(60, 60, 60, 0.8);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
    /* More pronounced lift */
    color: white;
    /* Brighter on hover */
    border-color: rgba(255, 255, 255, 0.6);
}

#upload-image:active {
    background-color: rgba(20, 20, 20, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    border-color: rgba(100, 100, 100, 0.8);
}

/* Image Outer Container and Image Container */
.image-outer-container {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.image-container {
    width: 230px;
    height: 230px;
    max-width: 280px;
    max-height: 280px;
    display: flex;
    flex-shrink: 0;
    /* 新增：防止容器收缩 */
    flex-grow: 0;
    /* 新增：防止容器拉伸 */
    flex-basis: auto;
    /* 新增：基于内容或width/height确定初始大小 */
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    display: block;
}

.image-outer-container {
    padding-bottom: 15px;
    /* More space below image */
}

#source-image-link {
    display: block;
    cursor: pointer;
}

#source-image-link:hover img {
    opacity: 0.9;
    transform: scale(1.01);
    /* Slight zoom on hover */
    transition: all 0.2s ease-out;
}

/* Guides Button */
.guides-button {
    position: absolute;
    top: 15px;
    /* Consistent with download/share buttons */
    left: 15px;
    z-index: 10;
    padding: 8px 15px;
    /* Larger padding */
    background-color: rgba(40, 40, 40, 0.7);
    color: #E0E0E0;
    border: 1px solid rgba(150, 150, 150, 0.4);
    border-radius: 8px;
    /* Consistent border-radius */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-out;
    font-weight: 500;
}

.guides-button:hover {
    background-color: rgba(60, 60, 60, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.guides-button:active,
.guides-button:focus {
    background-color: rgba(20, 20, 20, 0.9);
    color: #C0C0C0;
    border-color: rgba(100, 100, 100, 0.8);
    transform: translateY(0);
    box-shadow: none;
}

.guides-button svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    /* Adjusted spacing */
    fill: #E0E0E0;
    /* Ensure icon color matches text */
    transition: fill 0.2s ease;
}

.guides-button:hover svg {
    fill: white;
}

/* Instruction Modal */
.instruction-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(110deg, rgb(2, 3, 5) 2%, rgb(15, 20, 25));
    /* Slightly adjusted gradient */
    border-radius: 16px;
    /* Larger, softer roundness for modal */
    box-shadow: rgba(131, 128, 255, 0.3) 0px 0px 2rem 0px;
    /* Stronger glow effect */
    width: 550px;
    /* Slightly wider */
    max-height: 700px;
    /* Slightly taller */
    overflow: hidden;
    transition: all 0.4s ease-in-out;
    /* Slower, smoother transition */
    border: 1px solid rgba(131, 128, 255, 0.2);
    /* Subtle border for modal */
}

.instruction-modal.active {
    display: block;
}

.aiinkedCLine-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    /* Increased padding */
    background-color: rgba(255, 255, 255, 0.08);
    /* Slightly more prominent header background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Separator line */
}

.aiinkedCLine-guide-header h2,
.aiinkedCLine-guide-header h3 {
    margin: 0;
}

.aiinkedCLine-guide-header h3 {
    font-size: 1.05rem;
    color: #B0B0B0;
    /* Softer gray */
}

.aiinkedCLine-guide-header h2 {
    font-size: 1.3rem;
    white-space: nowrap;
    margin-right: 1.5rem;
    color: #F0F0F0;
    /* Brighter white */
    font-weight: 600;
    /* Slightly bolder */
}

.aiinkedCLine-guide-header .button-container {
    display: flex;
    gap: 0.8rem;
    /* Increased button gap */
}

.aiinkedCLine-guide-header button {
    background: none;
    border: none;
    color: #F0F0F0;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.aiinkedCLine-guide-header button:hover {
    color: #9ECFFC;
    /* A subtle blue on hover */
}

.aiinkedCLine-guide-content {
    padding: 1.5rem;
    /* Increased padding */
    overflow-y: auto;
    height: calc(700px - 120px - 2rem);
    /* Dynamic height calculation */
    flex-grow: 1;
    font-size: 0.95rem;
    /* Slightly smaller text for body */
    line-height: 1.6;
    /* Better line spacing */
}

.aiinkedCLine-guide-content ol {
    list-style-type: none;
    padding: 0;
}

.aiinkedCLine-guide-content ol li {
    margin-bottom: 1.2rem;
    /* More space between list items */
}

.aiinkedCLine-guide-content ol li h4 {
    margin: 0;
    font-size: 1.25rem;
    /* Slightly larger heading */
    color: #F0F0F0;
    /* Consistent heading color */
    font-weight: 600;
}

.aiinkedCLine-guide-content ol li p {
    margin: 0.6rem 0 0 0;
    color: #B0B0B0;
    /* Softer text color */
}

.aiinkedCLine-guide-content ul {
    list-style-type: none;
    padding: 0;
}

.aiinkedCLine-guide-content ul li {
    margin-bottom: 0.6rem;
    color: #B0B0B0;
}

.aiinkedCLine-guide-content a {
    display: inline-block;
    background-color: #5A6578;
    /* Slightly lighter shade */
    color: #fff;
    padding: 0.6rem 1.2rem;
    /* More padding */
    border-radius: 6px;
    /* Consistent border-radius */
    text-decoration: none;
    margin-top: 1.2rem;
    transition: background-color 0.2s ease;
}

.aiinkedCLine-guide-content a:hover {
    background-color: #3D4758;
}

/* Minimized Modal State */
.instruction-modal.aiinkedCLine-minimized {
    height: 60px !important;
    width: 300px;
    left: auto;
    top: auto;
    right: 20px;
    bottom: 20px;
    transform: none;
    overflow: hidden;
    border-radius: 10px;
    /* Smaller radius for minimized state */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.instruction-modal.aiinkedCLine-minimized .aiinkedCLine-guide-header h2,
.instruction-modal.aiinkedCLine-minimized .aiinkedCLine-guide-content {
    display: none;
}

.instruction-modal.aiinkedCLine-minimized .aiinkedCLine-guide-header h3 {
    display: block;
    color: #F0F0F0;
}

#aiinkedCLine-toggleMinMaxButton {
    margin-right: 10px;
}

#aiinkedCLine-closeButton {
    margin-left: 10px;
}

h4 {
    color: white;
}

h4 span {
    color: white;
}

.down-share-buttons button svg path {
    fill: #C0C0C0;
    /* Default icon color softer */
    stroke: #C0C0C0;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.down-share-buttons button:hover svg path {
    fill: white;
    /* Brighter on hover */
    stroke: white;
}

/* Linear History Button */
.linearthistory-svg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    outline: none;
    position: absolute;
    top: 50%;
    left: 15px;
    /* Consistent spacing */
    transform: translateY(-50%);
    z-index: 999;
    transition: all 0.3s ease;
    /* Enhanced transition */
}

.linearthistory-svg-button:hover {
    background: none !important;
    transform: translateY(-50%) scale(1.1) rotate(-10deg);
    /* More subtle animation */
    filter: brightness(1.2);
    /* Slight glow */
}

.linearthistory-svg-button svg {
    width: 45px;
    /* Slightly smaller icon for better balance */
    height: 45px;
    fill: #E0E0E0;
    /* Consistent icon color */
    transition: all 0.3s ease;
}

/* --- Four Component Block --- */
.component-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Ensures centered layout */
    gap: 5px;
    /* Increased consistent spacing */
    width: 100%;
    margin-top: 5px;
    /* Add some top margin to separate from upload button */
    margin-bottom: 5px;
    box-sizing: border-box;
    padding: 0 10px;
}

/* Base style for custom buttons and select boxes */
.custom-button,
.custom-select {
    flex: 0 0 auto;
    width: 220px;
    /* Ideal width for desktop, allowing wrap */
    max-width: 300px;
    /* height: 60px; */
    max-height: 50px;
    background-color: rgba(35, 35, 35, 0.8);
    /* Refined background color */
    border: 1px solid rgba(80, 80, 80, 0.6);
    /* Slightly more defined border */
    border-radius: 12px;
    /* Consistent with sidebar/content */
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #F0F0F0;
    /* Brighter text for better contrast */
    font-family: 'Inter', 'Arial', sans-serif;
    /* Modern font stack */
    font-size: 15px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* Soft inner shadow */
}

/* Dropdown specific container styles */
.custom-select {
    justify-content: space-between;
    padding: 0 20px;
    /* More padding inside select for better look */
}

/* Dropdown label style */
.custom-select label {
    font-size: 15px;
    color: #F0F0F0;
    z-index: 2;
    pointer-events: none;
    flex-grow: 1;
    text-align: left;
    line-height: 60px;
}

/* Dropdown select element style */
.custom-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    color: #F0F0F0;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    z-index: 1;
    line-height: 60px;
}

/* Custom dropdown arrow */
.custom-select::after {
    content: "▼";
    font-size: 10px;
    color: #F0F0F0;
    position: relative;
    right: 0;
    top: auto;
    transform: none;
    pointer-events: none;
    z-index: 2;
    margin-left: 10px;
}

/* Hover and Active effects */
.custom-button:hover,
.custom-select:hover {
    background-color: rgba(50, 50, 50, 0.9);
    /* More pronounced hover */
    border-color: rgba(150, 150, 150, 0.8);
    transform: translateY(-3px);
    /* Slightly larger lift */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    /* Deeper shadow */
    color: white;
    /* Text becomes pure white */
}

.custom-button:active,
.custom-select:active {
    background-color: rgba(20, 20, 20, 0.95);
    border-color: rgba(100, 100, 100, 0.9);
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* Revert shadow on click */
}

/* Dynamic background images for buttons */
.custom-button {
    background-size: cover;
    background-position: center;
    /* Ensure text visibility on top of images */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    /* Stronger text shadow */
}

.col-input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid rgb(235, 232, 235);
    /* 边框颜色 */
    padding: 8px;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Ensures centered layout */
    gap: 2px;
    /* Increased consistent spacing */
    width: 100%;
    margin-top: 5px;
    /* Add some top margin to separate from upload button */
    margin-bottom: 10px;
    box-sizing: border-box;
    padding: 0 10px;
}

/* 标签样式 */
.col-input-container label {
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: rgba(26, 26, 26, 1);
    padding: 0 5px;
    font-family: "DM Sans Variable", sans-serif;
    font-size: 0.9rem;
    color: rgba(248, 247, 247, 0.6);
}

.col-input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid rgba(170, 167, 167, 0.7);
    /* 初始边框颜色和不透明度 */
    padding: 8px;
    border-radius: 4px;
    transition: border-width 0.3s, border-color 0.3s;
    /* 添加过渡效果 */
}

.col-input-container:hover {
    border-width: 3px;
    border-color: rgb(255, 255, 255);
    /* 鼠标悬停时的边框颜色和不透明度 */
}

/* 新增：当 .col-input-container 被悬停时，其内部的 label 字体颜色变为白色 */
.col-input-container:hover label {
    color: white;
}

.col-input-container {
    margin-left: 10px;
    /* 上边距 */
    margin-right: 10px;
    /* 下边距 */
}

.col-select {
    flex: 1;
    border: none;
    outline: none;
    font-family: "DM Sans Variable", sans-serif;
    font-size: 1rem;
    padding: 2px;
    background-color: rgba(26, 26, 26, 1);
    /* 背景颜色 */
    color: white;
    /* 添加这行，将文字颜色设为纯白色 */
}

/* --- Responsive Adjustments --- */

/* Tablets and larger phones */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    .content {
        width: 100%;
        margin-top: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    .component-row {
        gap: 5px;
        margin-top: 10px;
        margin-bottom: 10px;
        padding: 0 5px;
    }

    .custom-select,
    .custom-button {
        flex: 1 1 calc(50% - 10px);
        /* Two columns */
        max-width: calc(50% - 10px);
        height: 55px;
        /* Slightly adjusted height */
        font-size: 14px;
        border-radius: 10px;
    }

    .custom-select label {
        line-height: 55px;
        font-size: 14px;
    }

    .custom-select::after {
        font-size: 9px;
    }

    #upload-image {
        height: 45px;
        line-height: 45px;
        font-size: 13px;
        padding: 0 15px;
        border-radius: 8px;
    }

    .guides-button,
    .down-share-buttons button {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
    }

    .guides-button svg,
    .down-share-buttons button svg {
        width: 16px;
        height: 16px;
        margin-right: 5px;
    }

    .down-share-buttons {
        top: 10px;
        right: 10px;
    }

    .linearthistory-svg-button {
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    .linearthistory-svg-button svg {
        width: 40px;
        height: 40px;
    }
}

/* Smaller phones (e.g., iPhone SE) */
@media (max-width: 480px) {
    .main {
        padding: 10px;
    }

    .sidebar {
        padding: 10px;
        border-radius: 8px;
    }

    .content {
        padding: 10px;
        border-radius: 8px;
    }

    .component-row {
        gap: 5px;
        margin-top: 15px;
        margin-bottom: 15px;
        padding: 0;
    }

    .custom-select,
    .custom-button {
        flex: 1 1 100%;
        /* Single column */
        max-width: 100%;
        height: 50px;
        font-size: 13px;
        border-radius: 8px;
    }

    .custom-select label {
        line-height: 50px;
        font-size: 13px;
    }

    .custom-select::after {
        font-size: 8px;
    }

    #upload-image {
        height: 40px;
        line-height: 40px;
        font-size: 12px;
        padding: 0 10px;
        border-radius: 6px;
    }

    .guides-button,
    .down-share-buttons button {
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 5px;
    }

    .guides-button svg,
    .down-share-buttons button svg {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }

    .down-share-buttons {
        top: 8px;
        right: 8px;
    }

    .linearthistory-svg-button {
        left: 8px;
    }

    .linearthistory-svg-button svg {
        width: 35px;
        height: 35px;
    }

    .instruction-modal {
        width: 95vw;
        border-radius: 12px;
    }

    .aiinkedCLine-guide-header {
        padding: 0.8rem 1rem;
    }

    .aiinkedCLine-guide-header h2 {
        font-size: 1.1rem;
    }

    .aiinkedCLine-guide-header h3 {
        font-size: 0.9rem;
    }

    .aiinkedCLine-guide-header button {
        font-size: 1.4rem;
    }

    .aiinkedCLine-guide-content {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .aiinkedCLine-guide-content ol li h4 {
        font-size: 1.1rem;
    }
}

/* Prompt Input */
.prompt-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    /* Adjusted width to account for padding/margin */
    max-width: 980px;
    display: flex;
    justify-content: center;
    z-index: 99;
}

#prompt-input {
    width: 100%;
    height: 90px;
    padding: 12px 15px;
    /* Slightly more padding */
    box-sizing: border-box;
    border-radius: 10px;
    /* Consistent rounded corners */
    border: 1px solid rgba(150, 150, 150, 0.3);
    /* Softer border */
    font-family: 'Inter', 'Arial', sans-serif;
    /* Consistent font */
    font-size: 15px;
    resize: none;
    background-color: #252525;
    /* Darker background for input */
    color: #F0F0F0;
    /* Light text color */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    /* Inner shadow for depth */
    transition: all 0.2s ease-in-out;
}

#prompt-input::placeholder {
    color: #888;
    /* Placeholder text color */
}

#prompt-input:focus {
    outline: none;
    border-color: #7AAFFF;
    /* Highlight border on focus */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(122, 170, 255, 0.2);
    /* Glow effect on focus */
}

