* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
  background: #f5f5f5;
}


.container {
  display: flex;
  height: 100vh;
}

/* ========== Chat ========== */

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.chat {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.hint {
  color: #999;
  text-align: center;
  margin-top: 40px;
}

.msg {
  max-width: 75%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  background: #dbeafe;
  margin-left: auto;
}

.msg.assistant {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  margin-right: auto;
}

/* References */
.sources {
  width: 100%;
  margin-top: 6px;
  text-align: left;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
}

.sources div {
  margin-top: 4px;
}

.sources a {
  color: #2563eb;
  text-decoration: none;
  width: 100%;
  text-align: left;
}

.sources a:hover {
  text-decoration: underline;
}

/* Input */
.chat-input {
  display: flex;
  padding: 12px;
  border-top: 1px solid #ddd;
  background: #fff;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.chat-input button {
  margin-left: 10px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  cursor: pointer;
}

.chat-input button:hover {
  background: #1d4ed8;
}

/* ========== Panel ========== */

.panel {
  width: 360px;
  padding: 10px;
  background: #ffffff;
  border-left: 1px solid #ddd;
  overflow-y: auto;
}

.panel h3 {
  margin-top: 0;
}


.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.param-group {
  margin-bottom: 16px;
}

.param-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  /*cursor: pointer;*/
  font-size: 14px;
}


.msg.thinking {
  color: #888;
  font-style: italic;
}

.thinking::after {
  content: " ⏳";
}
.ref-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  line-height: 1.4;
}

.ref-item {
  display: flex;          /* 👈 用 flex 抵消 column 拆分 */
  /*align-items: center;*/
  align-items: flex-start;   /* 👈 顶部对齐 */
  justify-content: flex-start;
  margin: 2px 0;
}

.ref-index {
  margin-right: 2px;
  color: #555;
}

.ref-link {
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
  position: relative;

  font-size: 12px;
  line-height: 1.4;
}

/* tooltip 本体 */
.ref-link::after {
  content: attr(data-content);
  position: absolute;
  left: 0;
  top: 24px;

  width: 1200px;            /* 👈 直接给固定宽度 */
  max-width: 80vw;         /* 👈 防止小屏溢出 */

  background: rgba(20, 20, 20, 0.95);
  color: #fff;

  padding: 10px 12px;
  border-radius: 8px;

  font-size: 12px;
  line-height: 1.5;

  white-space: normal;     /* 👈 必须 */
  word-break: break-word; /* 👈 必须 */

  display: none;
  z-index: 9999;

  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* hover 显示 */
.ref-link:hover::after {
  display: block;
}

.excel {
  flex:1;
  padding:5px;
  background:#fafafa;
  border-radius: 20px;
    }

textarea { width:100%; height:100px; }

button {
  margin-top:10px;
  color: white;
  border: none;
  padding:8px 12px;
  border-radius: 8px;
  cursor:pointer;
  background: #4a6cf7;
  /*transition: 0.2s;*/
}

button:hover {
  background: #3b5be0;
}

.upload-box,
.option-box,
.action-box,
.progress-box,
.download-box {
  margin-bottom: 15px;
}

.option-box label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  border-radius:10px;
  background:#eee;
}

.progress-container {
      margin-top:15px;
      width:100%;
      height:20px;
      background:#eee;
      border-radius:10px;
      overflow:hidden;
    }

.progress-bar {
  height:20px;
  width:0%;
  background:#4caf50;
  transition: width 0.3s;
}
.status {
  margin-top:10px;
  color:#555;
  font-size:14px;}