* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: linear-gradient(180deg, #fff0f5 0%, #ffe6f0 100%); /* 淡粉色渐变背景 */
    min-height: 100vh;
    padding: 20px;
}

button {
    padding: 12px 24px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffeaff 0%, #ffc6f9 100%);
    color: #6b21a8;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        inset 0px -2px 4px rgba(0, 0, 0, 0.2),
        inset 0px 2px 4px rgba(255, 255, 255, 0.7),
        3px 3px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px); /* 悬浮时轻微上移 */
    box-shadow:
        inset 0px -2px 4px rgba(0, 0, 0, 0.2),
        inset 0px 2px 4px rgba(255, 255, 255, 0.7),
        5px 5px 8px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(1px); /* 点击时下沉 */
    box-shadow:
        inset 0px -1px 2px rgba(0, 0, 0, 0.2),
        inset 0px 1px 2px rgba(255, 255, 255, 0.7);
}

/* 顶部导航栏样式 */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -20px -20px 20px -20px;
    background: #ffffff; /* 主容器白色 */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

.nav-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
}

.nav-link {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #edf2f7;
    color: #2d3748;
}

.nav-link.active {
    background: #FF69B4; /* 活动态粉色 */
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

/* 功能区通用控制，可由 JS 切换 display */
.section {
    /* 保留默认块级显示，由 JS 决定显示/隐藏 */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #c77dff;
    margin-bottom: 30px;
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 500;
}

.input-section {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

#description-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

#description-input:focus {
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

#generate-btn {
    padding: 15px 40px;
    background: linear-gradient(180deg, #ffd6ff 0%, #ff9de2 100%);
    color: #5b1f8f;
}

.results-section,
.favorites-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #ffffff; /* 主容器白色 */
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

#results-container,
#favorites-container {
    min-height: 60px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px dashed #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
}

/* 颜文字卡片样式 */
.kaomoji-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    min-width: 200px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kaomoji-card:hover {
    border-color: #5a67d8;
    box-shadow: 0 4px 12px rgba(90, 103, 216, 0.15);
    transform: translateY(-2px);
}

.kaomoji-text {
    font-size: 32px;
    line-height: 1.2;
    text-align: center;
    word-break: break-all;
}

.kaomoji-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.kaomoji-buttons button {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

.copy-btn {
    background: linear-gradient(180deg, #ffd6ff 0%, #ff92e5 100%);
    color: #ffffff;
}

.copy-btn:hover {
    color: #ffffff;
}

.favorite-btn {
    background: linear-gradient(180deg, #fff3b0 0%, #ffd166 100%);
    color: #7a4414;
}

.favorite-btn:hover {
    color: #5c320f;
}

.remove-btn-card {
    background: linear-gradient(180deg, #ffc1c1 0%, #ff6f91 100%);
    color: #ffffff;
}

.remove-btn-card:hover {
    color: #ffffff;
}

.empty-message {
    color: #adb5bd;
    font-style: italic;
}

/* 分类页面样式 */
.main-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    padding: 10px 0;
}

.main-category-tab {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    background: linear-gradient(180deg, #f5e8ff 0%, #e3c6ff 100%);
    color: #5b21b6;
    border: 2px solid rgba(199, 125, 255, 0.4);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
}

.main-category-tab.active {
    background: #ff69b4; /* 激活时使用更深的粉色 */
    color: white;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3); /* 更强的内阴影 */
    transform: translateY(1px);
}

.sub-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
}

.sub-category-btn {
    padding: 10px 16px;
    background: linear-gradient(180deg, #e5f0ff 0%, #d0e1ff 100%);
    color: #274690;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.sub-category-btn:hover {
    color: #1a2c68;
}

.sub-category-btn.active {
    background: #ff69b4; /* 激活时使用更深的粉色 */
    color: white;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3); /* 更强的内阴影 */
    transform: translateY(1px);
}

.kaomoji-display-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 200px;
}

.kaomoji-display-area .kaomoji-card {
    margin: 0;
    width: 100%;
    min-width: auto;
}

