/* ============================================
   悬浮翻译助手 - 样式
   ============================================ */

/* --- 主容器：固定在视窗右下角 --- */
/* --- 主容器：固定在视窗右下角 --- */
#floating-translator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: auto;
    max-width: 360px;
    pointer-events: none;
}

#floating-translator > * {
    pointer-events: auto;
}
/* --- 展开/收起的切换按钮 --- */
#translator-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-left: auto;
}

#translator-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#translator-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* --- 翻译面板主体 --- */
#translator-panel {
    width: 340px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#translator-panel.open {
    max-height: 500px;
    opacity: 1;
}

/* --- 面板头部 --- */
.translator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.translator-header .login-hint {
    font-size: 12px;
    opacity: 0.9;
}

/* --- 面板内容区 --- */
.translator-body {
    padding: 15px;
}

/* --- 未登录提示 --- */
.translator-login-required {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.translator-login-required p {
    margin-bottom: 15px;
    font-size: 14px;
}

.translator-login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.translator-login-btn:hover {
    opacity: 0.85;
    color: white !important;
}

/* --- 输入框 --- */
#translator-input {
    width: 100%;
    height: 90px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
    line-height: 1.5;
}

#translator-input:focus {
    outline: none;
    border-color: #667eea;
}

/* --- 语言选择和翻译按钮区域 --- */
.translator-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.translator-controls select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: white;
}

.translator-controls .lang-arrow {
    color: #999;
    font-size: 16px;
}

#translator-submit-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
    white-space: nowrap;
}

#translator-submit-btn:hover {
    opacity: 0.85;
}

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

/* --- 结果显示区 --- */
#translator-result {
    margin-top: 15px;
    padding: 12px;
    background: #f7f8fc;
    border-radius: 8px;
    min-height: 60px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
}

#translator-result.loading {
    color: #999;
    font-style: italic;
}

#translator-result.error {
    color: #e74c3c;
    background: #fdf2f2;
}

/* --- 复制按钮 --- */
.translator-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

#translator-copy-btn {
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: background 0.3s;
}

#translator-copy-btn:hover {
    background: #e0e0e0;
}

/* --- 快捷提示 --- */
.translator-shortcut {
    margin-top: 10px;
    font-size: 11px;
    color: #999;
    text-align: center;
}

.translator-shortcut kbd {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}