/* 全局重置 + 基础变量 */
:root {
    --primary: #6366f1; /* 紫蓝主色（高端低饱和） */
    --secondary: #8b5cf6; /* 辅助紫 */
    --accent: #f59e0b; /* 点缀金 */
    --dark: #1e293b; /* 深灰 */
    --light: #f8fafc; /* 浅灰 */
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--light);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 20%);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* 头部样式 */
.header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-tag {
    font-size: 1rem;
    font-weight: 400;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 100px;
}

.subtitle {
    margin-top: 0.8rem;
    font-size: 1rem;
    color: var(--gray-700);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

/* 卡片通用样式（核心高端质感） */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: 2rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

/* 板块标题 */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

/* 左侧Meme生成区 */
.main-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 模板选择区 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.template-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.template-item:hover {
    transform: scale(1.03);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.template-img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: var(--transition);
}

.template-item:hover .template-img {
    filter: brightness(1.05);
}

/* 文字编辑区 */
.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.text-input {
    flex: 1;
    min-width: 200px;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

/* 按钮通用样式 */
.btn {
    padding: 0.9rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.secondary-btn {
    background: var(--light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.secondary-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}

/* Meme预览区 */
.meme-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.preview-frame {
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
    border: 8px solid white;
}

.preview-img {
    width: 100%;
    display: block;
    max-width: 500px;
}

.meme-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 2px 0 #000, 2px 0 0 #000, 0 -2px 0 #000, -2px 0 0 #000;
    user-select: none;
}

.top {
    top: 15px;
}

.bottom {
    bottom: 15px;
}

/* 右侧Meme币区 */
.main-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 像素猫咪币卡片 */
.coin-card {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

.coin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.coin-symbol {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.coin-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 100px;
    font-weight: 500;
}

.coin-desc {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.coin-data {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.data-label {
    font-size: 0.8rem;
    color: var(--gray-700);
    font-weight: 400;
}

.data-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
}

/* CZ币列表 */
.cz-coin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cz-coin-item {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    border-left: 3px solid var(--accent);
    transition: var(--transition);
}

.cz-coin-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.coin-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.coin-brief {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
}

/* 玩梗指南 */
.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tips-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.tips-icon {
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 0.2rem;
}

.tips-content {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    margin-top: 5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer p {
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 400;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .text-input {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .template-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}