/* ===== Extract Color - 完美对齐重构版 ===== */
:root {
    --primary-500: #8b5cf6; --primary-600: #7c3aed; --primary-700: #6d28d9;
    --secondary-500: #ec4899; --secondary-600: #db2777;
    --accent-blue: #0ea5e9;
    --bg-gradient-start: #e0f2fe; --bg-gradient-middle: #f0f9ff; --bg-gradient-end: #fdf4ff;
    --surface-01: rgba(255, 255, 255, 0.9); --surface-02: rgba(255, 255, 255, 0.7);
    --text-primary: #1f2937; --text-secondary: #4b5563; --text-tertiary: #6b7280;
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-gradient-start: #1e1b4b; --bg-gradient-middle: #1e293b; --bg-gradient-end: #312e81;
    --surface-01: rgba(30, 41, 59, 0.85); --surface-02: rgba(30, 41, 59, 0.6);
    --text-primary: #f9fafb; --text-secondary: #e5e7eb; --text-tertiary: #d1d5db;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-middle), var(--bg-gradient-end));
    color: var(--text-primary); transition: all 0.5s ease; overflow-x: hidden;
}

/* 背景特效 */
.grid-background { position: fixed; inset: 0; z-index: -3; opacity: 0.05; background-image: radial-gradient(circle at 20% 30%, var(--primary-500) 0%, transparent 15%), radial-gradient(circle at 80% 70%, var(--secondary-500) 0%, transparent 15%); }
.geometric-shapes { position: fixed; inset: 0; z-index: -2; opacity: 0.15; }
.shape { position: absolute; opacity: 0.2; background: linear-gradient(45deg, var(--primary-500), var(--secondary-500)); animation: shapeFloat 20s infinite linear; }
.shape:nth-child(1) { width: 300px; height: 300px; border-radius: 30% 70% 70% 30%/30% 30% 70% 70%; top: -100px; left: -100px; }
.shape:nth-child(2) { width: 400px; height: 400px; border-radius: 50%; bottom: -150px; right: -100px; animation-delay: -5s; }
.shape:nth-child(3) { width: 200px; height: 200px; border-radius: 60% 40% 30% 70%; top: 40%; left: 80%; animation-delay: -10s; }
@keyframes shapeFloat { 100% { transform: translate(100px, 50px) rotate(360deg); } }

/* 头部图标与标题 */
.icon-container { width: 80px; height: 80px; }
.icon-glow { position: absolute; inset: -5px; background: linear-gradient(45deg, var(--primary-500), var(--secondary-500)); border-radius: 20px; filter: blur(15px); opacity: 0.6; animation: glowRotate 8s linear infinite; }
.icon-container i { background: linear-gradient(135deg, var(--primary-500), var(--secondary-500)); color: white; width: 100%; height: 100%; border-radius: 20px; display: flex; justify-content: center; align-items: center; font-size: 2.5rem; position: relative; z-index: 2; box-shadow: var(--shadow-lg); }
@keyframes glowRotate { 100% { transform: rotate(360deg); } }
.title { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, var(--primary-600), var(--secondary-600), var(--accent-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1px; }
.badge-item { background: var(--surface-01); padding: 8px 18px; border-radius: 24px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border-light); backdrop-filter: blur(20px); }

/* 主题按钮 */
.theme-toggle { top: 24px; right: 24px; width: 52px; height: 52px; background: var(--surface-01); backdrop-filter: blur(20px); border: 1px solid var(--border-light); cursor: pointer; transition: 0.3s ease; }
.theme-toggle:hover { transform: scale(1.1) rotate(15deg); border-color: var(--primary-500); }
.theme-toggle i { color: var(--text-secondary); font-size: 1.2rem; }

/* 核心毛玻璃卡片 */
.custom-glass-card { background: var(--surface-01); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border-light); border-radius: 24px; box-shadow: var(--shadow-lg); transition: all 0.4s ease; }
.card-glow { position: absolute; inset: -2px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)); z-index: -1; opacity: 0; transition: 0.4s ease; }
.custom-glass-card:hover .card-glow { opacity: 1; }

/* 输入控件（输入框、选择框） */
.custom-input { width: 100%; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 16px; background: var(--surface-02); color: var(--text-primary); font-size: 1rem; outline: none; transition: 0.3s ease; }
.custom-input:focus { border-color: var(--primary-500); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); background: var(--surface-01); }

/* ✅ 重点修复：为 Upload Image 专属定制高颜值样式 */
input[type="file"].custom-input {
    padding: 10px 16px;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    margin-right: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
input[type="file"]::file-selector-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

/* ✅ 重点修复：找回 Details 的背景外框 */
.bg-custom-light { background: var(--surface-02); border: 1px solid var(--border-light); border-radius: 16px; }

/* 调色板网格 */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); gap: 12px; }
.color-item { aspect-ratio: 1; border-radius: 12px; cursor: pointer; position: relative; overflow: hidden; border: 1px solid var(--border-light); transition: all 0.3s ease; }
.color-item:hover { transform: scale(1.1); z-index: 2; box-shadow: var(--shadow-lg); }

/* ✅ 重点修复：文字贴合底部的圆角 */
.color-item-text { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    text-align: center; font-size: 11px; font-weight: 700; 
    padding: 6px 2px; backdrop-filter: blur(5px);
    border-bottom-left-radius: 11px; /* 跟随外框圆角 */
    border-bottom-right-radius: 11px;
}

/* 主按钮 */
.btn-main { border: none; background: linear-gradient(135deg, var(--primary-600), var(--primary-500)); color: #fff; border-radius: 16px; font-size: 1.05rem; transition: 0.3s ease; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }

.footer-b { background: linear-gradient(135deg, var(--primary-500), var(--secondary-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

@media (max-width: 768px) {
    .title { font-size: 2.2rem; }
    .theme-toggle { top: 15px; right: 15px; width: 45px; height: 45px; }
    .custom-glass-card { padding: 30px 20px !important; }
}

/* ✅ 强制让 placeholder 占满整个网格宽度，实现绝对居中 */
.placeholder-text { 
    grid-column: 1 / -1; 
    min-height: 200px; /* 给它一个基础高度，保证上下也完美居中 */
}