@import url("/static/css/base.css");

:root {
    --primary-color: #10a674;
    --primary-hover: #038058;
    --secondary-color: #f9fafb;
    --accent-color: #f59e0b;
    --text-color: #1f2937;
    --heading-color: #111827;
    --border-color: #d1d5db;
    --card-bg: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --font-primary: 'Inter', 'LXGW WenKai GB', sans-serif;
    --font-body: 'Inter', 'LXGW WenKai GB', sans-serif;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px
}

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

html {
    overflow: auto
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--secondary-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px
}

.search-form {
    display: flex;
    position: relative
}

.search-input {
    flex: 1;
    padding: .7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
    font-size: .95rem;
    background-color: #f3f4f6;
    color: var(--text-color);
    transition: all .2s ease
}

.search-input:focus {
    outline: 0;
    border-color: var(--primary-color);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .3)
}

.search-btn {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
    padding: .7rem 1.2rem;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    cursor: pointer;
    transition: background-color .2s ease, transform .1s ease
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05)
}

.search-btn:active {
    transform: scale(.98)
}

.main-content {
    flex: 1;
    padding: 1.5rem 1.5rem
}

.hero-section {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px -10px var(--shadow-medium);
    margin-bottom: 1.5rem
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    text-shadow: none
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: var(--text-color);
    opacity: .9;
    line-height: 1.8
}

.search-container {
    margin-bottom: 3rem
}

.main-search-form {
    max-width: 600px;
    margin: 0 auto;
    width: 100%
}

.search-input-group {
    display: flex;
    background: var(--card-bg);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-medium);
    border: 1px solid var(--border-color);
    width: 100%;
    min-height: 50px
}

.main-search-input {
    flex: 1;
    padding: 15px 30px;
    border: none;
    font-size: 18px;
    outline: 0;
    color: var(--text-color);
    background: 0 0;
    min-width: 0
}

.main-search-input::placeholder {
    color: var(--text-color);
    opacity: .6
}

.main-search-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 40px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0
}

.main-search-btn:hover {
    background: var(--primary-hover)
}

.quick-examples {
    margin-top: 2.5rem
}

.examples-label {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    opacity: .9
}

.example-chars {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap
}

.example-char {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 400;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
    border: 1px solid var(--border-color)
}

.example-char:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-light);
    color: var(--primary-hover);
    border-color: var(--primary-color)
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: var(--heading-color)
}

.main-character {
    font-size: 8rem;
    font-weight: 700;
    color: var(--heading-color);
    text-shadow: none
}

.character-title {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 20px
}

.pinyin-section,
.strokes-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--primary-color)
}

.pinyin-section i,
.strokes-section i {
    color: var(--primary-color);
    width: 20px
}

.pinyin-label,
.strokes-label {
    font-weight: 700;
    color: var(--text-color)
}

.pinyin-text {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700
}

.example-chinese {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px
}

.example-pinyin {
    color: #667eea;
    font-weight: 700;
    margin-bottom: 5px
}

.examples-section {
    margin-top: 40px;
    margin-bottom: 40px
}

.examples-section .example-chinese {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px
}

.examples-section .example-pinyin {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 8px
}

.char-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px
}

.word-char-pinyin {
    color: #667eea;
    font-weight: 700;
    font-size: 1rem
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.7;
    max-width: 320px;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tooltip.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip.tooltip-bottom::after {
    top: -5px;
    bottom: auto;
    border-color: transparent transparent #333 transparent;
}

.tooltip div {
    margin-bottom: 5px;
}

.tooltip div:last-child {
    margin-bottom: 0;
}

.tooltip strong {
    color: color-mix(in srgb, color-mix(in srgb, var(--accent-color) 70%, var(--primary-color-alt) 50%), white 40%);
    margin-right: 3px;
    font-weight: 600 !important;
}

.tooltip i {
    font-size: 12px;
}

@media (max-width:480px) {
    .char-label {
        font-size: 1.2rem
    }
}

@media (max-width:1024px) {
    .container {
        padding: 0 15px
    }

    .main-content {
        padding: 2rem 1rem
    }
}

@media (max-width:768px) {
    .main-content {
        padding: 1.5rem 1rem
    }

    .hero-section {
        padding: 3rem 1.5rem;
        margin-bottom: 2rem
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        line-height: 1.6
    }

    .main-search-form {
        max-width: 100%
    }

    .search-input-group {
        border-radius: 25px;
        box-shadow: 0 5px 20px var(--shadow-medium)
    }

    .main-search-input {
        padding: 15px 20px;
        font-size: 16px
    }

    .main-search-btn {
        padding: 0 25px;
        font-size: 16px
    }

    .quick-examples {
        margin-top: 2rem
    }

    .examples-label {
        font-size: 1rem;
        margin-bottom: 1rem
    }

    .example-chars {
        gap: 12px
    }

    .example-char {
        width: 55px;
        height: 55px;
        font-size: 1.8rem
    }

    .main-character {
        font-size: 6rem
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 3rem
    }
}

@media (max-width:480px) {
    .main-content {
        padding: 1rem .75rem
    }

    .hero-section {
        padding: 2rem 1rem;
        border-radius: var(--border-radius-md)
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: .8rem;
        line-height: 1.2
    }

    .hero-title .fas {
        font-size: 1.8rem;
        margin-right: .5rem
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
        padding: 0 .5rem
    }

    .search-container {
        margin-bottom: 2rem
    }

    .search-input-group {
        border-radius: 20px;
        box-shadow: 0 3px 15px var(--shadow-medium);
        margin: 0 .5rem
    }

    .main-search-input {
        padding: 12px 18px;
        font-size: 16px
    }

    .main-search-btn {
        padding: 0 20px;
        font-size: 14px;
        gap: 8px
    }

    .quick-examples {
        margin-top: 1.5rem;
        padding: 0 .5rem
    }

    .examples-label {
        font-size: .95rem;
        margin-bottom: .8rem
    }

    .example-chars {
        gap: 8px;
        justify-content: center
    }

    .example-char {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
        border-radius: 8px
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
        line-height: 1.3
    }

    .main-character {
        font-size: 4rem
    }

    .character-title {
        font-size: 2rem
    }

    .examples-section .example-chinese {
        font-size: 1.2rem
    }
}