html, body { height: 100%; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; margin: 0; background: linear-gradient(180deg, #EEF2FF, #ECFDF5); color: #1f2633; overflow: hidden; }
:root { --ui-scale: 1; }
.container { width: 100vw; height: 100vh; height: 100dvh; padding: 28px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); max-width: none; margin: 0; box-sizing: border-box; display: flex; flex-direction: column; }
h1 { margin: 0; font-size: 24px; letter-spacing: .3px; color: #0f172a; position: relative; z-index: 5; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.user-bar { display: inline-flex; align-items: center; gap: 8px; }
.user-info { font-size: 13px; color: #334155; background: #ffffff; border: 1px solid #e2e8f0; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,0.12); padding: 6px; display: flex; flex-direction: column; z-index: 50; }
.dropdown-item { display: block; color: #0f172a; text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.dropdown-item:hover { background: #f8fafc; }
form { background: #ffffff; padding: 18px; border-radius: 12px; box-shadow: 0 6px 20px rgba(15,23,42,0.06); margin-bottom: 16px; border: 1px solid #eef2f7; }
.upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
label { font-size: 14px; color: #334155; }
button { cursor: pointer; background: linear-gradient(90deg, #2563eb, #22c55e); color: #fff; border: 0; padding: 9px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 12px rgba(37,99,235,0.2); transition: transform .08s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { background: #93c5fd; opacity: 0.7; cursor: not-allowed; box-shadow: none; }
.secondary { background: #64748b; box-shadow: 0 4px 12px rgba(100,116,139,0.2); }
.secondary:hover { transform: translateY(-1px); }
.danger { background: #ef4444; box-shadow: 0 4px 12px rgba(239,68,68,0.2); }
.danger:hover { transform: translateY(-1px); }
.hidden { display: none; }

#progress { margin: 10px 0; font-size: 13px; color: #475569; }
#progress-bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; border: 1px solid #e5e7eb; margin-bottom: 8px; }
#progress-bar-inner { height: 100%; width: 0%; background: linear-gradient(90deg, #60a5fa, #34d399); transition: width .15s ease; }
#progress-detail { font-size: 12px; color: #64748b; margin-bottom: 10px; }

.layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; flex: 1; min-height: 0; box-sizing: border-box; }
#sidebar { background: #ffffff; border: 1px solid #eef2f7; border-radius: 12px; box-shadow: 0 6px 20px rgba(15,23,42,0.05); overflow: hidden; height: 100%; }
.sidebar-header { padding: 12px 14px; font-weight: 700; font-size: 13px; color: #0f172a; border-bottom: 1px solid #eef2f7; background: #f8fafc; }
#file-list { list-style: none; margin: 0; padding: 8px; max-height: calc(100% - 42px); overflow: auto; }
#file-list li { padding: 10px 10px; margin: 6px 4px; border-radius: 10px; border: 1px solid #eef2f7; background: #fff; cursor: pointer; font-size: 13px; color: #334155; display: flex; align-items: center; gap: 8px; }
#file-list li:hover { background: #f8fafc; }
#file-list li.active { background: #e8f1ff; border-color: #cfe1ff; color: #1d4ed8; }
.file-index { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: #eef2f7; color: #475569; font-size: 12px; }

#content { min-height: 300px; height: 100%; display: flex; flex-direction: column; min-height: 0; }
#result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#current-filename { font-weight: 700; font-size: 15px; color: #0f172a; }
#player-wrap { margin-bottom: 10px; }

#result { background: #ffffff; padding: 18px; border-radius: 12px; box-shadow: 0 6px 20px rgba(15,23,42,0.06); min-height: 300px; border: 1px solid #eef2f7; flex: 1; min-height: 0; overflow: auto; }
.dialogue { display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; }
.bubble { max-width: 74%; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.bubble.customer { background: #e9f5ff; border: 1px solid #c9e7ff; align-self: flex-start; border-top-left-radius: 4px; }
.bubble.agent { background: #f4f9ee; border: 1px solid #d9efc2; align-self: flex-end; border-top-right-radius: 4px; margin-left: auto; }
.speaker { font-size: 12px; color: #64748b; margin-bottom: 4px; font-weight: 600; }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  #sidebar { position: relative; height: auto; }
}


/* 弹窗样式 */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,0.35); z-index: 100; }
.modal .modal-content { width: 92vw; max-width: 420px; background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; box-shadow: 0 20px 60px rgba(15,23,42,0.18); display: flex; flex-direction: column; }
.modal .modal-content.large { max-width: 900px; }
.modal .modal-header { padding: 14px 16px; font-weight: 700; font-size: 16px; border-bottom: 1px solid #eef2f7; }
.modal .modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.modal .modal-body input[type="text"],
.modal .modal-body input[type="password"] { padding: 8px 10px; border-radius: 8px; border: 1px solid #e5e7eb; font-size: 14px; }
.modal .modal-footer { padding: 14px 16px; border-top: 1px solid #eef2f7; display: flex; gap: 8px; justify-content: flex-end; }
.error { color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; }

#user-table { width: 100%; border-collapse: collapse; }
#user-table th, #user-table td { border: 1px solid #e5e7eb; padding: 8px; font-size: 13px; }
#user-table th { background: #f8fafc; text-align: left; }
.create-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

/* 输入后缀按钮（生成密码） */
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ghost { background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; padding: 8px 12px; border-radius: 10px; cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset; }
.ghost:hover { background: #e2e8f0; }

/* 登录页商用化布局 */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; gap: 18px; background: radial-gradient(1200px 600px at 10% 10%, rgba(99,102,241,0.08), transparent 60%), radial-gradient(1200px 600px at 90% 90%, rgba(34,197,94,0.08), transparent 60%), linear-gradient(180deg, #EEF2FF 0%, #ECFDF5 100%); }
.brand { text-align: center; }
.brand-title { font-size: 24px; font-weight: 800; color: #111827; letter-spacing: .2px; }
.brand-subtitle { font-size: 13px; color: #64748b; margin-top: 4px; }
.auth-card { max-width: 420px; width: 92vw; border-radius: 16px; border: 1px solid #e6efff; box-shadow: 0 30px 80px rgba(15,23,42,0.12); background: linear-gradient(180deg, #e7efff 0%, #dbe9ff 100%); }
.footer-tip { font-size: 12px; color: #64748b; }

/* 后台管理页卡片与表格优化 */
.admin-container .modal-content { max-width: none; }
#user-table { border-radius: 10px; overflow: hidden; }
#user-table th, #user-table td { border-color: #eef2f7; }
#user-table tbody tr:hover { background: #f8fafc; }

/* 表单组通用样式 */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; color: #334155; font-weight: 600; }
.input { padding: 10px 12px; border-radius: 10px; border: 1px solid #e5e7eb; font-size: 14px; transition: box-shadow .15s ease, border-color .15s ease; outline: none; }
.input:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,0.2); }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 登录页标签（用户名/密码）精致背景，仅作用于登录卡片 */
.auth-card .form-group { position: static; padding: 0; border: 0; background: none; margin-bottom: 14px; }
.auth-card .form-group:focus-within { border: 0; box-shadow: none; }
.auth-card .form-label { position: static; display: block; margin-bottom: 6px; padding: 0; border: 0; background: none; color: #334155; font-weight: 700; }
.auth-card .form-group .input { background: linear-gradient(180deg, #eef4ff 0%, #e7efff 100%); border: 1px solid #dbeafe; box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); padding: 10px 12px; border-radius: 10px; }
.auth-card .form-group .input:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,0.2); }

