* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #172026;
  background: #f4f7f8;
}
a { color: #0b7285; text-decoration: none; }
.topbar {
  min-height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #10191e;
  color: #eef6f7;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.topbar a { color: #bfeaf0; }
.page {
  padding: 22px;
  display: grid;
  gap: 18px;
}
.panel, .login-box {
  background: #fff;
  border: 1px solid #d8e0e5;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(20, 38, 48, 0.08);
}
.panel { padding: 18px; overflow: auto; }
.login-box {
  width: min(420px, calc(100vw - 44px));
  margin: 70px auto;
  padding: 26px;
}
h1, h2 { margin: 0 0 16px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
form { display: grid; gap: 12px; }
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #52616a;
}
input, select, button {
  min-height: 40px;
  border-radius: 8px;
  font: inherit;
}
input, select {
  width: 100%;
  border: 1px solid #cbd6dc;
  padding: 8px 10px;
  background: #fff;
}
button {
  border: 0;
  background: #0b7f8f;
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}
button:disabled { opacity: 0.55; cursor: wait; }
.muted { color: #65717a; font-size: 13px; line-height: 1.6; }
.alert {
  padding: 10px 12px;
  border-left: 4px solid #b42318;
  background: #fff4f2;
  color: #8a1f17;
  margin-bottom: 12px;
}
.tool-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}
.controls { align-self: start; }
.crop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metrics div {
  border: 1px solid #d8e0e5;
  border-radius: 8px;
  padding: 13px;
  background: #f9fbfc;
}
.metrics b {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}
.metrics span { color: #65717a; font-size: 13px; }
.preview {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: #20282e;
  border-radius: 8px;
  overflow: auto;
  padding: 12px;
}
.preview img {
  max-width: 100%;
  height: auto;
  display: none;
}
.tips {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #0b7f8f;
  background: #eefafb;
  line-height: 1.6;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f3;
  text-align: left;
  white-space: nowrap;
}
th { color: #52616a; background: #f9fbfc; }
.table-scroll { max-height: 320px; overflow: auto; }
.empty { text-align: center; color: #8b98a0; }
.admin-grid { display: grid; gap: 18px; }
.inline-form {
  grid-template-columns: 1fr 1fr 140px auto;
  align-items: center;
  margin-bottom: 16px;
}
.settings-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  align-items: end;
}
.settings-form button { align-self: end; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.checkbox input {
  width: auto;
  min-height: auto;
}
td form { display: inline; }
td button { min-height: 32px; font-size: 12px; padding: 0 10px; }
@media (max-width: 900px) {
  .tool-grid, .metrics, .inline-form, .settings-form { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 18px; }
  .topbar nav { flex-wrap: wrap; }
}
