* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #f4f6f8; color: #222; }
.login-box { max-width: 320px; margin: 12vh auto; background: #fff; padding: 28px; border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.login-box h2 { margin-bottom: 16px; }
.login-box input { display: block; width: 100%; margin-bottom: 12px; padding: 10px; border: 1px solid #d9dde3; border-radius: 6px; }
.login-box button { width: 100%; padding: 10px; background: #2f6fed; color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.err { color: #e23; margin-top: 8px; font-size: 13px; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1f2937; color: #e5e7eb; display: flex; flex-direction: column; }
.logo { padding: 18px; font-size: 18px; font-weight: 700; border-bottom: 1px solid #374151; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a { display: block; padding: 12px 18px; cursor: pointer; color: #cbd5e1; }
.sidebar nav a:hover, .sidebar nav a.active { background: #374151; color: #fff; }
.side-foot { padding: 14px; border-top: 1px solid #374151; font-size: 13px; }
.side-foot button { margin-top: 8px; width: 100%; padding: 8px; background: #374151; color: #fff; border: 0; border-radius: 6px; cursor: pointer; }

.content { flex: 1; padding: 24px 30px; overflow: auto; }
.content h3 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.row label { font-size: 14px; }
select, input { padding: 8px 10px; border: 1px solid #d9dde3; border-radius: 6px; }
button { padding: 8px 14px; background: #2f6fed; color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
button:hover { opacity: .9; }
.hint { color: #6b7280; font-size: 13px; margin-top: 8px; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; }
.card { background: #fff; border-radius: 10px; padding: 18px 22px; min-width: 150px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.card b { font-size: 24px; display: block; color: #2f6fed; }
.card span { color: #6b7280; font-size: 13px; }

.upload { background: #fff; padding: 16px; border-radius: 10px; margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: #fff; border-radius: 8px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.item .meta { font-size: 13px; color: #6b7280; }
.item .del { background: #ef4444; }
code { background: #eef2f7; padding: 4px 8px; border-radius: 4px; font-size: 13px; word-break: break-all; }

.chat-detail { margin-top: 14px; background: #fff; border-radius: 10px; padding: 16px; min-height: 120px; }
.msg { margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; }
.msg.user { background: #e8f0fe; }
.msg.assistant { background: #f1f5f9; }
.src { font-size: 12px; color: #6b7280; margin-top: 6px; }
.tab { animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 手机版：汉堡菜单（默认隐藏，窄屏显示） */
.menu-btn { display: none; position: fixed; top: 10px; left: 10px; z-index: 100; font-size: 20px; padding: 6px 13px; background: #2f6fed; border: 0; border-radius: 8px; color: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
/* 一键复制话术 */
.copy-btn { display: block; margin-top: 10px; background: #047857; }
.copy-btn.copied { background: #059669; }
/* 语音输入按钮 */
.voice-btn { background: #047857; white-space: nowrap; }
.voice-btn[disabled] { opacity: .6; }

@media (max-width: 768px) {
  .menu-btn { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 215px; z-index: 99; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 2px 0 14px rgba(0,0,0,.3); }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 56px 12px 24px; }
  .logo { font-size: 16px; padding: 14px; }
  .cards .card { flex: 1; min-width: calc(50% - 7px); padding: 14px 16px; }
  .card b { font-size: 20px; }
  .upload input, .upload select, .upload button { width: 100%; }
  .row input, .row select { min-width: 0; flex: 1; }
  .row label { font-size: 13px; }
  .ask-box { flex-direction: column; }
  .ask-box textarea { min-height: 84px; }
  .ask-box button { width: 100%; }
  .item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .item button, .item .del { align-self: flex-end; }
  .chat-detail { padding: 12px; }
  .login-box { margin: 8vh 16px; }
  textarea { font-size: 15px; }
}

textarea { width: 100%; min-height: 70px; padding: 10px; border: 1px solid #d9dde3; border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; }
.ask-box { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.ask-box textarea { flex: 1; min-height: 60px; }
.ask-box button { align-self: flex-end; white-space: nowrap; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.chk input { width: auto; }
.tag { display: inline-block; font-size: 12px; color: #2f6fed; background: #e8f0fe; border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.capture { margin-top: 10px; padding: 8px 12px; background: #ecfdf5; color: #047857; border-radius: 6px; font-size: 13px; }
hr { border: 0; border-top: 1px solid #e5e7eb; margin: 18px 0; }
#tab-experiences textarea { min-height: 90px; margin: 10px 0; }
