body {
    background: #f1f5f9;
    font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    margin: 0;
    padding: 0;
}

.main-wrapper {
  display: grid;
  grid-template-columns: 1fr min(92vw, 700px) 1fr; /* 中间列最小 500px，最大 700px，自适应变化 */
  justify-items: center;               /* 中间那列的内容始终居中 */
  margin-top: 40px;
  position: relative;
}
/* 主体始终居中 */
.container {
  width: 90%;            /* 占满可用空间 */
  grid-column: 2; /* 放在中间列 */
  padding: 36px;
  background: #fff;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/*
.container {
    max-width: 600px;
    margin: 60px auto 16px;
    padding: 36px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}
*/


/* 顶部 header 区域 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #a0c4e0;
    padding: 10px;
    border-radius: 6px 6px 0 0;
    margin: -36px -36px 36px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1d3557;
    margin: 16px 0 16px;
}

.header-icon {
    width: 50px;        /* 调整为你想要的宽度 */
    height: 50px;       /* 调整为你想要的高度 */
    vertical-align: middle;
}

.lang-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid #c4d2df;
}

.lang-block {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1d3557;
    font-size: 16px;
    font-weight: 600;
}

/* 控制每个下拉框宽度 */
.lang-block select {
    width: auto; /* 你想让 lang-select 更短，调整这个值 */
    border: none;
    background: transparent;
    font-size: 16px;
    padding: 4px 20px 4px 6px;
    outline: none;
    color: #1d3557;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231d3557' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
    padding-right: 1.2rem;
}


.upload-area {
    border: 2px dashed #c4d2df;
    padding: 40px 30px;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: #eef6fd;
    border-color: #90cdf4;
}

.exceed-area {
    border: 2px dashed #c4d2df;
    padding: 40px 30px;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

#placeholder-exceed a {
  color: #1e64ba;
  text-decoration: underline;
}

.add-file-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-bottom: 12px;
    opacity: 0.85;
}

.note {
    font-size: 13px;
    color: #888;
}

.file-card {
    background: #f1f1f1;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    justify-content: flex-start;
    min-width: 0;  /* 允许子元素收缩！ */
}

.file-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#file-name {
    font-size: 15px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: calc(100% - 40px); /* 避开右侧按钮 */
    vertical-align: middle;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #888;
    cursor: pointer;
}

.translate-wrapper {
    display: flex;
    justify-content: right;
    margin-top: 25px;
}

.translate-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    background-color: #5a92e0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.translate-btn:hover {
    background-color: #1e64ba;
}

.status-msg {
    margin-top: 16px;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    display: none;
    text-align: left;
    word-break: break-word; /* 支持长词自动换行 */
    white-space: pre-wrap;  /* 保留换行，自动扩展高度 */
    overflow-wrap: break-word;
    overflow: auto;
}

/* 成功样式 */
.status-success {
    background-color: #e6f4ea;
    color: #1e4620;
    border: 1px solid #b4d7c5;
}

/* 错误样式（可选） */
.status-error {
    background-color: #fcebea;
    color: #611a15;
    border: 1px solid #f5c6cb;
}

/* loading 小圈圈 */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid #ccc;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#confirm-dialog {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#confirm-dialog .modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  padding: 20px 24px;
  width: 320px;
  font-size: 15px;
  color: #000;
}

#confirm-dialog .modal-content p {
  margin: 0 0 20px 0;
}

.button-group {
  text-align: right;
}

.button-group button {
  min-width: 72px;
  padding: 6px 16px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-left: 12px;
  transition: all 0.2s ease-in-out;
}

/* 确定按钮 */
.btn-primary {
  background-color: #0067c0;
  color: white;
}

.btn-primary:hover {
  background-color: #0057a0;
}

/* 取消按钮 */
.btn-secondary {
  background-color: #f3f3f3;
  color: #111;
}

.btn-secondary:hover {
  background-color: #e2e2e2;
}

.bottom-tip-inside {
  text-align: right;
  font-size: 11px;
  color: #666;
}

.bottom-tip-inside a {
  color: #1e64ba;
  text-decoration: underline;
}

.highlight {
  background-color: #0067c0;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 3px;
}


/* 历史下载区固定在 container 右边 */
.history-box {
  grid-column: 3;            /* 放在右侧列 */
  justify-self: start;   /* 覆盖全局的居中，贴列左边！ */
  align-self: start;         /* 顶端对齐 */
  margin-left: 5px;         /* 与主体保持间距 */
  padding: 12px 16px;
  background: #fafcff;
  border: 1px solid #e1e6ec;
  border-radius: 6px;
  text-align: left;
  width: auto;               /* 宽度随内容 */
  white-space: nowrap;       /* 文件名不换行，撑开宽度 */
  overflow-x: auto;          /* 超出可横向滚动 */
}

/* 小屏回落 */
@media (max-width: 960px) {
  .main-wrapper {
    grid-template-columns: 1fr min(96vw, 700px) 1fr;
  }
  .history-box {
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
    margin: 16px 0 0 0;
    white-space: normal;  /* 允许换行避免横向滚动 */
    overflow-x: visible;
  }
}
/* 标题紧凑一点 */
.history-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  color: #1d3557;             /* ✅ 与主体文字色保持一致 */
}

/* 列表紧凑排列 */
.history-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;                   /* 紧凑间距 */
}

/* 文件名链接 */
.history-list li a {
  text-decoration: none;
  color: #1e64ba;             /* ✅ 用你主体按钮的蓝色 */
  font-size: 12px;
}

.history-list li a:hover {
  text-decoration: underline;
  color: #0057a0;             /* hover 时颜色更深，和按钮 hover 呼应 */
}
