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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8ddd0 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: #3a3a3a;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background: #fffdf8;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0d5c5;
}

/* ========== Banner ========== */
.banner {
    position: relative;
    background: linear-gradient(135deg, #2c1810 0%, #4a3228 40%, #6b4a3a 100%);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    overflow: hidden;
}

.banner-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.08;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 21px),
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 21px);
}

.banner-content {
    position: relative;
    z-index: 1;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.brand-icon {
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #f0d0a0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: monospace;
    border: 1px solid rgba(240, 208, 160, 0.3);
    letter-spacing: 0;
}

.brand-name {
    font-size: 2.5rem;
    color: #fffdf8;
    font-weight: normal;
    letter-spacing: 0.3rem;
}

.brand-tagline {
    color: #d4a574;
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    letter-spacing: 0.1rem;
}

.brand-desc {
    color: rgba(255, 253, 248, 0.6);
    font-size: 0.8rem;
    margin: 0;
    font-style: italic;
}

.nav-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.5rem 0;
    align-items: center;
}

.nav-link {
    color: #5a4a3a;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid #d0c5b5;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: #5a4a3a;
    color: #fff;
}

.subtitle {
    text-align: center;
    color: #8b7355;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: #5a4a3a;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid #d0c5b5;
    border-radius: 8px;
    font-size: 1rem;
    background: #fefcf8;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #8b7355;
    box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.15);
}

#generate-btn {
    padding: 0.85rem 1.5rem;
    background: #5a4a3a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 0.5rem;
}

#generate-btn:hover:not(:disabled) {
    background: #3a2a1a;
}

#generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.log-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f4ee;
    border-radius: 8px;
    border: 1px solid #e0d5c5;
}

.log-section h2 {
    font-size: 1.1rem;
    color: #5a4a3a;
    margin-bottom: 0.75rem;
    font-weight: normal;
}

#log-content {
    max-height: 300px;
    overflow-y: auto;
}

#log-content p {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.log-info {
    color: #6b5b4b;
}

.log-success {
    color: #2e7d32;
    font-weight: 500;
}

.log-warning {
    color: #e65100;
    font-weight: 500;
}

.log-error {
    color: #c62828;
}

.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fffdf5;
    border-radius: 8px;
    border: 2px solid #d4a574;
}

.result-section h2 {
    font-size: 1.1rem;
    color: #5a4a3a;
    margin-bottom: 1rem;
    font-weight: normal;
}

.poem-title {
    text-align: center;
    font-size: 1.3rem;
    color: #2c1810;
    margin-bottom: 1rem;
    font-weight: 500;
}

.poem-couplet {
    text-align: center;
    font-size: 1.15rem;
    line-height: 2;
    color: #2c1810;
    font-family: "STKaiti", "KaiTi", "楷体", serif;
}

.poem-couplet + .poem-couplet {
    margin-top: 0.5rem;
}

.error-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff0f0;
    border-radius: 8px;
    border: 1px solid #ffcccc;
}

#error-message {
    color: #c62828;
    text-align: center;
    font-size: 0.95rem;
}
