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

/* 头部样式 */
.tool-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.tool-header h1 {
    color: var(--accent-color);
    font-family: "Comic Sans MS", "Chalkboard SE", sans-serif;
    font-size: 3em;
    text-shadow: 3px 3px 0px #fff;
    margin-bottom: 10px;
}

.tool-description {
    font-size: 1.2em;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* 搜索区域 */
.search-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 0 rgba(0,0,0,0.05);
    margin-bottom: 40px;
    text-align: center;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.search-section:hover {
    border-color: #ffeaa7;
    transform: translateY(-2px);
}

.input-wrapper {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

#charInput {
    width: 120px;
    height: 60px;
    font-size: 2.5em;
    text-align: center;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    outline: none;
    transition: all 0.3s;
    font-family: "KaiTi", "楷体", serif;
}

#charInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.2);
}

/* 按钮样式优化 */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 0 30px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 5px 0 var(--primary-dark);
}

.primary-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--primary-dark);
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1em;
    box-shadow: 0 4px 0 var(--secondary-dark);
}

.secondary-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--secondary-dark);
}

/* 快速链接 */
.quick-links {
    font-size: 1em;
    color: var(--text-secondary);
}

.quick-char {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 12px;
    margin: 0 5px;
    font-size: 1.1em;
    color: var(--text-primary);
    box-shadow: 0 3px 0 var(--border-color);
}

.quick-char:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-char:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 var(--border-color);
}

/* 结果区域 */
.result-area {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 0 rgba(0,0,0,0.05);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.char-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    background: #fdf6ec;
    padding: 15px;
    border-radius: 15px;
    display: inline-flex; /* 居中包裹 */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.pinyin-display {
    font-size: 3em;
    font-family: "Courier New", Courier, monospace;
    color: var(--accent-color);
    font-weight: bold;
    letter-spacing: 2px;
}

.audio-btn {
    background: white;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}

.audio-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

.char-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

@media (min-width: 768px) {
    .char-body {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 60px;
    }
}

/* 田字格/米字格样式 */
.writer-container {
    width: 240px; /* 稍微加大 */
    height: 240px;
    border: 4px solid #e74c3c; /* 红色边框 */
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    
    /* 米字格背景 */
    background-image: 
        linear-gradient(45deg, transparent 49.5%, #ffcccc 49.5%, #ffcccc 50.5%, transparent 50.5%), /* 斜线 */
        linear-gradient(-45deg, transparent 49.5%, #ffcccc 49.5%, #ffcccc 50.5%, transparent 50.5%), /* 斜线 */
        linear-gradient(to right, transparent 49.5%, #ffcccc 49.5%, #ffcccc 50.5%, transparent 50.5%), /* 竖线 */
        linear-gradient(to bottom, transparent 49.5%, #ffcccc 49.5%, #ffcccc 50.5%, transparent 50.5%); /* 横线 */
    background-size: 100% 100%;
}

.char-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 350px;
}

.info-item {
    background: #f1f2f6;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.info-item:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
}

.info-item.full-width {
    grid-column: span 2;
    text-align: left;
    padding-left: 20px;
}

.info-item .label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text-primary);
    font-family: "KaiTi", "楷体", serif;
}

.controls-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px dashed var(--border-color);
}

.external-links {
    margin-top: 25px;
    text-align: center;
}

.ext-link {
    display: inline-block;
    padding: 5px 15px;
    margin: 0 5px;
    background: #e1f5fe;
    color: #0288d1;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.2s;
}

.ext-link:hover {
    background: #0288d1;
    color: white;
    transform: scale(1.05);
}

/* 历史记录 */
.history-section {
    margin-top: 50px;
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-radius: 20px;
}

.history-section h3 {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-section h3::before {
    content: '🕒';
    font-size: 1.4em;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.history-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.3em;
    font-family: "KaiTi", "楷体", serif;
    color: var(--text-primary);
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.history-item:hover {
    transform: scale(1.15) rotate(5deg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 使用说明 */
.tips-section {
    background: #e8f5e9;
    border: 2px dashed #a5d6a7;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 40px;
    text-align: left;
}

.tips-section h3 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.tips-section ul {
    list-style: none;
    padding-left: 10px;
}

.tips-section li {
    margin-bottom: 10px;
    color: #388e3c;
    font-size: 1em;
    position: relative;
    padding-left: 20px;
}

.tips-section li::before {
    content: '•';
    color: #66bb6a;
    font-weight: bold;
    position: absolute;
    left: 0;
}
