@font-face {
    font-family: 'XiaoZhuan';
    src: url('data/xiaozhuan.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face { font-family: 'P0'; src: url('../font/p0.woff2') format('woff2'); }
@font-face { font-family: 'P1'; src: url('../font/p1.woff2') format('woff2'); }
@font-face { font-family: 'P2'; src: url('../font/p2.woff2') format('woff2'); }
@font-face { font-family: 'P16'; src: url('../font/p16.woff2') format('woff2'); }


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 10px;
    background: #f5f5f5;
    line-height: 1.4;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    font-size: 1.2em;
}

.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
    display: flex;
    justify-content: center;
    width: 100%;
}

h2 {
    text-align: center;
    margin: 5px 0;
    font-size: 0.5em;
    color: #333;
}

h4 {
    text-align: center;
    margin: 5px 0;
    font-size: 0.5em;
    color: #333;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.toolbar button {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: 60px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#char-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#search-btn {
    padding: 10px 15px;
    flex-shrink: 0;
    width: auto;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#char-display {
    font-family: 'XiaoZhuan', sans-serif;
    font-size: var(--char-font-size, 72px);
    text-align: center;
    margin: 0 5px 0 0;
    line-height: 1;
    display: inline-block;
}

#char-display-system {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--char-font-size, 72px);
    text-align: center;
    margin: 0 0 0 5px;
    line-height: 1;
    display: inline-block;
}

.char-display-container {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-family: 'P0', 'P1', 'P2', 'P16', sans-serif;
    font-size: var(--result-font-size, 32px);
}

.hanzi-link {
    font-size: 0.95em;
    margin: 2px;
    padding: 3px 6px;
    cursor: pointer;
    color: #007bff;
    border-radius: 4px;
    display: inline-block;
    transition: background 0.2s;
}

.hanzi-link:hover {
    background: #e7f1ff;
}

.footer p, .footer div {
    display: block;
    margin-bottom: 8px;
}

details {
    margin: 4px 0;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px;
}

summary {
    padding: 6px;
    font-weight: 500;
    cursor: pointer;
}

.variant-notice {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 4px solid #2196f3;
}

.pinyin-expand {
    margin-top: 6px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
}

.text-content {
    margin-top: 8px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    h2 { font-size: 1.1em; }
    .toolbar button { padding: 6px 8px; font-size: 0.85em; min-width: 55px; }
    #char-input { padding: 8px; font-size: 14px; }
    #search-btn { padding: 8px 12px; }
    .result-card { padding: 12px; }
    #char-display { font-size: 2.8em; }
}
