/* WhisNote 语记 - 样式文件 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

/* 语音录制区域 */
.voice-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.voice-visualizer {
    margin-bottom: 20px;
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0.2;
    transition: all 0.3s ease;
}

.voice-circle.active {
    opacity: 0.8;
    transform: scale(1.2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1.2); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

/* 实时听写叠加层 */
.realtime-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

.realtime-text.active {
    opacity: 1;
    animation: realtime-glow 2s infinite;
}

@keyframes realtime-glow {
    0%, 100% { 
        background: rgba(255, 255, 255, 0.1);
        color: #1f2937;
    }
    50% { 
        background: rgba(102, 126, 234, 0.2);
        color: #4338ca;
    }
}



.voice-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    min-height: 80px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.voice-btn:active {
    transform: translateY(0);
}

.voice-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0% { box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 15px 35px rgba(239, 68, 68, 0.6); }
    100% { box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3); }
}

.voice-icon {
    font-size: 1.5rem;
}

.voice-status {
    margin-top: 15px;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.quick-guide {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    border-radius: 12px;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 2px solid #f59e0b;
    animation: gentle-glow 3s infinite alternate;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

@keyframes gentle-glow {
    0% { box-shadow: 0 5px 15px rgba(245, 158, 11, 0.2); }
    100% { box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4); }
}

/* 转录和结果区域 */
.transcript-section,
.result-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.transcript-section h3,
.result-section h3 {
    margin-bottom: 15px;
    color: #374151;
    font-size: 1.3rem;
    font-weight: 600;
}

.transcript-box,
.result-box {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    min-height: 120px;
    max-height: 300px;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.transcript-box {
    border-left: 4px solid #667eea;
    position: relative;
}

.transcript-box::-webkit-scrollbar {
    width: 6px;
}

.transcript-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.transcript-box::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.transcript-box::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* 临时识别内容样式 */
.transcript-box {
    line-height: 1.8;
}

.transcript-box::selection {
    background: #667eea;
    color: white;
}



/* 为累积内容添加更好的可读性 */
.transcript-content {
    font-weight: 500;
}

.interim-content {
    color: #667eea;
    font-style: italic;
    opacity: 0.8;
}

.result-box {
    background: #f0f9ff;
    border-color: #bae6fd;
}

/* 操作按钮 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 5px 15px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.btn-tertiary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.btn-tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* 历史笔记 */
.history-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.history-section h3 {
    margin-bottom: 20px;
    color: #374151;
    font-size: 1.3rem;
    font-weight: 600;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.history-item-date {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.history-item-content {
    font-size: 1rem;
    color: #374151;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px 20px;
}

/* 设置和提示区域 */
.settings-section,
.tips-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.settings-section details,
.tips-section details {
    cursor: pointer;
}

.settings-section summary,
.tips-section summary {
    padding: 20px 25px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

.settings-section summary:hover,
.tips-section summary:hover {
    background: #f3f4f6;
}

.settings-content,
.tips-content {
    padding: 25px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label:not([for]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.setting-item label[for] {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #667eea;
}



.tips-content ul {
    list-style: none;
    padding: 0;
}

.tips-content li {
    margin-bottom: 12px;
    padding-left: 10px;
    color: #374151;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .voice-btn {
        min-width: 180px;
        padding: 18px 30px;
        font-size: 1.1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .btn {
        min-height: 55px;
        font-size: 0.95rem;
    }
    
    .settings-content,
    .tips-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .voice-btn {
        min-width: 160px;
        padding: 16px 25px;
        font-size: 1rem;
    }
    
    .voice-circle {
        width: 80px;
        height: 80px;
    }
    
    .voice-visualizer {
        height: 100px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        color: #f1f5f9;
    }
    
    .container {
        background: rgba(30, 41, 59, 0.95);
        color: #f1f5f9;
    }
    
    .header {
        border-bottom-color: #475569;
    }
    
    .voice-section,
    .transcript-section,
    .result-section,
    .history-section,
    .settings-section,
    .tips-section {
        background: rgba(51, 65, 85, 0.8);
    }
    
    .transcript-box {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .result-box {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .history-item {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .settings-section summary,
    .tips-section summary {
        background: #1e293b;
        border-bottom-color: #475569;
        color: #f1f5f9;
    }
    
    .setting-item input,
    .setting-item select {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
}

/* 历史笔记样式 */
.history-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-date {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.history-actions {
    display: flex;
    gap: 5px;
}

.btn-small {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-small:hover {
    background: #2563eb;
}

.btn-small:last-child {
    background: #ef4444;
}

.btn-small:last-child:hover {
    background: #dc2626;
}

.history-preview {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.4;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

/* 快速指南动画 */
@keyframes pulse {
    0%, 100% { 
        background-color: rgba(59, 130, 246, 0.1);
        border-color: rgba(59, 130, 246, 0.2);
    }
    50% { 
        background-color: rgba(59, 130, 246, 0.2);
        border-color: rgba(59, 130, 246, 0.3);
    }
}

/* 安全指示器样式 */
.security-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.security-icon {
    font-size: 0.8rem;
}

.security-text {
    font-weight: 500;
}

/* 当不支持加密时的样式 */
.security-indicator.insecure {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.security-indicator.insecure .security-icon {
    opacity: 0.6;
}

/* API密钥输入框调整，为安全指示器留出空间 */
#apiKey {
    padding-right: 100px;
} 