:root {
    --primary-color: #e63946;
    --secondary-color: #000000;
    --background-color: #f8f9fa;
    --card-color: #ffffff;
    --text-color: #61626a;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 2rem;
}

header {
    background-color: var(--card-color);
    box-shadow: var(--box-shadow);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo i {
    font-size: 1.5rem;
    color: white;
}

h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-color), #4a4e69);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.card {
    background-color: var(--card-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.input-group {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.input-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 修改输入框和按钮的样式，使它们高度一致 */
#character-input {
    flex: 1;
    padding: 0 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    transition: var(--transition);
    height: 3rem;
    line-height: 3rem;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    height: 3rem;
    display: flex;
    align-items: center;
}

/* 减小间距 */
.input-group {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.input-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mode-selection {
    display: flex;
    gap: 0.5rem;
}

/* 小屏幕设备的调整 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 0.5rem;
        gap: 1rem;
    }
    
    header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .input-group {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    #character-input {
        height: 44px; /* 增加触控区域 */
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
    
    .primary-btn, .mode-btn {
        height: 44px;
        padding: 0 1rem;
    }
    
    .mode-selection {
        flex-wrap: wrap;
    }
    
    .mode-btn {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 80px;
    }
    
    .character-container {
        height: 280px;
        margin: 1rem 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .character-container {
        height: 250px;
    }
    
    #character-target {
        width: 200px !important;
        height: 200px !important;
    }
    
    .status-message {
        bottom: 1rem;
        padding: 0.8rem;
        font-size: 14px;
        width: 90%;
        max-width: none;
    }
    
    .info-card {
        margin-top: 1rem;
    }
}

#character-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.primary-btn, .secondary-btn, .mode-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: var(--transition);
    outline: none; /* 添加这行，移除选中时的边框 */
}

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

.mode-btn {
    flex: 1;
    justify-content: center;
    background-color: #e9ecef;
    color: var(--text-color);
    outline: none; /* 添加这行，确保模式按钮也没有边框 */
}

.mode-btn.active {
    background: var(--secondary-color);
    color: white;
    border: none; /* 确保激活状态也没有边框 */
}

.lang-btn {
    background: none;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    outline: none; /* 添加这行，确保语言按钮也没有边框 */
}

.lang-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: transparent;
}

.primary-btn:hover {
    background: #d63340;  /* 鼠标悬停时的颜色稍深 */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(230, 57, 70, 0.2);
}

/* 修改语言切换按钮的激活状态 */
.lang-btn.active {
    background: var(--secondary-color);  /* 移除渐变，使用单一背景色 */
    color: white;
    border-color: transparent;
}

/* 修改模式按钮的激活状态 */
.mode-btn.active {
    background: var(--secondary-color);  /* 移除渐变，使用单一背景色 */
    color: white;
}

.mode-selection {
    display: flex;
    gap: 1rem;
}

.mode-btn {
    flex: 1;
    justify-content: center;
    background-color: #e9ecef;
    color: var(--text-color);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), #5c8fb6);
    color: white;
}

.character-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 320px;
    border: 2px dashed #e9ecef;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.info-card h2 {
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--secondary-color);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.8rem;
}

.language-switch {
    display: flex;
    gap: 0.8rem;
}

.lang-btn {
    background-color: #e9ecef;
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    outline: none;
}

.lang-btn.active {
    background: var(--secondary-color);
    color: white;
}

.lang-btn:hover {
    background-color: #dee2e6;
}

.lang-btn.active:hover {
    background: #333333;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), #5c8fb6);
    color: white;
    border-color: transparent;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    color: #6c757d;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* 合并和优化移动端媒体查询 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .card {
        margin: 0;
        padding: 1rem;
    }
    
    .input-group {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    #character-input {
        height: 44px;
        line-height: 44px;
        font-size: 16px;
        padding: 0 1rem;
    }
    
    .primary-btn, .mode-btn, .lang-btn {
        height: 44px;
        padding: 0 1rem;
        font-size: 14px;
    }
    
    .mode-selection {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .mode-btn {
        flex: 1 1 calc(33.33% - 0.4rem);
        min-width: 80px;
    }
    
    .character-container {
        height: 300px;
        margin: 1rem 0;
    }
    
    .status-message {
        bottom: 1.5rem;
        max-width: 90%;
        text-align: center;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .character-container {
        height: 260px;
    }
    
    #character-target {
        width: 220px !important;
        height: 220px !important;
    }
    
    .mode-btn {
        flex: 1 1 calc(50% - 0.4rem);
    }
    
    .info-card {
        padding: 0.8rem;
    }
    
    .info-card h2 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .stroke-tips {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    footer {
        margin-top: 2rem;
        padding: 1rem;
    }
}

.info-card {
    margin-top: 0.5rem;
}

.info-card h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.info-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
}

.stroke-tips {
    margin-top: 1rem;
    padding: 0.6rem;
}
}

.status-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-message.show {
    opacity: 1;
}

.status-message.success {
    background-color: #10b981;  /* 绿色 */
}

.status-message.error {
    background-color: #ef4444;  /* 红色 */
}

.status-message.info {
    background-color: #3b82f6;  /* 蓝色，用于普通提示 */
}

/* 在小屏幕上调整位置 */
@media (max-width: 768px) {
    .status-message {
        bottom: 1.5rem;
        max-width: 90%;
        text-align: center;
    }
}
