body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

/* 星空粒子登录页（高级版） */
.star-login-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(59, 130, 246, 0.20), transparent 60%),
    radial-gradient(1200px 600px at 80% 90%, rgba(168, 85, 247, 0.18), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #060913 100%);
}

.star-large-header {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.star-large-header canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.star-login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.star-login-card {
  width: min(420px, 100%);
  border-radius: 18px;
  padding: 28px 26px 22px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.star-login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.star-login-title {
  color: rgba(255, 255, 255, 0.96);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
}

.star-login-subtitle {
  margin-top: 6px;
  color: rgba(226, 232, 240, 0.86);
  font-size: 14px;
}

.star-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.star-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, 100%);
}

.star-label {
  color: rgba(226, 232, 240, 0.85);
  font-size: 13px;
}

.star-login-form input[type="text"],
.star-login-form input[type="password"] {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.35);
  color: rgba(255, 255, 255, 0.95);
  outline: none;
  transition: box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.star-login-form input::placeholder {
  color: rgba(203, 213, 225, 0.55);
}

.star-login-form input:focus {
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.20);
  background: rgba(2, 6, 23, 0.45);
}

.star-login-btn {
  margin-top: 6px;
  width: min(320px, 100%);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.9);
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.star-login-btn:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.star-login-message {
  margin: 0;
  min-height: 1.2em;
  text-align: center;
  color: #fecaca;
  font-size: 13px;
}

.container {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

.sidebar {
  position: sticky;
  top: 16px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-area {
  min-width: 0;
}

.narrow {
  max-width: 520px;
}

h1 {
  margin-bottom: 8px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background:
    radial-gradient(900px 420px at 20% 25%, rgba(59, 130, 246, 0.35), transparent 60%),
    radial-gradient(900px 420px at 85% 70%, rgba(37, 99, 235, 0.30), transparent 65%),
    linear-gradient(180deg, #eaf2ff 0%, #f4f6f8 55%, #f4f6f8 100%);
}

.login-shell {
  width: min(980px, 100%);
}

.login-panel {
  position: relative;
  min-height: 520px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.login-panel-bg {
  background:
    radial-gradient(900px 420px at 12% 30%, rgba(255, 255, 255, 0.25), transparent 55%),
    linear-gradient(135deg, rgba(59, 130, 246, 0.38) 0%, rgba(37, 99, 235, 0.22) 55%, rgba(29, 78, 216, 0.18) 100%),
    url("/static/login-hero.png");
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
}

.login-form-overlay {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  padding: 38px 34px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(226, 232, 240, 0.9);
}

.login-form {
  gap: 14px;
}

.login-form label {
  gap: 8px;
}

.login-form button[type="submit"] {
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
}

.login-subtitle {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.login-brand h1 {
  margin: 0 0 6px 0;
  font-size: 28px;
  letter-spacing: 1px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  text-align: left;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  outline: none;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25);
}

.login-form button[type="submit"] {
  margin-top: 8px;
  align-self: stretch;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.login-form button[type="submit"]:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.login-message {
  margin-top: 12px;
  text-align: center;
  min-height: 1.2em;
  color: #b91c1c;
  font-size: 14px;
}

@media (max-width: 900px) {
  .login-panel {
    min-height: auto;
  }
  .login-panel-bg {
    background-position: center;
  }
  .login-form-overlay {
    position: static;
    width: 100%;
    padding: 26px 20px;
    border-left: 0;
    background: rgba(255, 255, 255, 0.96);
  }
}

.desc {
  margin-top: 0;
  color: #4b5563;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.wrap {
  flex-wrap: wrap;
}

button {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

button:hover {
  background: #f9fafb;
}

.menu-btn {
  text-align: left;
}

.menu-btn.active {
  background: #e8f0ff;
  border-color: #9db6f7;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn.active {
  background: #e8f0ff;
  border-color: #9db6f7;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.span-2 {
  grid-column: span 2;
}

.section-title {
  font-weight: 600;
  margin-top: 6px;
}

@media (max-width: 960px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }
}

input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

select {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}

input[type="password"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

textarea {
  width: 100%;
  min-height: 90px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
}

ul {
  padding-left: 18px;
}

li {
  margin: 6px 0;
}

li button {
  margin-left: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

th, td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

th {
  background: #f3f4f6;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.layout2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden {
  display: none;
}

.search-results {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
}

.search-result-item {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: 0;
}

.search-result-item:hover {
  background: #f8fafc;
}

.finance-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.finance-row button {
  white-space: nowrap;
}

#companyDuplicateHint {
  font-size: 13px;
  margin-top: -4px;
}

.hint-warning {
  color: #b45309;
}

.hint-link {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  text-decoration: underline;
}

.company-detail-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  text-decoration: underline;
}

.company-detail-btn:hover {
  background: transparent;
  color: #1d4ed8;
}

.recent-row {
  background: #ecfdf5;
}

.detail-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.detail-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 14px 0;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .layout2 {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
