:root {
    --main-color: #FF6B6B;
    --second-color: #4ECDC4;
    --bg-color: #FFEEDD;
}

body {
    margin: 0;
    padding: 10px;
    background: var(--bg-color);
    font-family: "Comic Sans MS", 楷体, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    flex: 1;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 70px;
}

h1 {
    text-align: center;
    color: var(--main-color);
    margin: 10px 0;
    font-size: 1.8rem;
    text-shadow: 2px 2px 0px #FFF;
}

.button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

button {
    width: 90%;
    max-width: 300px;
    padding: 15px;
    margin: 3px 0;
    border: none;
    border-radius: 25px;
    background: var(--second-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-height: 44px;
    -webkit-appearance: none;
    touch-action: manipulation;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#poemDisplay {
    text-align: center;
    font-size: 1.5rem;
    color: var(--main-color);
    margin: 30px 0;
    min-height: 100px;
    font-weight: bold;
    text-shadow: 2px 2px 0px #FFF;
    animation: bounce 1s infinite alternate;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff; 
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
}

.poem-line {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.char-unit {
    text-align: center;
    min-width: 2em;
    line-height: 1.2;
}

.pinyin {
    font-size: 0.7rem;
    color: var(--second-color);
    height: 1.2em;
    line-height: 1;
    letter-spacing: 0.05em;
}

.hanzi {
    font-size: 1.2rem;
    color: var(--main-color);
    line-height: 1.4;
    letter-spacing: 0.1em;
}

.punctuation .pinyin {
    visibility: hidden;
}

.annotations-section {
    margin: 25px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
    border: 2px dashed var(--second-color);
}

.annotations-title {
    color: var(--main-color);
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.annotation-item {
    margin: 8px 0;
    padding-left: 15px;
    position: relative;
    line-height: 1.5;
}

.annotation-item::before {
    content: "•";
    color: var(--second-color);
    position: absolute;
    left: 0;
}

.close-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.close-btn {
    background: var(--main-color);
    padding: 10px 35px;
    border-radius: 25px;
    font-size: 1.1rem;
    margin: 0 auto;
}

.signature {
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    color: var(--main-color);
    font-size: 0.9rem;
    padding: 15px 10px;
    background: var(--bg-color);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    h1 { font-size: 2.2rem; }
    button { font-size: 1.1rem; }
    #poemDisplay { font-size: 2rem; }
    .hanzi { font-size: 1.4rem; }
    .pinyin { font-size: 0.8rem; }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}
