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

/* =========================================
   全局滚动条样式重塑 (暗黑极简风格)
   ========================================= */

/* 针对 Firefox 浏览器 */
* {
    scrollbar-width: thin; 
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent; 
}

/* 针对 Webkit 内核浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;  
    height: 8px; 
}

::-webkit-scrollbar-track {
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15); 
    border-radius: 10px; 
    border: 2px solid transparent; 
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(212, 175, 55, 0.4); 
}


body {
    background-color: #000000;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.6;
    padding: 2rem;
    gap: 1.5rem;
}

.app-window {
    width: 100%;
    max-width: 1200px;
    background-color: #0f1110;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.window-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #151816;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* 新增多语言按钮样式 */
.lang-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
    outline: none;
}

.lang-btn:hover {
    color: #D4AF37;
}

.workspace {
    display: flex;
    position: relative;
    min-height: 520px;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.left-panel {
    padding: 2.5rem 4.5rem 2.5rem 2.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.right-panel {
    padding: 2.5rem 2.5rem 2.5rem 4.5rem;
}

.panel-header {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; 
    color: #666;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header .dot {
    font-size: 0.6rem;
}

.panel-header.gold {
    color: #D4AF37;
}

.icon-btn {
    background-color: transparent; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none; 
    appearance: none;
    padding: 0;
    margin: 0;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

.icon-btn:active {
    transform: scale(0.95);
}

.panel-header.gold .icon-btn {
    color: rgba(212, 175, 55, 0.6);
    border-color: rgba(212, 175, 55, 0.2);
}

.panel-header.gold .icon-btn:hover {
    color: #D4AF37;
    background-color: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
}

textarea {
    flex: 1;
    width: 100%;
    background-color: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    margin-bottom: 1rem;
}

textarea::placeholder {
    color: #444;
}

.output-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 1rem;
}

.suggestion-text {
    font-size: 1.25rem;
    color: #D4AF37;
    margin-bottom: 2rem;
    white-space: pre-wrap;
    flex: 1;
}

.suggestion-text.empty-state {
    color: #444;
}

.rationale-box {
    background-color: #151816;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.6;
}

.route-badge {
    display: inline-block;
    color: #D4AF37;
    background-color: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 0px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
    transform: translateY(-1px);
    letter-spacing: 0.5px;
}

.panel-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center; 
    align-items: center;
}

.select-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.group-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #151816;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    transition: all 0.2s;
}

select:hover, select:focus {
    border-color: #D4AF37;
    background-color: #1a1d1b;
}

select option {
    background-color: #151816;
    color: #e0e0e0;
}

#submitBtn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    
    width: 90px;
    height: 90px;
    padding: 8px;
    border-radius: 10px;
    
    background-color: #0f1110; 
    border: 1px solid rgba(255, 255, 255, 0.12); 
    color: #D4AF37;
    
    cursor: pointer;
    transition: all 0.2s ease;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-align: center;
    
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
}

#submitBtn .shortcut {
    font-weight: 500;
    font-size: 0.65rem;
    opacity: 0.5;
    color: #999;
    letter-spacing: 0;
    line-height: 1.2;
}

#submitBtn:hover {
    background-color: #151816; 
    border-color: #D4AF37;
}

#submitBtn:active {
    background-color: rgba(212, 175, 55, 0.08);
}

#submitBtn:disabled {
    background-color: #0f1110;
    color: #444;
    border-color: rgba(255, 255, 255, 0.04);
    cursor: not-allowed;
}

#submitBtn.loading:disabled {
    color: rgba(212, 175, 55, 0.8);
    border-color: rgba(212, 175, 55, 0.25);
    cursor: wait;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(212, 175, 55, 0.15);
    border-top-color: #D4AF37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.window-footer {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #111312;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 2rem;
}

.window-footer .select-group {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.window-footer .select-group:hover {
    opacity: 1;
}

.window-footer select {
    background-color: #0f1110;
    padding: 0.4rem 1.8rem 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.pin-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.pin-box {
    background-color: #0f1110;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    position: relative;
    width: 320px;
}

.pin-box h2 {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: #666;
    margin-bottom: 0.5rem;
}

.pin-box p {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.pin-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

#pinInput {
    width: 100%;
    background-color: #151816;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #D4AF37;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    letter-spacing: 4px;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

#pinInput:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

#pinInput:disabled {
    opacity: 0.5;
    cursor: wait;
}


.pin-error {
    color: #ff5f56;
    font-size: 0.75rem;
    min-height: 18px;
}

@media (max-width: 900px) {
    body {
        padding: 0;
        gap: 0;
        height: 100dvh; 
        overflow: hidden;
        background-color: #0f1110; 
    }

    .app-window {
        box-shadow: none;
        border-radius: 0;
        border: none;
        height: 100dvh; 
        width: 100vw;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }

    .app-description {
        display: none;
    }

    .workspace {
        flex-direction: column;
        flex: 1; 
        min-height: 0; 
        padding-bottom: 4.5rem; 
        position: relative;
    }

    .left-panel {
        padding: 1.2rem 1.2rem 3.2rem 1.2rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        flex: 1; 
        min-height: 0; 
        position: static; 
        display: flex;
        flex-direction: column;
    }

    .right-panel {
        padding: 3.2rem 1.2rem 1.2rem 1.2rem;
        flex: 1; 
        min-height: 0;
        position: static;
        display: flex;
        flex-direction: column;
    }

    textarea, .output-content {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }

    .left-panel .panel-footer,
    .right-panel .panel-footer {
        position: absolute;
        bottom: 0;
        width: 50%;
        height: 4.5rem;
        padding: 0;
        margin: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #0f1110; 
        z-index: 5;
    }

    .left-panel .panel-footer {
        left: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }

    .right-panel .panel-footer {
        right: 0;
    }

    #submitBtn {
        position: absolute;
        top: calc((100% - 4.5rem) / 2); 
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        z-index: 10;
        width: 72px;
        height: 72px;
        border-radius: 12px;
    }

    #submitBtn .shortcut {
        display: none; 
    }

    .window-footer {
        padding: 0 1rem;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .window-footer {
        height: auto;
        padding: 0.8rem 1rem;
    }
    
    .window-footer .select-group {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .select-group {
        gap: 0.5rem;
    }
    
    .group-label {
        font-size: 0.65rem; 
    }

    select {
        padding: 0.4rem 1.5rem 0.4rem 0.5rem; 
        font-size: 0.8rem;
    }

    textarea {
        font-size: 1rem;
    }
    
    .suggestion-text {
        font-size: 1rem;
    }
} 


.auth-field {
    width: 100%;
    background-color: #151816;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.auth-field:focus {
    border-color: #D4AF37;
}

.auth-btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.auth-primary-btn, .auth-secondary-btn {
    flex: 1;
    padding: 0.65rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-primary-btn {
    background-color: #D4AF37;
    border: 1px solid #D4AF37;
    color: #000;
}

.auth-primary-btn:hover {
    background-color: #f1c43f;
}

.auth-secondary-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

.auth-secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-guest-link {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: underline;
    transition: color 0.2s;
}

.auth-guest-link:hover {
    color: #888;
}

select option:disabled {
    color: #444;
    background-color: #0f1110;
}

.textarea-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    margin-bottom: 1rem;
}

.textarea-wrapper textarea {
    flex: 1;
    width: 100%;
    background-color: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    margin-bottom: 0; 
    padding-bottom: 1.5rem; 
}

.char-count {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 1px;
    font-weight: 500;
    pointer-events: none;
    transition: color 0.2s ease;
}

.char-count.limit-reached {
    color: #ff5f56; 
}

@media (max-width: 900px) {
    .textarea-wrapper {
        overflow-y: auto;
    }
    .textarea-wrapper textarea {
        overflow-y: visible; 
    }
}

/* =========================================
   应用底部 (App Footer)
   ========================================= */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #444444;
    letter-spacing: 1px;
    margin-top: -0.5rem;
    padding-bottom: 2rem;
    text-transform: uppercase;
}

.app-footer .divider {
    opacity: 0.3;
    font-size: 0.8rem;
}

.app-footer a {
    color: #555555;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.app-footer a svg {
    width: 14px;
    height: 14px;
}

.app-footer a:hover {
    color: #D4AF37;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .app-footer {
        display: none; /* 移动端为了保证输入区域最大化，可选择隐藏或重构位置 */
    }
}