/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

section {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    text-align: center;
}

/* 每日正念语录部分 */
.daily-quote {
    grid-column: 1 / -1;
}

.quote-container {
    background: linear-gradient(135deg, #e0f7fa 0%, #f3e5f5 100%);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 15px;
}

.chinese-quote {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.english-quote {
    font-size: 1.1rem;
    font-style: italic;
    color: #666;
}

/* 控制面板 */
.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

input[type="text"], 
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    color: #333;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
select:focus {
    border-color: #7c5cff;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
    outline: none;
    background-color: #fff;
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    margin-right: 15px;
    cursor: pointer;
    font-weight: normal;
    background-color: #f5f5f5;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.radio-group label:hover {
    background-color: #e9ecef;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #7c5cff;
}

.radio-group input[type="radio"]:checked + label {
    background-color: #e6e0ff;
    color: #5e35b1;
}

/* 颜色选择器 */
input[type="color"] {
    width: 100%;
    height: 45px;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
}

/* 渐变背景选项 */
.gradient-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.gradient-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.gradient-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.gradient-option.selected {
    border-color: #7c5cff;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.1);
}

.gradient-option:nth-child(1) { background: linear-gradient(to bottom, #a8edea, #fed6e3); }
.gradient-option:nth-child(2) { background: linear-gradient(to bottom, #d299c2, #fef9d7); }
.gradient-option:nth-child(3) { background: linear-gradient(to bottom, #fdcbf1, #e6dee9); }
.gradient-option:nth-child(4) { background: linear-gradient(to bottom, #fff1eb, #ace0f9); }
.gradient-option:nth-child(5) { background: linear-gradient(to bottom, #c1dfc4, #deecdd); }
.gradient-option:nth-child(6) { background: linear-gradient(to bottom, #e0c3fc, #8ec5fc); }
.gradient-option:nth-child(7) { background: linear-gradient(to bottom, #f5f7fa, #c3cfe2); }
.gradient-option:nth-child(8) { background: linear-gradient(to bottom, #ff9a9e, #fad0c4); }
.gradient-option:nth-child(9) { background: linear-gradient(to bottom, #a18cd1, #fbc2eb); }
.gradient-option:nth-child(10) { background: linear-gradient(to bottom, #ffecd2, #fcb69f); }
.gradient-option:nth-child(11) { background: linear-gradient(to bottom, #84fab0, #8fd3f4); }
.gradient-option:nth-child(12) { background: linear-gradient(to bottom, #cfd9df, #e2ebf0); }

.gradient-option:nth-child(13) { background: radial-gradient(circle at 50% 50%, #fbc2eb 0%, #a6c1ee 100%); }
.gradient-option:nth-child(14) { background: radial-gradient(circle at 50% 50%, #a1c4fd 0%, #c2e9fb 100%); }
.gradient-option:nth-child(15) { background: radial-gradient(circle at 50% 50%, #d4fc79 0%, #96e6a1 100%); }
.gradient-option:nth-child(16) { background: radial-gradient(circle at 50% 50%, #fa709a 0%, #fee140 100%); }
.gradient-option:nth-child(17) { background: radial-gradient(circle at 50% 50%, #30cfd0 0%, #330867 100%); }
.gradient-option:nth-child(18) { background: radial-gradient(circle at 50% 50%, #5ee7df 0%, #b490ca 100%); }

/* 预览部分 */
.preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.preview h2 {
    margin-bottom: 20px;
}

#preview-container {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-color: #f5f5f5; /* 添加背景色以便于查看容器边界 */
    position: relative; /* 添加相对定位 */
}

#wallpaperCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border: 1px solid #ddd; /* 添加边框以便于查看canvas边界 */
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.primary-btn {
    background-color: #7c5cff;
    color: white;
}

.primary-btn:hover {
    background-color: #6a4ae8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 92, 255, 0.3);
}

.secondary-btn {
    background-color: #e9ecef;
    color: #495057;
}

.secondary-btn:hover {
    background-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.secondary-btn:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 使用教程部分 */
.tutorial {
    grid-column: 1 / -1;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 30px 0;
    background-color: #f1f1f1;
    color: #666;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-group label {
        margin-right: 0;
    }
    
    .button-group {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.5s ease-out;
}
