/* 采购工作台样式：登录页与首页共用。
   项目未安装 Sass 编译器，本文件与 static/scss/app.scss 内容等价。 */

:root {
  --page: #f3f5f8;
  --ink: #1e2836;
  --muted: #5b6677;
  --border: #dce1e8;
  --rail: #202a39;
  --blue: #1759bf;
  --danger: #a21d15;
  font: 15px/1.5 Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #3b72c5; outline-offset: 3px; }

/* 登录页 */
.login-page {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 1fr);
  min-height: 100vh;
}
.login-brand {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 32px;
  background: var(--rail);
  color: white;
}
.login-brand h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.35; font-weight: 600; }
.login-content { display: grid; place-items: center; padding: 48px; }
.login-card {
  display: grid;
  gap: 8px;
  width: min(100%, 460px);
  padding: 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 36px rgb(32 42 57 / 6%);
}
.login-eyebrow { color: var(--blue); font-size: 13px; font-weight: 600; text-align: center; }
.login-card h2 { text-align: center; font-size: 28px; font-weight: 600; }
.login-description { margin-bottom: 20px; color: var(--muted); font-size: 14px; text-align: center; }
.login-card label { font-size: 14px; font-weight: 600; }
.login-card input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #c6ced9;
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
}
.login-card input:hover { background: white; }
.login-action {
  min-height: 46px;
  margin-top: 12px;
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.login-action:hover { background: #10499f; }
.login-status { min-height: 1.2em; color: var(--danger); font-size: 13px; text-align: center; }

/* 首页 */
.skip-link { position: absolute; left: 12px; top: -100px; padding: 8px; background: white; color: var(--blue); }
.skip-link:focus { top: 8px; z-index: 1; }
.workbench { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 23px 16px; background: var(--rail); color: white; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { border-radius: 6px; }
.brand strong { display: block; font-size: 17px; }
.brand small, .sidebar-label { color: #c6d1e0; font-size: 13px; }
.sidebar-label { margin: 24px 0 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: #edf3fb; border-radius: 5px; }
.sidebar nav a:hover, .sidebar nav a:focus-visible { background: #34465e; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 26px;
  border-bottom: 1px solid var(--border);
  background: white;
}
.home { max-width: 1280px; margin: 0 auto; padding: 24px 26px 32px; }
.home h1 { font-size: 30px; line-height: 1.25; }
.home-note { margin-top: 6px; color: var(--muted); }
.home :target, .home:target { scroll-margin-top: 12px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.cards article, .panel { border: 1px solid var(--border); border-radius: 7px; background: white; }
.cards article { padding: 12px 16px; }
.cards h2 { font-size: 14px; color: var(--muted); }
.cards strong { display: block; font-size: 28px; line-height: 1.3; }
.cards a { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); text-underline-offset: 3px; }
.panel { margin-bottom: 14px; }
.panel h2 { padding: 10px 15px; font-size: 17px; }
.panel table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.panel th, .panel td { padding: 8px 15px; border-top: 1px solid var(--border); color: var(--muted); }
.panel th { background: #f6f8fa; }
.models-form { display: grid; gap: 8px; padding: 0 15px 12px; justify-items: start; }
.models-form label { font-weight: 600; }
.models-form textarea {
  width: 100%;
  min-height: 5em;
  padding: 8px 12px;
  resize: vertical;
  border: 1px solid #c6ced9;
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--ink);
  font: inherit;
}
.models-help, .watch-note { color: var(--muted); font-size: 14px; }
.models-notice, .models-error { font-weight: 600; }
.models-error { color: var(--danger); }
.watch-note { padding: 0 15px 10px; }
:is(.watch-table, .order-table) :is(th, td) { overflow-wrap: anywhere; vertical-align: top; }
:is(.watch-row, .order-row) th { color: var(--ink); background: transparent; }
.watch-label, .order-label { display: none; }
.primary {
  min-height: 44px;
  padding: 0 14px;
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-weight: 650;
  cursor: pointer;
}
.primary:hover { background: #10499f; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { min-height: 200px; padding: 24px; }
  .login-content { padding: 32px 24px; }
  .workbench { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { padding: 11px 14px; }
  .sidebar-label { display: none; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
}
@media (max-width: 700px) {
  .topbar, .home { padding-inline: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cards article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; }
  .cards a { grid-column: 1 / -1; }
  /* 视觉上收起列头，快照行使用字段标签；保留表格语义。 */
  .panel thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .watch-table, .order-table, :is(.watch-table, .order-table) tbody { display: block; }
  :is(.watch-table, .order-table) tbody tr { display: grid; border-top: 1px solid var(--border); }
  .watch-row, .order-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.watch-table, .order-table) tbody :is(th, td) { display: block; border-top: 0; }
  :is(.watch-table, .order-table) tbody th { grid-column: 1 / -1; }
  .watch-label, .order-label { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
}
@media (max-width: 480px) {
  .login-brand { min-height: 160px; }
  .login-brand h1 { font-size: 24px; }
  .login-content { align-items: start; padding: 24px 16px 32px; }
  .login-card { padding: 28px 22px; }
}
