/* Shared screen styles. Printed field logs and weekly reports have their own layout. */
:root {
  color-scheme: light;
  --ink: #172521;
  --muted: #52665e;
  --green: #00734f;
  --mint: #e0f4e9;
  --line: #dce6e0;
  --canvas: #f2f6f4;
  --surface: #fff;
  --card: 22px;
  --shadow: 0 3px 14px rgba(29, 58, 45, .035);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
  min-height: 100vh;
  background: radial-gradient(ellipse 80% 320px at 76% 0%, #deeee6 0%, transparent 85%) no-repeat, var(--canvas);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea, #preview { font-family: var(--font); }
:focus-visible { outline: 3px solid #118561; outline-offset: 3px; }
a { color: var(--green); }
button, #openWechat {
  color: var(--ink);
  background: white;
  border: 1px solid #d7e1db;
  border-radius: 100px;
  font-weight: 550;
  transition: background .15s, border-color .15s;
}
button:hover:not(:disabled), #openWechat:hover { background: #eff6f1; border-color: #a7b9ae; }
button.primary, .map-action button[aria-pressed=true] {
  color: white;
  background: var(--green);
  border-color: var(--green);
}
button.primary:hover:not(:disabled) { background: #005c3f; border-color: #005c3f; }
input:not([type=checkbox]):not([type=radio]), textarea, select,
.weekly-page input, .weekly-page select, .report-page select {
  border-radius: 11px;
  border-color: #cad7cf;
  color: var(--ink);
  box-shadow: none;
  max-width: 100%;
}
input[type=checkbox], progress { accent-color: var(--green); }
input[type=file]::file-selector-button {
  font: inherit; color: #235640; background: #edf6ef;
  border: 0; border-radius: 6px; padding: 4px 8px; margin-right: 8px;
}
.muted, .map-foot, footer { color: var(--muted); }
.site-header {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  padding: 14px clamp(20px, 4vw, 70px);
  min-height: 72px;
  gap: 18px;
  background: #ffffffda;
  border-bottom: 1px solid #dce7e0;
}
.brand-link, .login-brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink); width: fit-content; text-decoration: none;
}
.brand-link:hover { text-decoration: none; }
.wordmark { display: flex; gap: 6px; align-items: baseline; font-size: 19px; line-height: 1; font-weight: 680; letter-spacing: -.8px; }
.wordmark > span { color: #60746b; font-weight: 420; }
.app-mark {
  position: relative; width: 33px; height: 33px; flex: none; overflow: hidden;
  border-radius: 11px; background: linear-gradient(145deg, #008258, #064a3b);
}
.app-mark::before, .app-mark::after, .app-mark i {
  content: ""; position: absolute; left: 6px; width: 19px; height: 10px;
  border: 1.3px solid #c3f5d9; border-radius: 65% 44% 60% 38%; transform: rotate(-13deg);
}
.app-mark::before { top: 8px; }.app-mark i { top: 11.5px; }.app-mark::after { top: 15px; }
.app-nav { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid #e1e8e3; background: #edf2ef; border-radius: 100px; }
.app-nav a {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 100px; padding: 7px 14px; color: #455a50; white-space: nowrap;
  font-weight: 550; font-size: 13px; text-decoration: none;
}
.app-nav a:hover { background: #e2ebe5; }
.app-nav a[aria-current=page] { color: #005c40; background: #fff; box-shadow: 0 1px 5px #2146321c; }
.nav-short { display: none; }
.site-header .header-actions { justify-self: end; flex-wrap: nowrap; gap: 10px; }
#who:not(:empty) { display: inline-flex; align-items: center; gap: 6px; color: #495e54; font-weight: 540; overflow-wrap: anywhere; }
#who:not(:empty)::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #07855c; }
#logout { font-size: 12px; padding: 5px 11px; }
body:has(#app[hidden]) .app-nav { visibility: hidden; }
#gate { width: fit-content; max-width: calc(100% - 28px); margin: 12vh auto; padding: 28px 44px; background: white; border: 1px solid var(--line); border-radius: var(--card); }
.hero { align-items: center; gap: 20px; margin: 0 0 26px; }
.hero > div { min-width: 0; }
.hero h1, .login-heading h1 { color: var(--ink); letter-spacing: -.055em; line-height: 1.18; font-weight: 650; }
.hero h1 { margin: 0 0 10px; font-size: clamp(29px, 2.7vw, 42px); }
.hero p { font-size: 14px; line-height: 1.6; }
.hero > button { flex: none; }
.panel, .library-sidebar, .stats > div {
  border: 1px solid var(--line); border-radius: var(--card); background: var(--surface); box-shadow: var(--shadow);
}
.panel h2, .panel-top strong, .library-sidebar h2 { color: var(--ink); font-size: 17px; line-height: 1.4; font-weight: 640; letter-spacing: -.035em; }
.panel-top, .report-page .panel-top { padding: 17px 20px; }
.board .panel-top { padding: 19px 20px 10px; }
.upload-panel, .daily-form, .daily-points, .daily-save, .flight-page .section, .destination { padding: 21px; }
.map-buttons button { min-width: 32px; min-height: 30px; }
.map-foot { align-items: center; }
.info, .blocks, .manual { border-radius: 12px; }
.table-wrap, .job-list { overscroll-behavior-x: contain; }
th { background: #f4f7f5; color: #52645c; }
.library-layout {
  max-width: 1580px; margin: 0 auto; padding: 32px clamp(16px, 3.2vw, 54px);
  display: grid; grid-template-columns: 200px minmax(0,1fr); align-items: start; gap: 26px;
}
.library-layout article { padding: 0; }
.library-sidebar { margin-top: 1px; padding: 20px 12px 10px; }
.library-sidebar h2 { margin: 0 9px 16px; }
.layer { min-height: 42px; border-radius: 12px; width: 100%; background: transparent; }
.layer.active, .layer.active:hover { background: var(--mint); color: #005a3e; }
.aside-note { padding: 6px 9px; font-size: 12px; line-height: 1.65; }
.daily-page, .flight-page, .weekly-page, .production-page, .report-page {
  width: 100%; padding: 32px clamp(16px, 3.2vw, 54px) 36px; margin: 0 auto;
}
.production-page, .weekly-page { max-width: 1360px; }.report-page { max-width: 1240px; }
.stats { gap: 14px; margin-bottom: 22px; }
.stats > div { padding: 18px 22px; }
.stats span { color: var(--muted); font-weight: 525; }
.stats strong, .rate strong, .coverage dd { font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.stats strong { font-size: clamp(29px, 3vw, 44px); line-height: 1.1; margin-top: 10px; color: var(--ink); }
.stats > div:first-child { background: #dcf1e3; border-color: #c5e5d2; }
.stats > div:first-child strong { color: #005b3e; }
.stats .alert-stat strong, .coverage div:nth-child(2) dd { color: #92501e; }
.label, .chip { border-radius: 100px; }
.production-page .filters { padding: 4px 20px 16px; }
.board-foot { background: #f9fbfa; }
dialog { border: 1px solid #cedcd3; border-radius: 22px; padding: 23px; }
dialog::backdrop { background: #172c2266; }
.metrics .rate { color: var(--green); }
.metrics .rate strong { font-size: 42px; }
.message-sheet { background: #e9f3ee; border-color: #d6e6dc; border-radius: 16px; padding: 17px; }
.avatar { border-radius: 10px; background: var(--green); }
#preview { border: 1px solid #dce7df; border-radius: 5px 16px 16px; }
.buttons { margin-top: 18px; }.buttons #openWechat { border-radius: 100px; }
.manual { background: #f1f6f3; }
.login {
  padding: 38px 22px; min-height: 100vh; min-height: 100svh;
  background: radial-gradient(ellipse at 80% 15%, #dfefe6, transparent 56%), linear-gradient(135deg, #f8faf9, #eef4f0);
}
.login-card {
  width: min(960px, 100%); display: grid; grid-template-columns: 46% 54%;
  overflow: hidden; padding: 0; border: 1px solid #d7e3db; border-radius: 30px;
  box-shadow: 0 24px 64px -30px #25483842; background: #fff;
}
.login-form-pane { padding: clamp(30px, 4.1vw, 57px); }
.login-heading { margin: 47px 0 29px; }
.login-heading h1 { margin: 0; font-size: clamp(29px, 3.2vw, 40px); }
.login-card .login-heading p { color: var(--muted); margin: 9px 0 0; font-size: 14px; }
.login-card label { margin: 15px 0 6px; color: #394b42; font-weight: 570; }
.login-card input { min-height: 46px; margin: 0; background: #fafcfb; }
.login-card .primary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin-top: 24px; }
.login-card .primary span { font-size: 17px; line-height: 1; }
.login-card small { display: block; color: #61766a; margin-top: 22px; font-size: 12px; }
#loginError:empty { display: none; }
.login-art { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #e8f2ed; }
.login-art img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 1040px) {
  .site-header { gap: 12px; padding-inline: 20px; }
  .app-nav a { padding-inline: 10px; }
  .library-layout { grid-template-columns: 168px minmax(0,1fr); gap: 16px; }
}
@media (max-width: 840px) {
  .site-header { display: flex; justify-content: space-between; min-height: 58px; padding: 12px 18px; }
  .app-nav {
    position: fixed; z-index: 10; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(6, 1fr); width: min(490px, calc(100% - 20px)); gap: 0;
    padding: 4px; background: #fffffff2; backdrop-filter: blur(14px);
    box-shadow: 0 4px 24px #1e3b292a; border: 1px solid #d6e3da;
  }
  .app-nav a { min-height: 44px; font-size: 13px; padding: 4px 1px; }
  .app-nav a[aria-current=page] { color: #fff; background: var(--green); box-shadow: none; }
  .nav-full { display: none; }.nav-short { display: inline; }
  body:has(#app:not([hidden])) { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .library-layout { display: block; padding: 14px 14px 20px; }
  .library-sidebar { padding: 5px; border-radius: 16px; margin: 0 0 21px; }
  .library-sidebar h2, .library-sidebar .aside-note { display: none; }
  #layers { display: flex; align-items: center; overflow-x: auto; padding: 2px; gap: 2px; }
  #layers .layer { width: auto; flex: none; min-height: 36px; font-size: 13px; padding: 6px 12px; }
  .layer span:last-child { display: none; }
  .hero { gap: 12px; margin-bottom: 18px; }
  .hero h1 { margin-bottom: 7px; }.hero p { font-size: 13px; }
  .daily-page, .flight-page, .weekly-page, .production-page, .report-page { padding: 22px 14px; }
}
@media (max-width: 620px) {
  :root { --card: 17px; }
  .site-header .wordmark, .login-brand .wordmark { font-size: 18px; }
  .hero h1 { font-size: 29px; }
  .hero button { font-size: 13px; padding: 8px 12px; }
  .panel-top, .report-page .panel-top { padding: 14px 15px; }
  .upload-panel, .daily-form, .daily-points, .daily-save, .flight-page .section, .destination { padding: 15px; }
  .stats { gap: 8px; margin-bottom: 15px; }.stats > div { padding: 13px 16px; }
  .stats strong { font-size: 30px; }.stats span { font-size: 12px; }
  .board .panel-top, .production-page .filters { padding-inline: 15px; }
  .message-sheet { margin-inline: 12px; padding: 12px; }
  .login { padding: 18px; }
  .login-card { width: min(420px, 100%); display: flex; flex-direction: column; border-radius: 24px; }
  .login-art { order: -1; height: clamp(105px, 22svh, 190px); }
  .destination h2 { display: block; }
  .login-form-pane { padding: 24px; }
  .login-heading { margin: 23px 0 19px; }.login-card small { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
