/* ============================================
   Clip 多语言字幕配音平台 - 登录页面样式
   参考: https://clip.wanmeiku.cn/login
   ============================================ */

/* --- 维吾尔语字体 --- */
@font-face {
    font-family: 'AlpsoftTuzTom';
    src: url('../fonts/AlpsoftTuzTom.ttf') format('truetype');
    font-display: swap;
}

/* 维语模式下启用阿拉伯字体 + RTL */
body.lang-ug {
    font-family: 'AlpsoftTuzTom', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    direction: rtl;
}

body.lang-ug .login-box h2 {
    font-weight: 700;
    text-align: right;
}

body.lang-ug .message {
    text-align: right;
}

body.lang-ug .tip,
body.lang-ug .footer-info {
    text-align: center;
}

body.lang-ug input {
    text-align: right;
    direction: rtl;
}

/* --- CSS 变量 (Design Tokens) --- */
:root {
    --bg-dark:       #1a1a1a;
    --card-bg:       #ffffff;
    --text-primary:  #333333;
    --text-secondary:#666666;
    --border-color:  #cccccc;
    --btn-primary:   #28a745;
    --btn-secondary: #007bff;
    --btn-primary-hover: #218838;
    --btn-secondary-hover: #0069d9;
    --radius: 12px;
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 科技感背景：深色渐变 + 网格线 + 光晕 */
    background:
        /* 顶部光晕 */
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 180, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(100, 60, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 20% 30%, rgba(0, 200, 150, 0.05) 0%, transparent 60%),
        /* 网格线 */
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        /* 深色基底 */
        linear-gradient(180deg, #0a0e1a 0%, #0d1322 40%, #111827 100%);
    background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        40px 40px,
        40px 40px,
        100% 100%;
}

/* --- 页面容器 --- */
.page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding: 60px 20px 40px;
}

/* --- 语言切换栏 --- */
.lang-bar {
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: flex-end;
}

.lang-bar select {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    padding: 6px 28px 6px 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, background 0.2s;
}

.lang-bar select:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.lang-bar select:focus {
    border-color: rgba(0, 180, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 180, 255, 0.12);
}

.lang-bar select option {
    background: #1a1f2e;
    color: #fff;
}

/* --- 登录卡片 --- */
.login-box {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.login-box h2 {
    text-align: center;
    font-size: 28.8px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.subtitle {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

/* --- 表单 --- */
.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--btn-secondary);
}

/* 验证码行：输入框 + 按钮 */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.btn-code {
    flex-shrink: 0;
    padding: 0 20px;
    background: var(--btn-secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13.33px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-code:hover {
    background: var(--btn-secondary-hover);
}

.btn-code:disabled {
    background: #999;
    cursor: not-allowed;
}

/* --- 提示文字 --- */
.tip {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 24px;
}

/* --- 登录按钮 --- */
.btn-login {
    width: 100%;
    height: 56px;
    background: var(--btn-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--btn-primary-hover);
}

.btn-login:disabled {
    background: #999;
    cursor: not-allowed;
}

/* --- 消息提示 --- */
.message {
    text-align: center;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

.message.success { color: var(--btn-primary); }
.message.error   { color: #dc3545; }

/* --- 登录/注册切换链接 --- */
.switch-link {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 20px;
}
.switch-link a {
    color: var(--btn-secondary);
    text-decoration: none;
    cursor: pointer;
}
.switch-link a:hover {
    text-decoration: underline;
}

/* --- 隐藏表单区 --- */
.form-section {
    display: block;
}

/* --- 视频演示区 --- */
.video-section {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.video-section h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 16px;
}

.video-wrapper {
    position: relative;
    width: 100%;
}

.video-wrapper video {
    width: 100%;
    display: block;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
    pointer-events: none; /* 点击穿透到 video */
}

.play-overlay svg {
    width: 100%;
    height: 100%;
}

/* --- 页脚 --- */
.footer-info {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    line-height: 1.8;
    padding-bottom: 36px;
}
.footer-info p { margin: 0; }
.footer-info .icp {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
}

/* --- 响应式 --- */
@media (max-width: 500px) {
    .login-box {
        padding: 24px 20px;
    }

    .login-box h2 {
        font-size: 22px;
    }

    .btn-login {
        height: 48px;
        font-size: 16px;
    }

    .page-container {
        padding: 30px 12px 20px;
        gap: 20px;
    }
}

/* ============================================
   主面板 - 文本翻译页样式
   ============================================ */

.dashboard {
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
}

/* --- 头部 --- */
.translate-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}
.translate-header h1 {
    font-size: 22px;
    color: #fff;
    font-weight: 600;
    grid-column: 2;
}
.header-left { grid-column: 1; }
.header-right { grid-column: 3; text-align: right; }
.dash-user {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}
.btn-logout {
    padding: 6px 18px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: rgba(255,75,75,0.25);
    border-color: rgba(255,75,75,0.5);
}

/* --- 提示条 --- */
.warning-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,193,7,0.1);
    border: 1px solid rgba(255,193,7,0.2);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: rgba(255,213,79,0.92);
}
.warning-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #ff9800;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* --- 语言选择器 --- */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.lang-item { flex: 1; }
.lang-item select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a29bfe' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lang-item select:hover {
    border-color: rgba(108,92,231,0.4);
    background: rgba(255,255,255,0.09);
}
.lang-item select:focus {
    border-color: rgba(108,92,231,0.6);
    background: rgba(108,92,231,0.1);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}
.lang-item select option {
    background: #1a1f2e;
    color: #fff;
    padding: 8px;
}
.btn-swap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(108,92,231,0.5);
    background: rgba(108,92,231,0.15);
    color: #a29bfe;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-swap:hover {
    background: rgba(108,92,231,0.3);
    transform: rotate(180deg);
}

/* --- 翻译提示 --- */
.translate-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;
}

/* --- 翻译面板 --- */
.translate-panels {
    display: flex;
    gap: 16px;
    height: 420px;
}
.panel {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}
.panel-hint {
    font-weight: 400;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}
.panel-source textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    outline: none;
    font-family: inherit;
    overflow-y: auto;
}
.panel-source textarea::placeholder {
    color: rgba(255,255,255,0.35);
}

.panel-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tool-btn {
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tool-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.export-btn {
    background: rgba(108,92,231,0.15);
    border-color: rgba(108,92,231,0.35);
    color: #a29bfe;
}
.export-btn:hover { background: rgba(108,92,231,0.28); color: #c4b5fd; }

.target-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}
.target-placeholder {
    color: rgba(255,255,255,0.28);
    font-size: 15px;
    text-align: center;
    padding-top: 60px;
}
.target-content {
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
/* 维吾尔语 RTL + 字体 */
.target-content.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'AlpsoftTuzTom', 'UKIJ Tuz', 'Microsoft Uighur', sans-serif;
}
.panel-source textarea.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'AlpsoftTuzTom', 'UKIJ Tuz', 'Microsoft Uighur', sans-serif;
}
.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}
.btn-clear {
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    cursor: pointer;
}
.btn-clear:hover { background: rgba(255,75,75,0.15); border-color: rgba(255,75,75,0.3); }

/* --- 上传按钮 --- */
.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(108,92,231,0.35);
    background: rgba(108,92,231,0.1);
    color: #a29bfe;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.btn-upload:hover {
    background: rgba(108,92,231,0.22);
    border-color: rgba(108,92,231,0.55);
    color: #c4b5fd;
}
.btn-upload.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* --- 翻译按钮 --- */
.translate-action {
    text-align: center;
    padding: 24px 0 12px;
}
.btn-translate {
    padding: 14px 80px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6c5ce7 0%, #8b7cf6 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.btn-translate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(108,92,231,0.45);
    background: linear-gradient(135deg, #7b6cf6 0%, #9b8cfd 100%);
}
.btn-translate:active { transform: translateY(0); }
.btn-translate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- 客服悬浮按钮 --- */
.btn-cs-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: none;
    background: #4a90e2;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74,144,226,0.4);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    z-index: 1000;
    padding: 0;
    line-height: 1;
}
.btn-cs-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(74,144,226,0.5);
}

/* 客服二维码弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
.modal-card {
    background: #1e2433;
    border-radius: 16px;
    padding: 32px 28px 24px;
    text-align: center;
    color: #e0e6f0;
    width: 320px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 24px;
    color: #8899aa;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: #fff;
}
.modal-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}
.modal-card p {
    margin: 0 0 18px;
    font-size: 13px;
    color: #8899aa;
}
.qr-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: inline-block;
}
.qr-box img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
}
