:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(12px);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景装饰 */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #E0E7FF;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: #F3E8FF;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem 1.5rem;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #4F46E5, #9333EA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 下拉框设置 */
.settings-card .control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.select-wrapper {
    position: relative;
    width: 300px;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: var(--transition);
}

select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* 文本框区域 */
.text-areas-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .text-areas-container {
        grid-template-columns: 1fr;
    }
}

.text-area-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    height: 300px;
    padding: 1.2rem;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    resize: none;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

textarea:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#outputText {
    background-color: rgba(249, 250, 251, 0.8);
}

.copy-btn {
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.copy-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.copy-btn:active {
    transform: translateY(1px);
}

/* 拖拽上传区域 */
.drop-zone {
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-icon {
    color: var(--primary-color);
    opacity: 0.8;
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.primary-btn:active {
    transform: translateY(1px);
}

.note-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

/* 顶部导航样式 */
.top-nav {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.nav-link:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
}

/* 常用字源库样式 */
.dictionary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.dict-item {
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition);
}

.dict-item:hover {
    background-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dict-char {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.dict-char .arrow {
    font-size: 1rem;
    color: var(--text-muted);
}

.dict-desc {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
}

/* 底部 Footer 与 SEO 区域 */
.footer {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
    color: var(--text-muted);
    z-index: 1;
}

.seo-text {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.seo-text h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.seo-text p {
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.copyright {
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}
