/* CAD 图纸翻译系统 - 基础样式（浅色主题） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f2f4f8;
  color: #24292f;
  font-size: 14px;
  line-height: 1.6;
}
a { color: #1a66d6; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 130px); }

/* 顶栏 */
.topbar { background: #1f2d3d; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.topbar-in { display: flex; align-items: center; height: 54px; gap: 24px; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a { color: #cfd8e3; padding: 6px 14px; border-radius: 6px; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: rgba(255,255,255,.15); }
.userbox { display: flex; align-items: center; gap: 12px; }
.userbox .muted { color: #9fb0c3; }

/* 汉堡按钮（默认隐藏，手机显示） */
.nav-toggle { display: none; width: 40px; height: 40px; border: none; background: transparent; color: #cfd8e3;
  border-radius: 8px; cursor: pointer; align-items: center; justify-content: center; padding: 0; transition: background .15s, color .15s; }
.nav-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-toggle .ic-x { display: none; }
.topbar.open .nav-toggle .ic-bars { display: none; }
.topbar.open .nav-toggle .ic-x { display: block; }

/* 平板：收紧间距，品牌省略，隐藏用户名文字仅留按钮 */
@media (max-width: 820px) {
  .topbar-in { gap: 12px; height: 50px; }
  .brand { font-size: 15px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .userbox { gap: 8px; }
  .userbox .muted { display: none; }
}

/* 手机：汉堡折叠菜单 */
@media (max-width: 640px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding: 0; gap: 0; }
  .brand { flex: 1; min-width: 0; max-width: none; padding: 13px 16px; font-size: 15px; }
  .nav-toggle { display: inline-flex; margin-right: 8px; }
  .nav, .userbox { display: none; width: 100%; }
  .nav { flex-direction: column; gap: 2px; padding: 4px 10px 8px; }
  .nav a { padding: 12px 14px; border-radius: 10px; font-size: 15px; }
  .nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
  .nav a.on { background: rgba(26,102,214,.32); color: #fff; }
  .userbox { align-items: stretch; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid rgba(255,255,255,.1); }
  .userbox .muted { display: block; font-size: 12px; padding: 2px 2px 4px; }
  .userbox .btn { flex: 1; text-align: center; padding: 10px; font-size: 14px; }
  .topbar.open .nav, .topbar.open .userbox { display: flex; }
  .topbar.open { box-shadow: 0 6px 20px rgba(0,0,0,.25); }
}



.footer { text-align: center; color: #8a94a6; padding: 18px 0; font-size: 12px; }

/* 卡片 */
.card {
  background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card h3 { font-size: 15px; margin-bottom: 12px; color: #1f2d3d; }

/* 页面标题 */
.page-title { font-size: 20px; margin: 4px 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; color: #374151; }
.field input[type=text], .field input[type=password], .field input:not([type]), .field select, .field textarea,
.inline-form input[type=text] {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d9e0; border-radius: 6px;
  font-size: 14px; background: #fff; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bcd7ff; border-color: #1a66d6; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; margin-bottom: 6px; cursor: pointer; }
.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 24px; }
@media (max-width: 800px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px; border: 1px solid #d1d9e0;
  background: #fff; color: #24292f; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn:hover { background: #f0f4f9; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #1a66d6; border-color: #1a66d6; color: #fff; }
.btn-primary:hover { background: #1558b8; }
.btn-ok { background: #1a7f4e; border-color: #1a7f4e; color: #fff; }
.btn-ok:hover { background: #166b41; }
.btn-danger { color: #c0392b; border-color: #e5b4ae; }
.btn-danger:hover { background: #fdf0ee; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-ok { background: #e9f7ef; color: #176b3a; border: 1px solid #bfe5cd; }
.alert-err { background: #fdeeec; color: #a4271a; border: 1px solid #f2c6bf; }
.alert-warn { background: #fff7e0; color: #8a6100; border: 1px solid #f0dfa4; }
.muted { color: #8a94a6; }
.small { font-size: 12px; }

/* 标签 */
.tag { display: inline-block; padding: 1px 10px; border-radius: 20px; font-size: 12px; background: #e9edf3; color: #4b5563; }
.tag-ok { background: #e0f2e9; color: #176b3a; }
.tag-err { background: #fde8e5; color: #a4271a; }
.tag-warn { background: #fff3d6; color: #8a6100; }
.tag-info { background: #e3edff; color: #1a4fbb; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: #6b7484; font-weight: 600; background: #f8fafc; }
.table tr:last-child td { border-bottom: none; }
.ops { white-space: nowrap; }
code { background: #f0f3f7; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* 登录 */
.login-box { max-width: 380px; margin: 70px auto; }
.login-title { font-size: 20px; margin-bottom: 4px; }

/* 任务页 */
.job-bar { position: sticky; top: 0; z-index: 10; }
.job-stats { display: flex; gap: 34px; margin-bottom: 12px; flex-wrap: wrap; }
.job-stats b { font-size: 22px; display: block; color: #1f2d3d; }
.job-stats span { font-size: 12px; color: #8a94a6; }
.progress { height: 8px; background: #e9edf3; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.progress-in { height: 100%; background: linear-gradient(90deg, #1a66d6, #4a9eff); transition: width .3s; }
.progress-label { margin-bottom: 12px; }
.texts-table textarea { width: 100%; border: 1px solid #e0e5ec; border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.texts-table textarea:focus { outline: 2px solid #bcd7ff; border-color: #1a66d6; }
.texts-table textarea.prot { background: #f6f7f9; color: #8a94a6; }
.texts-table .orig { font-size: 13px; word-break: break-all; }
.row-done { background: #fbfdfb; }
.row-prot td { color: #9aa4b1; }
.row-todo textarea { background: #fffdf5; }
.st { white-space: nowrap; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { text-align: center; padding: 18px 10px; }
.stat b { font-size: 26px; display: block; color: #1f2d3d; }
.stat span { color: #8a94a6; font-size: 12px; }

/* 后台导航 */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.admin-nav a { padding: 7px 16px; border-radius: 8px; background: #fff; border: 1px solid #e3e8ef; color: #4b5563; }
.admin-nav a:hover { text-decoration: none; background: #f0f4f9; }
.admin-nav a.on { background: #1f2d3d; color: #fff; border-color: #1f2d3d; }

/* 分页 */
.pager { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }
.pager a, .pager b { padding: 4px 12px; border-radius: 6px; background: #f0f3f7; }
.pager b { background: #1a66d6; color: #fff; }

/* 流程提示 */
.tips ol { padding-left: 20px; margin: 8px 0; }
.tips li { margin-bottom: 4px; }

/* ===== 图纸翻译页（现代化） ===== */
.t-hero { text-align: center; padding: 26px 20px 18px; }
.t-hero h1 { font-size: 26px; font-weight: 700; color: #1f2d3d; letter-spacing: .5px; }
.t-hero p { color: #6b7484; margin-top: 8px; font-size: 14px; }
.t-wrap { max-width: 860px; margin: 0 auto; }

/* 模式切换（CAD / 文档） */
.mode-tabs { display: inline-flex; gap: 4px; background: #f1f3f7; border: 1px solid #e3e8ef; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.mode-tab { border: none; background: transparent; color: #6b7484; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.mode-tab:hover { color: #1f2d3d; }
.mode-tab.on { background: #fff; color: #1a66d6; box-shadow: 0 1px 3px rgba(16,24,40,.12); }

.t-card {
  background: #fff; border: 1px solid #e6eaf0; border-radius: 16px;
  padding: 24px; box-shadow: 0 10px 34px rgba(16,24,40,.08); margin-bottom: 18px;
}

/* 语言对 + 交换 */
.langbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.langbar .lfield { flex: 1; }
.langbar .lfield label {
  display: block; font-size: 11px; font-weight: 700; color: #98a2b3;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.langbar select {
  width: 100%; padding: 11px 38px 11px 14px; border: 1px solid #dde3ec; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: #1f2d3d; background: #fff; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667080' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.langbar select:focus, .t-field select:focus {
  outline: none; border-color: #1a66d6; box-shadow: 0 0 0 3px rgba(26,102,214,.15);
}
.lang-swap {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid #dde3ec; background: #fff; cursor: pointer; color: #1a66d6;
  display: flex; align-items: center; justify-content: center; transition: transform .25s, background .15s, color .15s;
}
.lang-swap:hover { background: #eef4ff; transform: rotate(180deg); }
.lang-swap:focus { outline: none; border-color: #1a66d6; box-shadow: 0 0 0 3px rgba(26,102,214,.15); }
.lang-swap.is-disabled { opacity: .45; cursor: not-allowed; }
.lang-swap.is-disabled:hover { background: #fff; transform: none; }

/* 拖放区 */
.dropzone {
  position: relative; border: 2px dashed #c8d2e0; border-radius: 14px; padding: 30px 20px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  background: #fafbfc; margin-bottom: 18px; outline: none;
}
.dropzone:hover, .dropzone.drag { border-color: #1a66d6; background: #eef4ff; }
.dropzone.drag { border-style: solid; }
.dropzone input[type=file] { display: none; }
.dz-icon { color: #1a66d6; display: block; margin: 0 auto 8px; }
.dz-title { font-size: 15px; font-weight: 600; color: #1f2d3d; }
.dz-title .dz-link { color: #1a66d6; }
.dz-sub { font-size: 12px; color: #98a2b3; margin-top: 4px; }
.dz-picked { display: none; }
.dz-picked .dz-file { display: block; font-size: 15px; font-weight: 700; color: #176b3a; word-break: break-all; }
.dz-picked .dz-icon { color: #1a7f4e; }
.dz-reset {
  display: inline-block; margin-top: 8px; font-size: 12px; color: #1a66d6;
  background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0;
}
.dz-err { color: #a4271a; margin-top: 6px; }
.dropzone.has-file { border-color: #1a7f4e; background: #f0fbf4; border-style: solid; }
.dropzone.has-file .dz-default { display: none; }
.dropzone.has-file .dz-picked { display: block; }

/* 模型 + 选项行 */
.t-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.t-field label { display: block; font-size: 12px; font-weight: 700; color: #6b7484; margin-bottom: 6px; }
.t-field select {
  width: 100%; padding: 10px 12px; border: 1px solid #dde3ec; border-radius: 8px;
  font-size: 14px; background: #fff; color: #1f2d3d; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.t-field-hint { margin-top: 5px; }
.opts {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 14px;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 10px;
}
.opts .check { margin: 0; font-weight: 500 !important; font-size: 13px; color: #374151; }

/* 主操作 */
.t-foot { display: flex; align-items: center; gap: 14px; }
.t-foot .btn-primary {
  flex: 1; padding: 12px 18px; font-size: 15px; font-weight: 600; border-radius: 10px;
}
.t-usage { font-size: 12px; color: #98a2b3; white-space: nowrap; }
.t-usage b { color: #4b5563; }

/* 流程小提示条 */
.t-hints { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; color: #9aa4b1; font-size: 12px; padding: 4px 0 10px; }
.t-hints b { color: #6b7484; }

@media (max-width: 720px) {
  .t-row { grid-template-columns: 1fr; }
  .t-foot { flex-direction: column; align-items: stretch; }
  .t-usage { text-align: center; white-space: normal; }
  .langbar .lfield { min-width: 0; }
}
