/* 全局样式 */
:root {
    --primary-color: #0066ff;
    --secondary-color: #4d94ff;
    --bg-color: #f2f4f4; /* Changed to new background color */
    --sidebar-bg: #ffffff;
    --text-color: #333333;
    --light-text: #666666;
    --border-color: #e1e4e8;
    --hover-color: #f0f2f5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--bg-color); /* Ensure this uses the updated variable */
    color: var(--text-color);
    line-height: 1.6;
    position: relative; /* Crucial for z-index stacking of the animated background */
    overflow-x: hidden; /* Prevent horizontal scrollbars if lines animate out of bounds */
    cursor: none; /* Hide default cursor */
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: visible;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background-image: linear-gradient(145deg, #00c6fb 0%, #c39bd3 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    color: #ffffff;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h2 {
    color: #ffffff;
    font-size: 24px;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-links {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: var(--border-radius);
    color: #f7f9f9;
    transition: all 0.2s ease;
}

.nav-links a i {
    margin-right: 10px;
    font-size: 18px;
}

/* Colorful Sidebar Icons */
.nav-links a[href="login.html"] i {
    color: #FFA500; /* Vibrant Orange for Login */
}
.nav-links a[href="index.html"] i {
    color: #32CD32; /* Lime Green for Chat */
}
.nav-links a[href="reviews.html"] i {
    color: #FF00FF; /* Magenta for Reviews */
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.history-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.new-chat-btn i {
    margin-right: 5px;
}

.new-chat-btn:hover {
    background-color: var(--secondary-color);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f7f9f9 
;
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.chat-item i {
    margin-right: 10px;
}

.chat-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 12px;
    color: #d0d3d4 ;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 280px; /* 与侧边栏宽度相同 */
    overflow-y: auto;
    padding: 20px;
    width: calc(100% - 280px);
}

/* 聊天界面样式 */
.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chat-header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* 3D闪光渐变标题 */
.main-title {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(45deg, #8A2BE2, #FF69B4, #7FFF00, #1E90FF, #8A2BE2);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-animation 10s ease infinite, text-pop-up-top 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both, flash-effect 2.2s infinite linear;
    text-shadow:
        0px 1px 0px #e8daef,
        0px 2px 0px #dcd0e5,
        0px 3px 0px #d0c6dc,
        0px 4px 0px #c4bcc3,
        0px 5px 0px #b8b2ca,
        0px 6px 1px rgba(0,0,0,.1),
        0px 0px 5px rgba(0,0,0,.1),
        0px 1px 3px rgba(0,0,0,.3),
        0px 3px 5px rgba(0,0,0,.2),
        0px 5px 10px rgba(0,0,0,.25),
        0px 10px 10px rgba(0,0,0,.2),
        0px 20px 20px rgba(0,0,0,.15);
    position: relative;
    min-height: 1em;
}

.main-title::after {
    content: '|';
    font-weight: normal;
    color: #777;
    animation: blink-caret 0.8s step-end infinite;
    margin-left: 1px;
}

@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

.subtitle {
    font-size: 18px;
    color: var(--light-text);
    background: linear-gradient(45deg, #00aaff, #ff66cc, #ffcc00, #00aaff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-animation 12s ease infinite alternate, text-focus-in 1s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 文本弹出动画 */
@keyframes text-pop-up-top {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 文本聚焦动画 */
@keyframes text-focus-in {
  0% {
    filter: blur(12px);
    opacity: 0;
  }
  100% {
    filter: blur(0px);
    opacity: 1;
  }
}

/* New keyframe for title flash effect */
@keyframes flash-effect {
  0%, 100% {
    text-shadow:
        0px 1px 0px #d6eaf8,
        0px 2px 0px #aed6f1,
        0px 3px 0px #7fb3d5,
        0px 4px 0px #85c1e9 ,
        0px 5px 0px #3498db ,
        0px 6px 1px rgba(0,0,0,.1),
        0px 0px 5px rgba(0,0,0,.1), 0px 1px 3px rgba(0,0,0,.3),
        0px 3px 5px rgba(0,0,0,.2), 0px 5px 10px rgba(0,0,0,.25),
        0px 10px 10px rgba(0,0,0,.2), 0px 20px 20px rgba(0,0,0,.15);
  }
  50% {
    text-shadow:
        0px 1px 0px #d6eaf8,
        0px 2px 0px #aed6f1,
        0px 3px 0px #7fb3d5,
        0px 4px 0px #85c1e9 ,
        0px 5px 0px #3498db ,
        0px 6px 1px rgba(0,0,0,.1),
        0px 0px 5px rgba(0,0,0,.1), 0px 1px 3px rgba(0,0,0,.3),
        0px 3px 5px rgba(0,0,0,.2), 0px 5px 10px rgba(0,0,0,.25),
        0px 10px 10px rgba(0,0,0,.2), 0px 20px 20px rgba(0,0,0,.15),
        /* Added flash layers */
        0 0 7px rgba(255, 255, 255, 0.9),
        0 0 12px rgba(163, 228, 215, 0.8), /* Light purple flash */
        0 0 20px rgba(26, 188, 156 , 0.7); /* Pink flash */
  }
}

/* New keyframe for reviews summary pulse */
@keyframes pulse-animation {
    0% { transform: scale(1); box-shadow: var(--shadow); }
    50% { transform: scale(1.015); box-shadow: 0 5px 25px rgba(0, 102, 255, 0.25); } /* Primary color shadow emphasis */
    100% { transform: scale(1); box-shadow: var(--shadow); }
}

/* Language Toggle Button Styling */
.title-container {
    display: flex; 
    align-items: center;
    justify-content: space-between; /* Title left (effectively center with grow), button right */
    width: 100%; /* Ensure full width */
    position: relative; /* Keep for absolute positioning of pseudo-elements if ever needed, or just good practice for containers */
}

.title-container h1 { /* Targeting h1 specifically within title-container */
    flex-grow: 1; /* Allows the title to take up available space */
    text-align: center; /* Centers the text within the h1 element */
    /* Add margin-left to compensate for the button on the right, trying to re-center the title */
    /* This value should ideally match the effective width of the #lang-toggle-btn */
    /* Let's estimate button width: padding (12+12) + text width (e.g., 25-35px for '中文' or 'EN') ~ 50-60px */
    /* We will also add a small margin-right to ensure space between title and button */
    margin-left: 60px; /* Adjust this value as needed */
    margin-right: 10px; /* Provides some space if title is long */
}

#lang-toggle-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 12px; 
    font-size: 13px; 
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 10; 
    flex-shrink: 0; /* Prevent button from shrinking if title is very long */
}

#lang-toggle-btn:hover {
    background-color: var(--secondary-color);
}

/* .chat-header already has position: relative and padding-right: 100px, which should be sufficient. */
/* If .main-title needs specific adjustment due to the button, it can be done here. */
/* For example, if .main-title is very long: */
/* .main-title { */
/*    max-width: calc(100% - 80px); /* Ensuring it doesn't go under the button */
/*    overflow: hidden; */
/*    text-overflow: ellipsis; */
/*    white-space: nowrap; */
/* } */

.chat-header p {
    color: var(--light-text);
}

.chat-messages {
    padding: 20px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    padding: 40px 0;
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.welcome-message p {
    color: var(--light-text);
}

.message {
    margin-bottom: 20px;
    display: flex;
}

.message-user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 15px;
    border-radius: var(--border-radius);
}

.message-user .message-content {
    background-color: var(--primary-color);
    color: white;
}

.message-ai .message-content {
    background-color: var(--hover-color);
    /* Ensure the bubble itself doesn't become too wide */
    max-width: 80%; /* This should already be there from .message-content */
    /* Add flex properties to center the image if it's smaller than the bubble */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Adjust padding as needed, maybe less if image is main content */
    border-radius: var(--border-radius);
}

.message-ai .message-content img {
  display: block;       /* Good practice for images */
  max-width: 100%;      /* Image will not be wider than its container (.message-content) */
  width: auto;          /* Width will scale based on height or intrinsic aspect ratio */
  max-height: 300px;    /* Adjust this value as desired - e.g., 200px, 250px */
  max-width: 400px;
  height: auto;         /* Height will scale based on width or intrinsic aspect ratio */
  object-fit: contain;  /* Ensures the entire image fits within the above dimensions, scaled, maintaining aspect ratio */
  border-radius: 8px;   /* Match bubble radius or specific image style */
  /* margin-top: 0; Removed as flex alignment should handle spacing within padding of parent */
}

.chat-input-container {
    display: flex;
    align-items: center; /* This should vertically center items including send button */
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

#image-upload-label {
    /* This is for the paperclip icon button itself */
    /* It already uses .chat-control-btn, so its size (40x40) is set there */
    /* No specific changes needed here if .chat-control-btn is correct for the icon */
    /* Ensure it doesn't try to contain the preview anymore */
    position: static; /* Override if any previous absolute/relative positioning for the label was made */
    overflow: visible; /* Default */
    width: 40px; /* Explicitly from .chat-control-btn if needed */
    height: 40px; /* Explicitly from .chat-control-btn */
    padding: 0; /* From .chat-control-btn */
}

/* New container for the image preview image and its remove button */
#image-preview-container {
    position: relative; /* For absolute positioning of remove-image-btn */
    width: 120px;  /* Slightly wider */
    height: 100px; /* Match chat input height */
    border-radius: var(--border-radius);
    overflow: hidden; /* If image is larger, it will be clipped by object-fit:cover */
    display: none; /* Initially hidden, JS will show it */
}

#image-preview {
    display: block; /* Remove extra space below image */
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if necessary */
    border-radius: var(--border-radius); /* Match container's radius if desired */
}

#remove-image-btn {
    display: none; /* Initially hidden, JS handles visibility */
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 17px; /* Adjusted for new height */
    text-align: center;
    cursor: pointer;
    position: absolute; 
    top: 3px;  /* Position on top-right of the preview */
    right: 3px; 
    z-index: 10;
}

#download-image-btn {
    display: none; /* Initially hidden, JS handles visibility */
    /* background-color: rgba(0, 102, 255, 0.7); Re-style as a proper button if needed */
    /* color: white; */
    /* border: none; */
    /* border-radius: 50%; */
    width: 36px; /* Increased size - larger */
    height: 36px; /* Increased size - larger */
    font-size: 16px; /* Increased icon size */
    /* line-height: 34px; */ /* chat-control-btn handles flex centering */
    /* text-align: center; */
    /* cursor: pointer; */
    /* position: static; Remove absolute positioning */
    /* z-index: auto; */
    /* margin-left: 8px; /* Space it from the preview container, .chat-input-container gap will handle this */
    /* Ensure it uses .chat-control-btn styles for consistency if desired, or style uniquely */
}

#download-image-btn i.fas.fa-download {
    /* Icon specific styles if needed, e.g., color */
}

#download-image-btn:hover,
#remove-image-btn:hover {
    opacity: 0.8;
}

#chat-input {
    flex-grow: 1;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 15px; /* Keep left padding */
    padding-right: 5px; /* Reduce right padding to give more space */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: #fff;
    font-size: 16px;
    resize: none; 
    overflow-y: hidden; 
    min-height: 100px; /* Increased from 40px */
    line-height: 1.5; 
    text-align: left; 
}

.chat-control-btn { /* Generic class for control buttons including send button and image upload label */
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    padding: 0; /* Remove padding to rely on width/height for centering icon */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex; /* Changed from flex to inline-flex for label */
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Ensure #image-upload-label which also uses chat-control-btn keeps its specific dimensions and styles if they differ */
#image-upload-label.chat-control-btn {
    width: 70px; /* As set above */
    height: 50px; /* As set above */
    border-radius: var(--border-radius); /* Rectangular */
    padding: 5px; /* As set above */
     /* justify-content: flex-start; /* Align items (icon, preview, buttons) to the left */
}

#send-btn { /* This already uses .chat-control-btn and should be centered by align-items in container */
    /* No specific changes needed if .chat-control-btn and container are correct */
}

.scenario-buttons {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.scenario-buttons h3 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.scenario-btn {
    padding: 17px;
    background-color: var(--hover-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scenario-btn i {
    font-size: 16px;
}

.scenario-btn:hover {
    background-color: var(--border-color);
}

.scenario-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Colorful Scenario Icons */
.scenario-grid .scenario-btn[data-scenario="general"] i { color: #5DADE2; } /* Light Blue */
.scenario-grid .scenario-btn[data-scenario="code"] i { color: #F39C12; } /* Orange */
.scenario-grid .scenario-btn[data-scenario="creative"] i { color: #8E44AD; } /* Purple */
.scenario-grid .scenario-btn[data-scenario="analysis"] i { color: #f7dc6f; } /* Green */
.scenario-grid .scenario-btn[data-scenario="education"] i { color: #AF601A; } /* Brown */
.scenario-grid .scenario-btn[data-scenario="translation"] i { color: #E74C3C; } /* Red */
.scenario-grid .scenario-btn[data-scenario="imageanalysis"] i { color: #16A085; } /* Teal */
.scenario-grid .scenario-btn[data-scenario="aipainting"] i { color: #FF69B4; } /* Pink */
.scenario-grid .scenario-btn[data-scenario="imagetoimage"] i { color: #483D8B; } /* Dark Slate Blue */

/* 用户评价页面样式 */
.reviews-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.reviews-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.reviews-header h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.reviews-header p {
    color: var(--light-text);
}

.reviews-categories {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.category-btn {
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background-color: var(--hover-color);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.review-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.review-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    margin-bottom: 15px;
}

.review-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.review-user h3 {
    margin-bottom: 5px;
}

.rating {
    color: #ffcc00;
}

.review-text {
    margin-bottom: 15px;
    color: var(--text-color);
    line-height: 1.6;
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
}

.review-tags span {
    padding: 5px 10px;
    background-color: var(--hover-color);
    border-radius: 20px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.reviews-summary {
    background-color: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 30px;
    animation: pulse-animation 3s infinite ease-in-out;
}

.reviews-summary h2 {
    margin-bottom: 15px;
}

.rating-large {
    font-size: 24px;
    color: #ffcc00;
    margin-bottom: 20px;
}

.rating-large span {
    color: var(--text-color);
    margin-left: 10px;
    font-size: 20px;
}

.rating-categories {
    max-width: 500px;
    margin: 0 auto;
}

.rating-category {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.rating-category span {
    width: 100px;
    text-align: left;
}

.rating-category span:last-child {
    width: 40px;
    text-align: right;
}

.rating-bar {
    flex: 1;
    height: 8px;
    background-color: var(--hover-color);
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background-color: var(--primary-color);
}

/* Marquee Review Styles */
.marquee-wrapper {
    position: relative;
    display: flex;
    height: 1200px; /* Adjust as needed */
    width: 100%;
    max-width: 900px; /* Match reviews-container */
    margin: 20px auto; /* Spacing */
    overflow: hidden;
    gap: 20px; /* Space between columns */
    padding: 0 10px; /* Padding for cards not to touch edges */
}

.marquee-column {
    display: flex;
    flex-direction: column;
    flex-basis: 0;
    flex-grow: 1;
    min-width: 0; /* Important for flex basis 0 to work */
    height: fit-content; /* Allow content to determine height for animation */
}

.marquee-column .review-card {
    width: calc(100% - 10px); /* Adjust width to fit column, considering potential padding/margin */
    margin-bottom: 15px;
    flex-shrink: 0; /* Prevent cards from shrinking */
}

#marquee-column-1 {
    animation: marquee-scroll-up 40s linear infinite;
}

#marquee-column-2 {
    animation: marquee-scroll-down 40s linear infinite;
}

/* Updated hover rule for marquee columns to ensure animation pauses ON THE SPECIFIC COLUMN */
#marquee-column-1:hover {
    animation-play-state: paused;
}

#marquee-column-2:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll-up {
    0% {
        transform: translateY(0%);
    }
    100% {
        transform: translateY(-50%); /* Scroll one full set of duplicated items */
    }
}

@keyframes marquee-scroll-down {
    0% {
        transform: translateY(-50%); /* Start from the end of the first set */
    }
    100% {
        transform: translateY(0%);
    }
}

.marquee-fade-top,
.marquee-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 20%; /* Adjust fade height */
    pointer-events: none;
    z-index: 2;
}

.marquee-fade-top {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-color) 0%, transparent 100%);
}

.marquee-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
}

/* Site Footer */
.site-footer {
    padding: 20px;
    background-color: #1a1a2e;
    color: #e0e0e0;
    border-top: 1px solid #3a3a5e;
    width: calc(100% - 280px); /* Adjusted for main content area */
    margin-left: 280px;      /* Adjusted for main content area */
    flex-shrink: 0;
    text-align: center;
    position: relative;
}

/* Specific footer style for privacy policy page */
body.page-privacy-policy .site-footer {
    width: 100%;
    margin-left: 0;
}

/* Styles for Login and Register pages */
body.page-login,
body.page-register {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between; /* Push footer to bottom */
}

body.page-login .container,
body.page-register .container {
    display: flex; /* Enable flex for centering auth-container */
    flex-direction: column; /* Stack children vertically */
    justify-content: center; /* Center auth-container vertically */
    align-items: center; /* Center auth-container horizontally */
    flex-grow: 1; /* Allow container to grow and push footer down */
    width: 100%; /* Ensure container takes full width */
    min-height: auto; /* Override general .container min-height */
}

/* Ensure auth-container itself does not stretch full width if not desired */
body.page-login .auth-container,
body.page-register .auth-container {
    /* max-width can be set here if the auth-container should not be overly wide */
    /* For now, relying on its internal width or pre-existing .auth-container styles */
}

body.page-login .site-footer,
body.page-register .site-footer {
    width: 100%;
    margin-left: 0;
    /* position: relative; /* Ensure it's part of the flow, not absolutely positioned */
    /* bottom: 0; /* Not needed if using flexbox correctly */
}

.footer-top-line {
    display: flex;
    justify-content: center; /* 居中对齐 */
    align-items: center;
    gap: 25px;
    margin-bottom: 10px;
    font-size: 14px;
    border-bottom: 1px solid #3a3a5e;
    padding-bottom: 10px;
    flex-wrap: wrap; /* 在小屏幕上允许换行 */
}

.footer-top-line a {
    color: #e0e0e0;
    text-decoration: none;
}

.footer-top-line a:hover {
    text-decoration: underline;
}

.footer-bottom-line {
    display: flex;
    justify-content: center; /* 居中对齐 */
    align-items: center;
    gap: 25px;
    font-size: 14px;
    flex-wrap: wrap; /* 在小屏幕上允许换行 */
}

.footer-bottom-line a {
    color: #e0e0e0;
    text-decoration: none;
}

.footer-bottom-line a:hover {
    text-decoration: underline;
}

.site-footer p {
    text-align: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

/* Styles for the body of authentication pages */
body.auth-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg-color);
}

body.auth-body > .container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    height: auto; 
    overflow: visible; 
}

body.auth-body .main-content.auth-page {
    padding: 30px;
    width: 100%;
    max-width: 500px;
    margin: 100px auto;
}

/* Override margins for login/register pages to allow proper flex centering */
body.page-login .main-content.auth-page,
body.page-register .main-content.auth-page {
    margin-top: 0;
    margin-bottom: 0;
}

.auth-container {
    max-width: 500px;
    width: 100%;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-container .chat-header {
    border-bottom: 1px solid var(--border-color);
}

.auth-form {
    padding: 25px 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

.auth-btn {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: var(--secondary-color);
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--light-text);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-container .main-title {
    font-size: 28px;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;
    color: var(--primary-color);
    animation: none;
    text-shadow: none;
    min-height: auto;
}

.auth-container .main-title::after {
    content: none;
}

.google-login-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: #ffffff;
    color: #4285F4;
    border: 1px solid #dadce0;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

.google-login-btn i.fab.fa-google {
    margin-right: 10px;
    font-size: 18px;
    color: #DB4437;
}

.google-login-btn:hover {
    background-color: #f8f9fa;
    border-color: #c6c9cc;
}

.auth-footer-link {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
}

.auth-footer-link a {
    color: var(--light-text);
    text-decoration: none;
}

.auth-footer-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .chat-history {
        display: none;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .title-container h1 {
        margin-left: 10px;
        font-size: 24px;
    }

    #lang-toggle-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .auth-container .main-title {
        font-size: 24px;
    }

    .scenario-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

#custom-mouse-pointer {
    position: fixed;
    left: -50px;
    top: -50px;
    width: 40px;
    height: 40px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    transform-origin: center center;
    animation: custom-pointer-bob 1.5s infinite ease-in-out;
}

#custom-mouse-pointer.visible {
    opacity: 1;
}

#custom-mouse-pointer svg {
    width: 100%;
    height: 100%;
    color: #ec4899;
}

#custom-mouse-pointer svg path {
    fill: currentColor;
    animation: custom-pointer-heartbeat 0.8s infinite ease-in-out;
    transform-origin: center center;
}

@keyframes custom-pointer-bob {
    0%, 100% {
        transform: scale(0.8) rotate(0deg);
    }
    50% {
        transform: scale(1) rotate(5deg);
    }
    75% {
        transform: scale(1) rotate(-5deg);
    }
}

@keyframes custom-pointer-heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

#animated-lines-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.flashing-line {
    position: absolute;
    opacity: 0;
    border-radius: 2px;
    z-index: 0;
}

@keyframes line-flash-pulse {
    0% { opacity: 0.1; box-shadow: 0 0 4px 1px transparent; transform: scale(0.95); }
    50% { opacity: 0.7; box-shadow: 0 0 12px 3px var(--flash-color, rgba(255,255,255,0.5)); transform: scale(1.05); }
    100% { opacity: 0.1; box-shadow: 0 0 4px 1px transparent; transform: scale(0.95); }
}

.flashing-line.line-1 {
    top: 10%; left: -5%;
    width: 40%; height: 2px;
    background: linear-gradient(90deg, #ff3b30, #ff9500);
    --flash-color: #ff5e1a;
    animation: line-flash-pulse 4s infinite ease-in-out 0s, move-line-1 15s infinite linear alternate 0s;
}
@keyframes move-line-1 { 
    0% { transform: translateX(0%) rotate(-5deg); } 
    100% { transform: translateX(150%) rotate(5deg); left: 30%;}
}

.flashing-line.line-2 {
    top: -5%; right: 15%;
    width: 2px; height: 35%;
    background: linear-gradient(0deg, #34c759, #00c2cb);
    --flash-color: #34c759;
    animation: line-flash-pulse 3.5s infinite ease-in-out 0.5s, move-line-2 12s infinite linear alternate 0.5s;
}
@keyframes move-line-2 { 
    0% { transform: translateY(0%) rotate(3deg); } 
    100% { transform: translateY(200%) rotate(-3deg); top: 40%;}
}

.flashing-line.line-3 {
    bottom: 5%; right: -10%;
    width: 50%; height: 3px;
    background: linear-gradient(270deg, #007aff, #5856d6);
    --flash-color: #007aff;
    animation: line-flash-pulse 4.5s infinite ease-in-out 1s, move-line-3 18s infinite linear alternate 1s;
}
@keyframes move-line-3 { 
    0% { transform: translateX(0%) rotate(4deg); } 
    100% { transform: translateX(-180%) rotate(-6deg); left: -20%;} 
}

.flashing-line.line-4 {
    bottom: 20%; left: 30%;
    width: 25%; height: 2px;
    transform: rotate(-30deg);
    background: linear-gradient(90deg, #af52de, #ff2d55);
    --flash-color: #af52de;
    animation: line-flash-pulse 3s infinite ease-in-out 1.5s;
}

.flashing-line.line-5 {
    top: 40%; left: 45%;
    width: 3px; height: 20%;
    transform: rotate(20deg);
    background: linear-gradient(0deg, #ffcc00, #ff9500);
    --flash-color: #ffcc00;
    animation: line-flash-pulse 5s infinite ease-in-out 2s;
}

.flashing-line.line-6 {
    top: 70%; left: 10%;
    width: 35%; height: 2px;
    transform: rotate(15deg);
    background: linear-gradient(90deg, #5ac8fa, #007aff);
    --flash-color: #5ac8fa;
    animation: line-flash-pulse 3.8s infinite ease-in-out 2.5s, move-line-6 20s infinite ease-in-out alternate 2.5s;
}
@keyframes move-line-6 {
    0% { transform: translate(0px, 0px) rotate(15deg); }
    50% { transform: translate(20px, -10px) rotate(10deg); }
    100% { transform: translate(0px, 0px) rotate(15deg); }
}

#page-particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.clear-all-history-container {
    padding: 5px 10px;
    margin-bottom: 5px;
}

.clear-all-history-actual-btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
    display: block;
}

.clear-all-history-actual-btn:hover {
    background-color: #0056b3;
}

.chat-item .delete-history-item-btn {
    background-color: transparent;
    color: #adb5bd;
    border: none;
    padding: 0 5px;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    float: right;
    margin-left: 5px;
}

.chat-item .delete-history-item-btn:hover {
    color: #ff4d4d;
}

.chat-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.chat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item > i {
    margin-right: 8px;
}

.message.ai-message img {
  display: block;
  width: 300px;
  height: 300px;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
  background-color: rgba(0,0,0,0.03);
}

.message.ai-thinking img {
  max-width: 100px;
  max-height: 100px;
} 

.clear-all-history-container {
    padding: 5px 10px;
    margin-bottom: 5px;
}

.clear-all-history-actual-btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
    display: block;
}

.clear-all-history-actual-btn:hover {
    background-color: #0056b3;
}

.chat-item .delete-history-item-btn {
    background-color: transparent;
    color: #adb5bd;
    border: none;
    padding: 0 5px;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    float: right;
    margin-left: 5px;
}

.chat-item .delete-history-item-btn:hover {
    color: #ff4d4d;
}

.chat-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.chat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item > i {
    margin-right: 8px;
}

.image-size-selector {
    display: flex;
    gap: 220px;
    justify-content: flex-start;
    align-items: center;
    margin: 10px 0 0 0;
    padding-left: 10px;
}

.size-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    border-radius: 18px;
    padding: 5px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.size-btn.active, .size-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 隐私政策页面样式 */
.privacy-policy-content {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px 40px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible; /* 改为visible，允许内容溢出 */
}

.privacy-policy-content h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    position: relative; /* Ensure this is set for absolute positioning of child button */
    padding-bottom: 15px;
    /* Add padding-right to make space for the button if needed, e.g., padding-right: 80px; */
}

.privacy-policy-content h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.privacy-policy-content section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.privacy-policy-content section:last-child {
    border-bottom: none;
}

.privacy-policy-content h2 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.privacy-policy-content h2:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.privacy-policy-content p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

.privacy-policy-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.privacy-policy-content li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    line-height: 1.6;
}

.privacy-policy-content li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 18px;
}

.back-to-home {
    text-align: center;
    margin-top: 40px;
}

.back-to-home a {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.2);
}

.back-to-home a:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 102, 255, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .privacy-policy-content {
        padding: 20px;
        margin: 20px;
    }
    
    .privacy-policy-content h1 {
        font-size: 26px;
    }
    
    .privacy-policy-content h2 {
        font-size: 20px;
    }
}
/* 针对隐私政策页面的特殊容器样式 */
body .container {
    height: auto; /* 覆盖默认的100vh高度 */
    overflow: visible;
}

/* 修复移动端响应式布局 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .chat-history {
        display: none;
    }
}

/* 针对auth-body的特殊处理 */
body.auth-body > .container {
    flex-direction: column;
}

body.auth-body .sidebar {
    display: none;
}

body.auth-body .main-content {
    margin-left: 0;
    width: 100%;
}

/* Positioning for lang-toggle-btn specifically on privacy page h1 */
.privacy-policy-content h1 #lang-toggle-btn {
    position: absolute;
    top: 20px; /* Adjust as needed for alignment */
    right: 20px; /* Adjust as needed for alignment */
}

/* Styles for User Profile in Sidebar */
.user-profile-sidebar-container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    position: relative; /* For dropdown positioning */
}

.user-profile-sidebar-container:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 2rem; /* 修改/确保 */
    height: 2rem; /* 修改/确保 */
    border-radius: 50%; /* 修改/确保 */
    object-fit: cover; /* 新增，确保图片内容适应圆形 */
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Optional: adds a light border */
}

.user-avatar-initial {
    width: 2rem; /* 修改/确保 */
    height: 2rem; /* 修改/确保 */
    border-radius: 50%; /* 修改/确保 */
    display: flex; /* 新增/确保 */
    align-items: center; /* 新增/确保 */
    justify-content: center; /* 新增/确保 */
    color: white; /* 新增/确保 */
    font-weight: bold;
    margin-right: 10px;
    background-color: #cccccc; /* Fallback, JS will override */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Optional: adds a light border */
}

.user-name {
    font-weight: 500;
    flex-grow: 1; /* Allow name to take space */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position below the user profile container */
    left: 0;
    background-color: var(--sidebar-bg); /* Or a slightly darker/lighter shade */
    background-image: linear-gradient(145deg, #00c6fb 0%, #c39bd3 100%); /* Match sidebar */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none; /* Avoid double border with container */
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 110; /* Ensure it's above other sidebar content */
    min-width: 180px; /* Adjust as needed */
    padding: 5px 0;
}

.user-dropdown a {
    display: block;
    padding: 8px 15px;
    color: #f7f9f9; /* Match sidebar text color */
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Slightly lighter for hover */
}

/* Ensure original login button is hidden correctly if user is logged in */
.nav-links a.login-btn[style*="display: none"] {
    /* This rule is mostly for specificity confirmation, JS handles display directly */
}

#page-particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* or a very low z-index */
    /* pointer-events: none; if it should not interfere with mouse */
}