@font-face {
  font-family: YaoYinQinSong;
  src: url("YaoYinQinSong.ttf");
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* avoids invisible text in Safari */
  font-feature-settings: "kern", "liga";
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    padding: 10px;
    background: #f5f5f5;
}

#app {
    max-width: 100%;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h1 {
    margin-bottom: 10px;
    color: #333;
    font-size: 20px;
}

.input-area label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    color: #555;
}

#textInput {
    width: calc(100% - 70px);
    padding: 6px 10px;
    font-size: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    vertical-align: middle;
    font-family: YaoYinQinSong;
}

#textInput:focus {
    outline: none;
    border-color: #4CAF50;
}

.clear-btn {
    margin-left: 5px;
    padding: 6px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    vertical-align: middle;
}

.clear-btn:hover {
    background: #d32f2f;
}

.grid-container {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
}

.glyph-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: #fafafa;
}

.glyph-card:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.unicode-code {
    font-size: 9px;
    color: #666;
    font-family: YaoYinQinSong, monospace;
    font-weight: 600;
}

.glyph-char {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: YaoYinQinSong;
}

.glyph-name {
    font-size: 9px;
    color: #333;
    margin-top: 3px;
    word-break: break-word;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.error {
    color: #f44336;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}