/* 考虑引入一个自定义字体，例如 Google Fonts 的 "Poppins" 或 "Nunito" */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;900&display=swap');

/* ===== CSS兼容性降级样式 ===== */
/* 为不支持CSS变量的老版本浏览器提供降级样式 */

/* 降级样式：直接使用颜色值 */
body {
    background-color: #2a004f; /* 降级：主背景色 */
    color: #f0e6ff; /* 降级：浅色文字 */
}

h1, h2, h3 {
    color: #ff00ff; /* 降级：霓虹粉标题色 */
    text-shadow: 0 0 2px #fff, 0 0 5px #ff00ff, 0 0 8px #ff00ff; /* 降级：发光效果 */
}

.hero-section h1 {
    font-size: 3em; /* 降级：固定字体大小，替代clamp() */
}

.hero-section p {
    font-size: 1.2em; /* 降级：固定字体大小，替代clamp() */
}

/* 现代浏览器的CSS变量定义（会覆盖上面的降级样式） */
:root {
    --primary-glow-color: #ff00ff; /* 霓虹粉 */
    --secondary-glow-color: #8A2BE2; /* 紫罗兰色 */
    --text-color-light: #f0e6ff;
    --text-color-medium: #c0b0d0;
    --bg-dark-purple: #1a082e; /* 更深的背景 */
    --bg-medium-purple: #2a004f; /* 主背景 */
    --bg-card-purple: rgba(30, 10, 50, 0.7); /* 卡片背景，带透明度 */
    --glow-text-shadow: 0 0 2px #fff, 0 0 5px var(--primary-glow-color), 0 0 8px var(--primary-glow-color);
    --glow-box-shadow: 0 0 10px var(--primary-glow-color);
    --error-color: #ff6b6b; /* 错误信息颜色 */
}

body {
    font-family: 'Nunito', 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-medium-purple);
    color: var(--text-color-light);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

h1, h2, h3 {
    color: var(--primary-glow-color);
    text-shadow: var(--glow-text-shadow);
    font-weight: 900;
}

h1 { font-size: 3em; margin-bottom: 0.5em; }
h2 { font-size: 2.2em; margin-bottom: 0.7em; text-align: center; }
p { margin-bottom: 1em; }

a {
    color: var(--primary-glow-color);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
a:hover {
    color: #fff;
    text-shadow: 0 0 8px #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.site-header {
    background-color: var(--bg-dark-purple);
    padding: 15px 0;
    border-bottom: 2px solid var(--primary-glow-color);
    box-shadow: 0 2px 10px rgba(var(--primary-glow-color), 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px var(--primary-glow-color);
}
.logo .logo-subtitle {
    font-size: 0.6em;
    display: block;
    color: var(--text-color-medium);
    font-weight: normal;
    margin-top: -5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-color-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 0, 255, 0.1);
    color: var(--primary-glow-color);
}

/* 认证按钮区域 */
.auth-section {
    display: flex;
    gap: 10px;
}

/* 用户信息区域 */
.user-section {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-color-light);
    font-weight: 600;
}

.credits {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a082e;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}

.user-menu-btn {
    background: var(--primary-glow-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: var(--secondary-glow-color);
    transform: scale(1.1);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-dark-purple);
    border: 1px solid var(--primary-glow-color);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color-light);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.user-dropdown a:hover {
    background-color: rgba(255, 0, 255, 0.1);
    color: var(--primary-glow-color);
}

.user-dropdown a i {
    margin-right: 8px;
    width: 16px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-nav li {
    margin-left: 0;
}

.main-nav a {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-color-light);
}
.main-nav a:hover {
    color: var(--primary-glow-color);
    text-shadow: 0 0 5px var(--primary-glow-color);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-color-light);
}
.theme-toggle:hover svg {
    stroke: var(--primary-glow-color);
}

/* 认证面板样式 */
.auth-panel {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary-glow-color);
    background: transparent;
    color: var(--primary-glow-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9em;
}

.auth-btn:hover {
    background: var(--primary-glow-color);
    color: white;
    transform: translateY(-1px);
}

.auth-btn.register {
    background: var(--primary-glow-color);
    color: white;
}

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

/* 用户面板样式 */
.user-panel {
    display: flex;
    align-items: center;
    gap: 20px;
}

.credits-display {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a082e;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: var(--bg-card-purple);
    border: 1px solid var(--primary-glow-color);
    color: var(--text-color-light);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.user-menu-toggle:hover {
    background: rgba(255, 0, 255, 0.1);
    border-color: var(--secondary-glow-color);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-dark-purple);
    border: 1px solid var(--primary-glow-color);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color-light);
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid rgba(255, 0, 255, 0.1);
    font-size: 0.9em;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background-color: rgba(255, 0, 255, 0.1);
    color: var(--primary-glow-color);
}

.user-dropdown a i {
    margin-right: 8px;
    width: 16px;
}

/* 登录提示样式 */
.login-prompt {
    background: rgba(255, 0, 255, 0.05);
    border: 2px dashed rgba(255, 0, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    color: var(--text-color-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-prompt i {
    color: var(--primary-glow-color);
}

/* 积分信息提示 */
.credits-info {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
    color: #ffd700;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.credits-info i {
    font-size: 1.1em;
}

/* 占位符内容样式 */
.placeholder-content {
    background: rgba(255, 0, 255, 0.05);
    border: 2px dashed rgba(255, 0, 255, 0.3);
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-color-medium);
}

.placeholder-content i {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--primary-glow-color);
}

.hero-section {
    min-height: calc(80vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 0;
    background: var(--bg-medium-purple);
}

.hero-section h1 {
    font-size: 3.5em; /* 降级：固定字体大小 */
    font-size: clamp(2.5em, 6vw, 4.5em); /* 现代浏览器使用响应式字体 */
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff00ff, #8A2BE2, #00ffff); /* 降级：直接使用颜色值 */
    background: linear-gradient(45deg, var(--primary-glow-color), var(--secondary-glow-color), #00ffff); /* 现代浏览器使用变量 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    animation: hue-rotate 10s infinite linear;
}

@keyframes hue-rotate {
    to { filter: hue-rotate(360deg); }
}

.hero-section p {
    font-size: 1.2em; /* 降级：固定字体大小 */
    font-size: clamp(1em, 2.5vw, 1.3em); /* 现代浏览器使用响应式字体 */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: #c0b0d0; /* 降级：直接使用颜色值 */
    color: var(--text-color-medium); /* 现代浏览器使用变量 */
    margin-bottom: 40px;
}

.scroll-down-arrow {
    display: inline-block;
    animation: bounce 2s infinite;
}
.scroll-down-arrow svg {
    width: 40px;
    height: 40px;
    stroke: var(--primary-glow-color);
    stroke-width: 2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

main {
    flex: 1;
    padding-top: 30px;
    padding-bottom: 30px;
}

section {
    padding: 40px 0;
    margin-bottom: 30px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-color-medium);
    font-size: 1.1em;
    margin-top: -10px;
    margin-bottom: 30px;
}

.coloring-page .container,
.color-palette-section .container {
    background-color: var(--bg-card-purple);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3), inset 0 0 10px rgba(var(--primary-glow-color),0.2);
}


.image-container {
    position: relative; /* Needed for absolute positioning of overlay */
    width: 100%;
    max-width: 700px;
    margin: 0 auto 30px auto;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-height: 200px; /* 给容器一个最小高度，防止加载时塌陷 */
    display: flex; /* 用于垂直居中加载指示器 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

#main-coloring-image {
    display: block;
    width: 100%;
    transition: opacity 0.3s ease; /* 平滑过渡效果 */
}

/* 加载指示器样式 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: flex; /* 使用 flex 布局 */
    flex-direction: column; /* 垂直排列图标和文字 */
    justify-content: center; /* 垂直居中 */
    align-items: center; /* 水平居中 */
    color: var(--primary-glow-color);
    font-size: 1.5em;
    z-index: 20; /* 确保在图片之上 */
    border-radius: 10px; /* 保持圆角一致 */
    text-align: center;
}

.loading-overlay i { /* Font Awesome spinner icon */
    font-size: 2em; /* 图标大小 */
    margin-bottom: 15px; /* 图标和文字间距 */
    text-shadow: var(--glow-text-shadow);
}
.loading-overlay p {
    margin: 0;
    font-size: 0.8em;
    color: var(--text-color-light);
}


#color-reference-image {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 20%;
    max-width: 120px;
    border: 2px solid var(--primary-glow-color);
    box-shadow: 0 0 8px rgba(var(--primary-glow-color),0.5);
    background-color: #fff;
    z-index: 10;
    border-radius: 8px;
}

.info-box {
    background-color: rgba(10, 0, 20, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid rgba(var(--primary-glow-color), 0.3);
    box-shadow: inset 0 0 8px rgba(var(--primary-glow-color),0.2);
    color: var(--text-color-light);
}
.info-box p {
    margin: 5px 0;
    font-size: 1em;
}
.info-box strong {
    color: var(--primary-glow-color);
    display: block; /* 让标题独占一行 */
    margin-bottom: 10px; /* 标题和输入框间距 */
}

/* 新增：图片描述和生成控制区域特定样式 */
.generation-controls {
    text-align: center; /* 让内部元素居中 */
}

/* 新增：输入框样式 */
#prompt-input {
    display: block; /* 独占一行 */
    width: calc(100% - 40px); /* 占据大部分宽度，留出内边距 */
    padding: 12px 20px;
    margin: 0 auto 15px auto; /* 上下边距，左右自动居中 */
    font-size: 1em;
    color: var(--text-color-light);
    background-color: rgba(0, 0, 0, 0.3); /* 半透明背景 */
    border: 1px solid var(--secondary-glow-color);
    border-radius: 25px; /* 圆角 */
    box-shadow: inset 0 0 8px rgba(var(--secondary-glow-color), 0.4);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none; /* 移除默认轮廓 */
}
#prompt-input::placeholder {
    color: var(--text-color-medium);
    opacity: 0.7;
}
#prompt-input:focus {
    border-color: var(--primary-glow-color);
    box-shadow: inset 0 0 10px rgba(var(--primary-glow-color), 0.5), 0 0 5px var(--primary-glow-color);
}

/* 新增：生成按钮样式 */
#generate-button {
    display: inline-block; /* 行内块元素 */
    background-image: linear-gradient(to right, var(--secondary-glow-color), var(--primary-glow-color));
    color: #fff;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px var(--primary-glow-color), 0 0 15px var(--primary-glow-color) inset;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}
#generate-button:hover:not(:disabled),
#generate-button:focus:not(:disabled) {
    background-image: linear-gradient(to right, var(--primary-glow-color), var(--secondary-glow-color));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 12px var(--primary-glow-color), 0 0 25px var(--primary-glow-color) inset, 0 4px 8px rgba(0,0,0,0.3);
    outline: none;
}
#generate-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-image: linear-gradient(to right, #555, #777); /* 禁用时的灰色渐变 */
    box-shadow: none;
}
#generate-button i { /* 按钮图标样式 */
    margin-right: 8px;
}

/* 按钮容器样式 - 确保两个按钮能够很好地并排显示 */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* 确保生成按钮在容器中正确显示 */
#generate-button,
.generate-colors-btn {
    flex: 0 0 auto; /* 不伸缩，保持原始大小 */
}

/* 新增：错误信息样式 */
.error-text {
    color: var(--error-color);
    font-size: 0.9em;
    margin-top: 10px; /* 与按钮的间距 */
    text-align: center;
    display: block; /* 确保独占一行 */
}


.download-button {
    display: block; /* 改为块级，方便居中 */
    background-image: linear-gradient(to right, var(--secondary-glow-color), var(--primary-glow-color));
    color: #fff;
    padding: 15px 35px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 30px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0 10px var(--primary-glow-color), 0 0 20px var(--primary-glow-color) inset;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    margin: 30px auto 25px auto; /* 调整与其他元素的间距 */
    width: fit-content;
}

.download-button:hover,
.download-button:focus {
    background-image: linear-gradient(to right, var(--primary-glow-color), var(--secondary-glow-color));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 15px var(--primary-glow-color), 0 0 30px var(--primary-glow-color) inset, 0 5px 10px rgba(0,0,0,0.3);
    outline: none;
}

.printing-tip {
    border-left: 5px solid var(--secondary-glow-color);
}

.color-palette-section h2 {
    margin-bottom: 15px;
}

.color-swatches {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.5), 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255,255,255,0.8), 0 4px 8px rgba(0,0,0,0.4);
}

.palette-tip {
    font-size: 0.95em;
    text-align: center;
    color: var(--text-color-medium);
    max-width: 600px;
    margin: 0 auto;
}
.palette-tip strong {
    color: var(--primary-glow-color);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-glow-color), var(--secondary-glow-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-glow-color);
    color: var(--primary-glow-color);
}

.btn-outline:hover {
    background: var(--primary-glow-color);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-dark-purple);
    margin: 5% auto;
    padding: 0;
    border: 2px solid var(--primary-glow-color);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    background: linear-gradient(45deg, var(--primary-glow-color), var(--secondary-glow-color));
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    text-shadow: none;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ccc;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 0, 255, 0.3);
    border-radius: 5px;
    background: var(--bg-medium-purple);
    color: var(--text-color-light);
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-glow-color);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
}

.form-hint {
    font-size: 0.9em;
    color: var(--text-color-medium);
    margin-top: 5px;
}

/* 消息样式 */
.message {
    padding: 12px;
    border-radius: 5px;
    margin: 15px 0;
    font-weight: 600;
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    color: #4CAF50;
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
}

.message.warning {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ff9800;
}

/* 登录提示区域 */
.login-prompt {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 0, 255, 0.05);
    border: 2px dashed rgba(255, 0, 255, 0.3);
    border-radius: 10px;
    margin: 40px 0;
}

.prompt-content i {
    font-size: 3em;
    color: var(--primary-glow-color);
    margin-bottom: 20px;
}

.prompt-content h3 {
    margin: 20px 0;
    color: var(--primary-glow-color);
}

/* 积分信息提示 */
.credits-info {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    color: #ffd700;
    font-weight: 600;
}

.credits-info i {
    margin-right: 8px;
    font-size: 1.2em;
}



.site-footer {
    text-align: center;
    padding: 30px 0;
    background-color: var(--bg-dark-purple);
    color: var(--text-color-medium);
    margin-top: auto;
    border-top: 1px solid rgba(var(--primary-glow-color), 0.2);
    position: relative;
}

.site-footer::before, .site-footer::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-glow-color);
    border-radius: 50%;
    opacity: 0;
    animation: footer-sparkle 4s infinite;
}
.site-footer::before { left: 20%; bottom: 20px; animation-delay: 0s; }
.site-footer::after { right: 20%; bottom: 30px; animation-delay: 2s; }

@keyframes footer-sparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 1.8em; }

    .header-container {
        flex-direction: column;
        align-items: center;
    }
    .main-nav { margin-top: 15px; }
    .main-nav ul { justify-content: center; }
    .main-nav li { margin: 0 10px; }
    .theme-toggle { margin-left: 0; margin-top: 10px; }

    .hero-section { min-height: 60vh; }
    .hero-section h1 {
        font-size: 2.5em; /* 降级：移动端固定字体大小 */
        font-size: clamp(2em, 8vw, 3.5em); /* 现代浏览器使用响应式字体 */
    }
    .hero-section p {
        font-size: 1em; /* 降级：移动端固定字体大小 */
        font-size: clamp(0.9em, 3vw, 1.1em); /* 现代浏览器使用响应式字体 */
    }

    .coloring-page .container,
    .color-palette-section .container {
        padding: 20px;
    }

    #color-reference-image {
        width: 25%;
        max-width: 100px;
        bottom: 10px;
        right: 10px;
    }
    .download-button, #generate-button { /* Apply responsive styles to both buttons */
        font-size: 1.1em;
        padding: 12px 25px;
    }
    #prompt-input {
        padding: 10px 15px;
        font-size: 0.95em;
    }
    .swatch { width: 40px; height: 40px; }
}

/* 邮箱验证提示样式 */
.verification-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
}

.notice-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.notice-content h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.notice-content p {
    margin: 5px 0 0 0;
    font-size: 0.9em;
    opacity: 0.9;
}

.notice-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-resend, .btn-close {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-resend:hover, .btn-close:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 1.5em; text-align: center; }
    .logo .logo-subtitle { font-size: 0.5em; }
    .main-nav ul { flex-wrap: wrap; /* 允许换行 */ }
    .main-nav li { margin: 5px 8px; }

    h1 { font-size: 2em; }
    h2 { font-size: 1.6em; }

    .hero-section { padding: 20px 0; }
    .scroll-down-arrow svg { width: 30px; height: 30px; }

    .coloring-page .container,
    .color-palette-section .container {
        padding: 15px;
    }

    #color-reference-image { display: none; }
    .download-button, #generate-button {
        font-size: 1em;
        padding: 10px 20px;
        width: 80%; /* Make buttons wider on small screens */
        margin-left: auto;
        margin-right: auto;
    }
     #prompt-input {
        width: calc(100% - 30px); /* Adjust width for padding */
        padding: 10px 15px;
    }
    .swatch { width: 35px; height: 35px; }
}

/* 购买积分模态框样式 */
.purchase-content {
    text-align: center;
    max-width: 100%;
}

.qr-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card-purple);
    border-radius: 10px;
    border: 1px solid var(--primary-glow-color);
}

.qr-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.wechat-qr {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary-glow-color);
    border-radius: 15px;
    background: white;
    padding: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.qr-hint {
    color: var(--text-color-medium);
    font-size: 0.9em;
    margin-top: 10px;
}

.price-section {
    margin-bottom: 30px;
    text-align: left;
}

.price-table {
    background: var(--bg-card-purple);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 0, 255, 0.2);
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 0, 255, 0.1);
    position: relative;
}

.price-item:last-child {
    border-bottom: none;
}

.price-item.popular {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    padding: 12px 10px;
    margin: 5px 0;
}

.price-item .credits {
    font-weight: 600;
    color: var(--primary-glow-color);
}

.price-item .price {
    font-weight: 600;
    color: #ffd700;
    font-size: 1.1em;
}

.popular-badge {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.price-note {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #ffd700;
}

.price-note i {
    color: #ffa500;
}

.instructions-section {
    margin-bottom: 30px;
    text-align: left;
}

.purchase-steps {
    background: var(--bg-card-purple);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 0, 255, 0.2);
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: linear-gradient(45deg, var(--primary-glow-color), var(--secondary-glow-color));
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.5;
}

.copy-username-btn {
    background: transparent;
    border: 1px solid var(--primary-glow-color);
    color: var(--primary-glow-color);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.copy-username-btn:hover {
    background: var(--primary-glow-color);
    color: white;
}

.notice-section {
    text-align: left;
}

.notice-box {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid #ff9800;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 12px;
}

.notice-box i {
    color: #ff9800;
    font-size: 1.2em;
    margin-top: 2px;
    flex-shrink: 0;
}

.notice-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.notice-content li {
    margin-bottom: 5px;
    color: var(--text-color-medium);
}

/* 交易记录列表样式 */
.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
    transition: background-color 0.3s ease;
}

.transaction-item:hover {
    background-color: rgba(255, 0, 255, 0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-desc {
    color: var(--text-color-light);
    font-weight: 600;
    margin-bottom: 5px;
}

.transaction-time {
    color: var(--text-color-medium);
    font-size: 0.9em;
}

.transaction-amount {
    font-weight: bold;
    font-size: 1.1em;
}

.transaction-amount.positive {
    color: #4CAF50;
}

.transaction-amount.negative {
    color: #f44336;
}

.empty, .error, .loading {
    text-align: center;
    padding: 40px;
    color: var(--text-color-medium);
}

.error {
    color: var(--error-color);
}

/* 购买积分移动端适配 */
@media (max-width: 768px) {
    .wechat-qr {
        width: 160px;
        height: 160px;
    }

    .price-item {
        padding: 10px 0;
    }

    .popular-badge {
        position: static;
        transform: none;
        margin-left: 10px;
    }

    .step {
        gap: 10px;
    }

    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }

    .transaction-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .transaction-amount {
        align-self: flex-end;
    }
}
