/* Apple-style Modern Chinese Name Generator UI */

body {
    background: #f7f7fa; /* 更柔和的灰白背景，提升高级感 */
    font-family: 'SF Pro Display', 'Arial', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 1080px; /* 主内容区更宽，适合大屏 */
    width: 90vw; /* 保证在大屏和小屏都居中显示 */
    margin: 48px auto 0 auto; /* 上方留白更大，页面更居中 */
    background: #fff;
    border-radius: 28px; /* 圆角更大更柔和 */
    box-shadow: 0 8px 32px rgba(208,2,27,0.10), 0 1.5px 6px rgba(0,0,0,0.04);
    padding: 44px 40px 32px 40px; /* 内边距更大，内容不拥挤 */
    box-sizing: border-box;
    min-height: 60vh; /* 内容区高度适中，避免悬浮感 */
}

/* 响应式：移动端适配 */
@media (max-width: 700px) {
    .container {
        max-width: 98vw;
        padding: 8vw 2vw 8vw 2vw;
        margin: 8px auto 0 auto;
        border-radius: 10px;
        min-height: 80vh;
    }
    header h1 {
        font-size: 2rem;
    }
    .input-section {
        flex-direction: column;
        gap: 10px;
    }
    .name-input {
        font-size: 1rem;
        padding: 12px 10px;
    }
    .generate-btn {
        font-size: 1rem;
        height: 42px;
        padding: 0 10px;
    }
    .results-section {
        gap: 12px;
    }
    .name-card {
        max-width: 98vw;
        padding: 18px 6vw 14px 6vw;
        border-radius: 10px;
    }
    .chinese-name {
        font-size: 1.3rem;
    }
    .pinyin {
        font-size: 1rem;
    }
    .save-btn {
        font-size: 0.98rem;
        padding: 7px 10px;
        border-radius: 7px;
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    font-size: 2.8rem; /* 更大更醒目的主标题 */
    color: #D0021B;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: 1.5px;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif;
}
header h1 span {
    font-size: 1.6rem;
    display: block;
    color: #b71c1c;
    margin-top: 5px;
}

header .subtitle {
    font-size: 1.18rem;
    color: #b71c1c;
    margin-bottom: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}
header .subtitle span {
    font-size: 1rem;
    display: block;
    margin-top: 3px;
}

.input-section {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
    justify-content: center;
}

.name-input {
    flex: 1;
    padding: 14px 18px;
    border: 1.8px solid #D0021B;
    border-radius: 14px;
    font-size: 1.15rem;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #222;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif;
}
.name-input:focus {
    border-color: #b71c1c;
    box-shadow: 0 0 0 2px #fbeaec;
}

.generate-btn {
    background: linear-gradient(90deg, #D0021B 60%, #b71c1c 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 0 28px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(208,2,27,0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    height: 48px;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif;
}
.generate-btn:hover {
    background: linear-gradient(90deg, #b71c1c 60%, #D0021B 100%);
    box-shadow: 0 4px 16px rgba(208,2,27,0.15);
    transform: translateY(-2px) scale(1.03);
}
.generate-btn:active {
    transform: scale(0.98);
}
.generate-btn span {
    font-size: 0.9rem;
    display: block;
    margin-top: 2px;
}

.usage-count {
    text-align: right;
    font-size: 1.05rem;
    color: #D0021B;
    margin-bottom: 10px;
    font-weight: 500;
}

.limit-msg {
    text-align: center;
    color: #D0021B;
    background: #fff0f0;
    border: 1.5px solid #D0021B;
    border-radius: 10px;
    padding: 12px 0;
    margin: 12px 0 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.results-section {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* 卡片间距更大 */
    align-items: center;
}

.name-card {
    background: #fff;
    border-radius: 20px; /* 更圆润 */
    box-shadow: 0 4px 18px rgba(208,2,27,0.13), 0 1.5px 6px rgba(0,0,0,0.04);
    padding: 28px 26px 22px 26px;
    margin-bottom: 0;
    border-left: 6px solid #D0021B;
    transition: box-shadow 0.2s, transform 0.2s;
    width: 100%;
    max-width: 420px;
    position: relative;
}
.name-card:hover {
    box-shadow: 0 8px 32px rgba(208,2,27,0.18);
    transform: translateY(-3px) scale(1.025);
}
.chinese-name {
    font-size: 2.2rem;
    color: #D0021B;
    font-weight: 800;
    margin: 0 0 8px 0;
    letter-spacing: 2.5px;
    text-align: center;
}
.pinyin {
    font-size: 1.18rem;
    color: #b71c1c;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
}
.meaning-section, .cultural-section, .traits-section {
    margin-bottom: 10px;
    padding: 8px 0 0 0;
}
.meaning-section h3, .cultural-section h3, .traits-section h3 {
    font-size: 1.08rem;
    color: #D0021B;
    margin: 0 0 2px 0;
    font-weight: 700;
}
.meaning-section p, .cultural-section p, .traits-section p {
    font-size: 1.01rem;
    color: #333;
    margin: 0 0 2px 0;
    font-family: 'Arial', 'PingFang SC', sans-serif;
}
/* 重要信息标签样式 */
.meaning-section p span, .traits-section p span {
    display: inline-block;
    background: #fbeaec;
    color: #D0021B;
    border-radius: 6px;
    padding: 2px 8px;
    margin-right: 4px;
    font-size: 0.98em;
}
.save-btn {
    margin-top: 12px;
    background: #fff;
    color: #D0021B;
    border: 1.8px solid #D0021B;
    border-radius: 10px;
    padding: 8px 22px;
    font-size: 1.08rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(208,2,27,0.07);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.save-btn:hover {
    background: #D0021B;
    color: #fff;
    box-shadow: 0 4px 16px rgba(208,2,27,0.13);
}

.loading {
    text-align: center;
    color: #D0021B;
    font-size: 1.1rem;
    margin: 24px 0;
}
.error-message {
    color: #fff;
    background: #D0021B;
    border-radius: 8px;
    padding: 14px 0;
    text-align: center;
    font-size: 1.08rem;
    margin: 18px 0;
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 32px;
    color: #b71c1c;
    font-size: 0.98rem;
    letter-spacing: 0.5px;
    border-top: 1.5px solid #fbeaec;
    padding-top: 18px;
}

.language-selector {
    position: absolute;
    top: 18px;
    right: 32px;
    z-index: 10;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(208,2,27,0.08);
    padding: 4px 12px;
    display: flex;
    align-items: center;
}
.language-selector select {
    border: none;
    background: transparent;
    font-size: 1.05rem;
    color: #D0021B;
    font-weight: 700;
    outline: none;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: background 0.2s, color 0.2s;
}
.language-selector select:focus {
    background: #fbeaec;
    color: #b71c1c;
}
/* 移动端适配 */
@media (max-width: 700px) {
    .language-selector {
        top: 8px;
        right: 8px;
        padding: 2px 6px;
        border-radius: 10px;
    }
    .language-selector select {
        font-size: 0.98rem;
        padding: 2px 4px;
        border-radius: 6px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 18px 4vw 12px 4vw;
        max-width: 98vw;
    }
    .input-section {
        flex-direction: column;
        gap: 10px;
    }
    .name-input, .generate-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

.knot-decoration {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 0 auto 18px auto;
    width: 100%;
    min-height: 90px;
    max-width: 900px;
}
.fu-char {
    font-family: 'STKaiti', 'KaiTi', 'FZKai-Z03', 'PingFang SC', 'Microsoft YaHei', serif;
    font-size: 3.2rem;
    color: #D0021B;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(208,2,27,0.10);
    letter-spacing: 2px;
    user-select: none;
    margin: 0 8px;
    line-height: 1;
}
.knot-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 90px;
    margin: 0 2px;
    filter: drop-shadow(0 4px 12px rgba(208,2,27,0.13));
    transition: transform 0.2s;
}
.knot-svg:hover {
    transform: scale(1.08) rotate(-6deg);
}
.left-knot {
    margin-right: 4px;
}
.right-knot {
    margin-left: 4px;
}
@media (max-width: 900px) {
    .knot-decoration {
        gap: 10px;
        min-height: 54px;
        max-width: 98vw;
    }
    .knot-svg {
        width: 32px;
        height: 54px;
    }
}

.ai-mode-btn {
    margin-left: 12px;
}
@media (max-width: 700px) {
    .ai-mode-btn {
        margin-left: 0;
        margin-top: 8px;
    }
}
