:root {
    --primary-color: #4a90e2;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --footer-text: #999999;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
}

.input-section {
    margin-bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

input[type="text"] {
    width: 200px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

.display-section {
    margin-bottom: 2rem;
    perspective: 1000px;
}

.character-card {
    background-color: var(--card-bg);
    width: 200px;
    height: 240px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    user-select: none;
}

.character-card:active {
    transform: scale(0.98);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

#displayChar {
    font-size: 8rem;
    line-height: 1;
    color: #333;
}

.pinyin {
    font-size: 1.5rem;
    color: #666;
    margin-top: 1rem;
    height: 2rem; /* Keep space */
}

.hint {
    position: absolute;
    bottom: 10px;
    font-size: 0.8rem;
    color: #ccc;
}

.message {
    height: 20px;
    color: #e74c3c;
    font-size: 0.9rem;
    text-align: center;
}

footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--footer-text);
    border-top: 1px solid #eee;
    width: 100%;
}

footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

footer a {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.beian-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

footer a:hover {
    color: var(--primary-color);
}
