:root {
    --primary-brown: #5D4037;
    --secondary-brown: #8D6E63;
    --light-brown: #D7CCC8;
    --accent-gold: #FFD700;
    --text-dark: #3E2723;
    --text-light: #EFEBE9;
    --bg-cream: #FAFAFA;
}

body {
    font-family: 'Microsoft YaHei', 'SimSun', serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-brown {
    background-color: var(--primary-brown) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-link {
    font-size: 1.1rem;
}

.nav-link:hover {
    color: var(--accent-gold) !important;
}

.btn-outline-light:hover {
    background-color: var(--secondary-brown);
}

.footer {
    margin-top: auto;
}

.footer h5 {
    color: var(--text-light);
}

.footer a:hover {
    color: var(--accent-gold) !important;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-brown), var(--secondary-brown));
    padding: 80px 0;
    color: var(--text-light);
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    padding: 15px 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px 0 0 50px;
}

.search-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 0 50px 50px 0;
    background-color: var(--accent-gold);
    color: var(--text-dark);
    font-weight: bold;
}

.search-btn:hover {
    background-color: #FFA500;
}

.feature-section {
    padding: 60px 0;
}

.feature-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-brown);
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--primary-brown);
}

.feature-desc {
    color: #666;
    line-height: 1.6;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--light-brown);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-brown);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.product-price {
    color: #E53935;
    font-size: 1.3rem;
    font-weight: bold;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 40px;
    color: var(--primary-brown);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-gold);
    margin: 15px auto 0;
}

.word-detail-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.font-evolution {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 30px;
    background-color: var(--bg-cream);
    border-radius: 10px;
    margin-bottom: 30px;
}

.font-stage {
    text-align: center;
    flex: 1;
    padding: 15px;
}

.font-stage-name {
    font-weight: bold;
    color: var(--primary-brown);
    margin-bottom: 10px;
}

.font-display {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: white;
    border: 2px solid var(--light-brown);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-family: 'KaiTi', 'STKaiti', serif;
    color: var(--text-dark);
}

.font-arrow {
    font-size: 2rem;
    color: var(--secondary-brown);
}

.word-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    padding: 15px;
    background-color: var(--bg-cream);
    border-radius: 10px;
}

.info-label {
    font-weight: bold;
    color: var(--primary-brown);
    margin-bottom: 5px;
}

.info-value {
    color: var(--text-dark);
}

.generator-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    min-height: 600px;
}

.generator-sidebar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.generator-canvas {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.canvas-toolbar {
    padding: 15px;
    border-bottom: 1px solid var(--light-brown);
    background-color: var(--bg-cream);
}

.canvas-area {
    min-height: 500px;
    padding: 20px;
    background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.tools-group {
    margin-bottom: 25px;
}

.tools-group-title {
    font-weight: bold;
    color: var(--primary-brown);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-brown);
}

.form-control:focus {
    border-color: var(--secondary-brown);
    box-shadow: 0 0 0 0.2rem rgba(93, 64, 55, 0.25);
}

.btn-primary {
    background-color: var(--primary-brown);
    border-color: var(--primary-brown);
}

.btn-primary:hover {
    background-color: var(--secondary-brown);
    border-color: var(--secondary-brown);
}

.auth-card {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.auth-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-brown);
    margin-bottom: 30px;
}

.member-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.member-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-brown), var(--secondary-brown));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-cream);
    border-radius: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-brown);
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.search-results {
    margin-top: 40px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-char {
    width: 80px;
    height: 80px;
    background-color: var(--light-brown);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-family: 'KaiTi', 'STKaiti', serif;
    margin-right: 20px;
    color: var(--primary-brown);
}

.result-info {
    flex: 1;
}

.result-pinyin {
    color: var(--secondary-brown);
    font-size: 1.1rem;
}

.result-meaning {
    color: #666;
    margin-top: 5px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-brown);
    border-top-color: var(--primary-brown);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
    .generator-container {
        grid-template-columns: 1fr;
    }
    
    .font-evolution {
        flex-wrap: wrap;
    }
    
    .font-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

.btn-brown {
    background-color: #5D4037;
    border-color: #5D4037;
    color: white;
}

.btn-brown:hover {
    background-color: #8D6E63;
    border-color: #8D6E63;
    color: white;
}

.btn-outline-brown {
    border-color: #5D4037;
    color: #5D4037;
    background: transparent;
}

.btn-outline-brown:hover {
    background-color: #5D4037;
    color: white;
    border-color: #5D4037;
}

.text-brown {
    color: #5D4037;
}

.bg-brown {
    background-color: #5D4037;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.word-card {
    cursor: pointer;
    transition: all 0.3s;
}

.word-preview {
    width: 60px;
    height: 60px;
    background-color: #D7CCC8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-preview img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.evolution-card {
    padding: 15px;
    transition: transform 0.3s;
}

.evolution-card:hover {
    transform: translateY(-5px);
}

.evolution-image {
    width: 100%;
    height: 100px;
    background-color: #FAFAFA;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evolution-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.institution-card {
    background: linear-gradient(135deg, #5D4037, #8D6E63);
}

.stat-card {
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
}

.word-main-preview {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-main-preview img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.evolution-item {
    padding: 15px;
    background: #FAFAFA;
    border-radius: 10px;
}

.evolution-detail-img {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.evolution-detail-img img,
.evolution-detail-img span {
    font-family: 'KaiTi', 'STKaiti', serif;
}

.evolution-detail-img img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.evolution-label {
    text-align: center;
}

.related-word {
    text-decoration: none;
}

.related-word:hover {
    opacity: 0.8;
}

.py-10 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.evolution-section {
    padding: 60px 0;
}

.features-section {
    padding: 60px 0;
}

.institution-section {
    padding: 60px 0;
    background-color: #FAFAFA;
}

.generator-section {
    padding: 20px 0;
}

@media (max-width: 992px) {
    .generator-main {
        flex-direction: column;
    }
    
    .left-toolbar,
    .right-panel {
        width: 100%;
    }
    
    .word-detail-section .row {
        flex-direction: column;
    }
}

.image-upload-area {
    border: 2px dashed #D7CCC8;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #FAFAFA;
}

.image-upload-area:hover {
    border-color: #5D4037;
    background-color: #F5F5F5;
}

.image-upload-area.dragover {
    border-color: #5D4037;
    background-color: #FFF8E1;
    border-style: solid;
}

.upload-placeholder {
    color: #8D6E63;
}

.upload-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.upload-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.upload-placeholder small {
    color: #9E9E9E;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.9);
    color: #5D4037;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.remove-image-btn:hover {
    background-color: #E53935;
    color: white;
}

.primary-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background-color: #5D4037;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
}
