
/* style.css */

/* ===== 全局与基础 ===== */
html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: #1d1d1f;
    line-height: 1.65;
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bg-page-gradient {
    background: linear-gradient(135deg, #f0f2f5 0%, #e6e9ed 100%);
}

/* 主内容容器 */
.main-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(229, 229, 234, 0.7);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0,0,0,0.04);
    border-radius: 22px;
}

/* ===== 标题部分 ===== */
h1.text-title-gradient {
    background: linear-gradient(120deg, #007aff, #5856d6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    padding-bottom: 10px;
}

h1.text-title-gradient::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 3.5px;
    background: linear-gradient(90deg, #007aff, #5856d6);
    border-radius: 2px;
}

/* ===== 文件上传部分 ===== */
.file-upload-section {
    background-color: rgba(243, 244, 246, 0.85);
    border: 1px solid rgba(209, 213, 219, 0.6);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease-in-out;
    border-radius: 14px;
}
.file-upload-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 48px;
    padding: 0.75rem 1.5rem;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.03);
}
.file-input-label:hover {
    background-color: #f9f9f9;
    border-color: #c0c0c0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 4px 8px rgba(0,0,0,0.04);
}
.file-input-label:active {
    transform: translateY(0px);
    background-color: #f0f0f0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.file-name-display {
    color: #3c3c43;
    font-size: 0.9rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    white-space: normal;
    word-break: break-all;
    line-height: 1.5;
    min-height: calc(0.9rem * 1.5 + 2 * 10px + 2 * 1px);
    display: flex;
    align-items: center;
}

button {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0.75rem 1.5rem;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button:hover:not(:disabled) {
    transform: translateY(-2px);
}
button:active:not(:disabled) {
    transform: translateY(0px);
}
button:disabled {
    background-color: #e5e5e5 !important;
    color: #a0a0a0 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.75;
}

.submit-button {
    background: linear-gradient(135deg, #007aff, #3478f6);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.22);
    width: 140px;
}
.submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #0071e6, #2968d9);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.28);
}
.submit-button:active:not(:disabled) {
    background: linear-gradient(135deg, #0065cc, #245cbc);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.18);
}

.results-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
    background-color: rgba(255,255,255,0.92);
}

.transcription-output {
    background: #f7f7f7cc;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.75;
    color: #2c2c2e;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
    box-sizing: border-box;
}

.transcription-output::-webkit-scrollbar { width: 12px; }
.transcription-output::-webkit-scrollbar-track { background: rgba(0,0,0,0.03); border-radius: 10px; margin: 2px; }
.transcription-output::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.25); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.transcription-output::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.4); }

.recalibrate-button,
.copy-button {
    background: linear-gradient(135deg, #007aff, #3478f6);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.22);
    width: 140px;
}
.recalibrate-button:hover:not(:disabled),
.copy-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #0071e6, #2968d9);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.28);
}
.recalibrate-button:active:not(:disabled),
.copy-button:active:not(:disabled) {
    background: linear-gradient(135deg, #0065cc, #245cbc);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.18);
}

.copy-button.copied-success {
    background: linear-gradient(135deg, #28a745, #218838);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.25);
}
.copy-button.copied-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1e7e34);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}
.copy-button.copied-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.25);
}
.copy-button.copied-error:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #bd2130);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.status-message {
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeInStatus 0.4s ease-out forwards;
    width: 100%;
    box-sizing: border-box;
    border-width: 1px;
    border-style: solid;
}
@keyframes fadeInStatus {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.status-message.error { background-color: #fff0f0; border-color: #ffdddd; color: #d93025; }
.status-message.success { background-color: #e6ffed; border-color: #c6f6d5; color: #1e8e3e; }
.status-message.info { background-color: #e6f4ff; border-color: #ccebff; color: #1a73e8; }

.app-footer {
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    color: #6e6e73;
    font-size: 0.8rem;
}
.app-footer a {
    color: #007aff;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}
.app-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

@media (max-width: 639px) {
    .main-container {
        border-radius: 18px;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    body {
        padding-left: 0;
        padding-right: 0;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    h1.text-title-gradient {
        font-size: 1.75rem;
        padding-bottom: 8px;
    }
    h1.text-title-gradient::after {
        width: 180px;
        height: 3px;
    }

    .file-upload-section {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .file-input-label,
    button {
        height: 44px;
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        font-size: 0.95rem;
    }

    .file-input-label,
    .submit-button,
    .recalibrate-button,
    .copy-button {
        width: 130px;
    }
    .buttons-group.space-x-2 > :not([hidden]) ~ :not([hidden]) { /* Tailwind's space-x-2 equivalent for CSS */
        margin-left: 0.5rem; /* Adjust if needed for mobile */
    }


    .file-name-display {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
        font-size: 0.85rem;
        min-height: calc(0.85rem * 1.5 + 2 * 8px + 2 * 1px);
    }

    .results-content-wrapper {
        padding: 0.75rem;
        border-radius: 12px;
    }
    .results-area .flex.justify-between.items-center h2 {
        font-size: 1.1rem;
    }
    .transcription-output {
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    .status-message {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    .app-footer {
        padding-top: 1rem;
        padding-bottom: 1rem;
        font-size: 0.75rem;
    }
}

.hidden {
    display: none !important;
}
