/*
 * AI 智能面试系统 - 样式表
 * 设计风格：专业、现代、清新商务
 */

:root {
    /* 配色方案 - 专业商务蓝 */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    
    /* 中性色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 字体 */
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Noto Serif SC', serif;
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
}

/* 屏幕切换 */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* ===== 欢迎页面 ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    z-index: 0;
}

.welcome-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.welcome-header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.setup-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.info-card {
    background: linear-gradient(to right, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0 2rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-icon {
    font-size: 1.25rem;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

/* ===== 面试页面 ===== */
.interview-header {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.position-tag {
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.question-counter {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    max-height: calc(100vh - 140px);
}

.messages-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-ai {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.message-ai .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.message-user .message-avatar {
    background: linear-gradient(135deg, var(--accent-color), #d97706);
}

.message-content {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.message-ai .message-content {
    border-bottom-left-radius: 4px;
    background: var(--bg-secondary);
}

.message-user .message-content {
    border-bottom-right-radius: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.message-text {
    line-height: 1.6;
}

.message-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.message-ai .message-role {
    color: var(--text-secondary);
}

.message-user .message-role {
    color: rgba(255, 255, 255, 0.8);
}

/* 输入区域 */
.input-area {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: var(--danger-color);
    font-weight: 500;
}

.recording-status.hidden {
    display: none;
}

.pulse-wave {
    width: 12px;
    height: 12px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.transcript-preview {
    max-width: 600px;
    margin: 0 auto 0.75rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.transcript-preview.hidden {
    display: none;
}

.transcript-preview p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.input-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.record-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

.record-btn:hover {
    background: rgba(37, 99, 235, 0.05);
}

.record-btn.recording {
    background: var(--danger-color);
    border-color: var(--danger-color);
    animation: recordPulse 1.5s infinite;
}

.record-btn.recording .mic-label {
    color: white;
}

.record-btn.recording .mic-icon {
    color: white;
}

@keyframes recordPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.mic-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.mic-label {
    font-weight: 500;
    color: var(--primary-color);
}

/* ===== 结果页面 ===== */
.result-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

#result-position {
    color: var(--text-secondary);
}

.score-overview {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.total-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
}

.score-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 1s ease-out;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.recommendation-badge {
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    font-weight: 600;
}

.recommendation-badge.strong {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.recommendation-badge.recommend {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.recommendation-badge.consider {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-color);
}

.recommendation-badge.reject {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.dimension-scores {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.score-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.score-row:last-child {
    margin-bottom: 0;
}

.score-info {
    flex: 0 0 100px;
}

.score-name {
    font-weight: 500;
    color: var(--text-primary);
}

.score-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 24px;
}

.score-bar {
    flex: 1;
    height: 100%;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.score-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    width: 0;
    transition: width 0.8s ease-out;
}

.score-value-text {
    flex: 0 0 35px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.comments-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.comments-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comments-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

.analysis-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.analysis-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.strengths-title {
    color: var(--success-color);
}

.weaknesses-title {
    color: var(--accent-color);
}

.analysis-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.analysis-list li {
    padding: 0.5rem 0;
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-secondary);
}

.analysis-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-weight: bold;
}

.strengths-list li::before {
    color: var(--success-color);
}

.weaknesses-list li::before {
    color: var(--accent-color);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    width: auto;
    flex: 0 1 auto;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-secondary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .welcome-content {
        padding: 2rem 1rem;
    }
    
    .setup-form {
        padding: 1.5rem;
    }
    
    .chat-container {
        padding: 1rem;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .interview-header {
        padding: 0.75rem 1rem;
    }
    
    .input-area {
        padding: 1rem;
    }
    
    .result-container {
        padding: 1.5rem 1rem;
    }
    
    .analysis-section {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .total-score {
        flex-direction: column;
        text-align: center;
    }
}

/* 打分结果动画 */
@keyframes fillScore {
    from {
        width: 0;
    }
    to {
        width: var(--score-width);
    }
}
