* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; }
.app { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }

.panel { border-right: 1px solid #ddd; padding: 14px; overflow: auto; background: #fafafa; }
.panel h2 { margin: 6px 0 12px; }
.panel label { display:block; margin-top: 10px; font-size: 13px; color: #333; }
.panel textarea, .panel input, .panel select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 8px; background: white; }
.row { display:flex; gap: 8px; align-items: center; margin-top: 10px; }
.row button { padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; background: white; cursor: pointer; }
.row .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  color: #111;
  text-decoration: none;
  cursor: pointer;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.chk { display:flex; gap: 8px; align-items: center; font-size: 13px; }
.status { margin-top: 12px; padding: 8px; border-radius: 8px; background: #fff; border: 1px solid #ddd; color: #555; }
.usage { margin-top: 8px; color: #666; font-size: 12px; word-break: break-all; }

.chat { display:flex; flex-direction: column; height: 100vh; }
.messages { flex: 1; padding: 16px; overflow: auto; background: white; }
.msg { max-width: 920px; margin: 10px auto; padding: 10px 12px; border-radius: 12px; border: 1px solid #e6e6e6; }
.msg.you { background: #f6fbff; }
.msg.ai { background: #fff; }
.meta { font-size: 12px; color: #666; margin-bottom: 6px; }
.content { white-space: pre-wrap; line-height: 1.5; }

.composer { display:flex; gap: 10px; padding: 12px; border-top: 1px solid #ddd; background: #fafafa; }
.composer textarea { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 10px; resize: none; }
.composer button { width: 110px; border: 1px solid #ccc; border-radius: 10px; background: white; cursor: pointer; }
.auth-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  z-index: 9999;
}
.auth-card{
  width: 360px;
  background: white;
  border-radius: 14px;
  border: 1px solid #ddd;
  padding: 16px;
}
.auth-row{ margin-top: 10px; }
.auth-row label{ display:block; font-size:13px; color:#333; margin-bottom:6px; }
.auth-row input{
  width:100%; padding:10px;
  border:1px solid #ccc; border-radius:10px;
}
.auth-actions{ margin-top: 12px; display:flex; gap:10px; align-items:center; }
.auth-actions button{
  padding:10px 12px; border:1px solid #ccc;
  border-radius:10px; background:#fff; cursor:pointer;
}
.auth-err{ color:#b00020; font-size:12px; }
.auth-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center; z-index:9999; }
.auth-card{ width:380px; background:#fff; border:1px solid #ddd; border-radius:14px; padding:16px; }
.auth-tabs{ display:flex; gap:8px; }
.auth-tabs .tab{ flex:1; padding:10px; border:1px solid #ccc; border-radius:10px; background:#fff; cursor:pointer; }
.auth-tabs .active{ border-color:#111; font-weight:600; }
.auth-row{ margin-top:12px; }
.auth-row label{ display:block; font-size:13px; margin-bottom:6px; }
.auth-row input{ width:100%; padding:10px; border:1px solid #ccc; border-radius:10px; }
.auth-actions{ margin-top:12px; display:flex; gap:10px; align-items:center; }
.auth-actions button{ padding:10px 12px; border:1px solid #ccc; border-radius:10px; background:#fff; cursor:pointer; }
.auth-err{ color:#b00020; font-size:12px; }
.auth-hint{ margin-top:10px; color:#666; font-size:12px; }

/* OAuth 图标按钮 */
.auth-oauth {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.oauth-btn:hover {
  border-color: #999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}
.oauth-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* 分割线 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
  color: #999;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.cam-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-card {
  width: min(92vw, 520px);
  background: #101317;
  border: 1px solid #2a2f36;
  border-radius: 14px;
  padding: 12px;
}

.cam-title {
  color: #e8ecf1;
  font-size: 14px;
  margin-bottom: 8px;
}

#camVideo {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: #000;
}

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

#camOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cam-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.cam-actions button {
  padding: 8px 10px;
  border: 1px solid #3a414b;
  border-radius: 8px;
  background: #151a20;
  color: #e8ecf1;
  cursor: pointer;
}

.cam-hint {
  margin-top: 8px;
  color: #9da7b3;
  font-size: 12px;
  word-break: break-all;
}
