:root {
  --dp-bg: #f4f8ff;
  --dp-bg-soft: #eef5ff;
  --dp-panel: rgba(255, 255, 255, 0.76);
  --dp-panel-strong: rgba(255, 255, 255, 0.94);
  --dp-line: rgba(59, 130, 246, 0.15);
  --dp-line-strong: rgba(37, 99, 235, 0.32);
  --dp-text: #182235;
  --dp-muted: #66758f;
  --dp-primary: #1687f8;
  --dp-primary-strong: #2563eb;
  --dp-violet: #7857ed;
  --dp-success: #0f9f70;
  --dp-danger: #e5485d;
  --dp-shadow: 0 18px 55px rgba(56, 91, 138, 0.12);
  --dp-radius: 16px;
}

html {
  color-scheme: light;
}

body {
  color: var(--dp-text) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 140, 255, 0.1), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(139, 92, 246, 0.08), transparent 25%),
    linear-gradient(145deg, #fbfdff, var(--dp-bg) 55%, var(--dp-bg-soft)) !important;
  background-attachment: fixed !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

body,
button,
input,
select,
textarea {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

a { text-decoration: none; }

.topbar,
header:not(.page-header):not(.home-header) {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid var(--dp-line) !important;
  box-shadow: 0 10px 34px rgba(61, 88, 128, 0.08) !important;
  backdrop-filter: blur(22px) saturate(145%) !important;
}

.topbar-inner,
.header-inner {
  max-width: 1320px !important;
}

.brand,
.brand-title,
.nav a,
.user-name {
  color: var(--dp-text) !important;
}

.brand-sub,
.section-desc,
.field-hint,
.muted,
.history-meta,
.page-subtitle,
.tool-card p,
.doc-section p {
  color: var(--dp-muted) !important;
}

.brand-mark {
  background: linear-gradient(145deg, rgba(80, 177, 255, 0.24), rgba(99, 102, 241, 0.13)) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 22px rgba(37, 99, 235, 0.12) !important;
}

.nav a {
  background: transparent !important;
  border-color: transparent !important;
}

.nav a:hover,
.nav a.active {
  color: #1859c9 !important;
  background: rgba(37, 99, 235, 0.07) !important;
  border-color: rgba(37, 99, 235, 0.12) !important;
}

.user-info,
.user-section,
.contact-badge,
.theme-btn {
  color: var(--dp-muted) !important;
  background: rgba(247, 250, 255, 0.86) !important;
  border-color: var(--dp-line) !important;
}

.logout-btn {
  color: #d93c54 !important;
  background: rgba(244, 63, 94, 0.08) !important;
  border: 1px solid rgba(244, 63, 94, 0.16) !important;
}

.container { max-width: 1320px !important; }

.panel,
.section,
.inner-panel,
.tool-card,
.doc-section,
.steps-card,
.stat-card,
.file-item,
.filter-bar,
.import-export-bar,
.table-container,
.modal-content,
.login-container,
.statistics-header,
.header-bar,
.header {
  color: var(--dp-text) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(246, 250, 255, 0.7)) !important;
  border: 1px solid var(--dp-line) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    var(--dp-shadow) !important;
  backdrop-filter: blur(18px) saturate(135%) !important;
}

.panel,
.section,
.inner-panel,
.tool-card,
.doc-section,
.table-container {
  border-radius: var(--dp-radius) !important;
}

.tool-card,
.file-item {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease !important;
}

.tool-card:hover,
.file-item:hover {
  transform: translateY(-3px);
  border-color: var(--dp-line-strong) !important;
  box-shadow:
    inset 0 1px 0 #fff,
    0 22px 52px rgba(55, 90, 140, 0.15),
    0 0 28px rgba(37, 99, 235, 0.06) !important;
}

h1,
h2,
h3,
h4,
.section-title,
.page-title,
.module-title {
  color: var(--dp-text) !important;
}

input,
select,
textarea,
.input,
.select,
.upload-box {
  color: var(--dp-text) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

input::placeholder,
textarea::placeholder {
  color: #8b98aa !important;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus {
  outline: none !important;
  border-color: rgba(37, 99, 235, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}

.upload-box { border-style: dashed !important; }
.upload-box:hover,
.upload-box.dragover {
  border-color: var(--dp-primary) !important;
  background: rgba(232, 244, 255, 0.9) !important;
}

button,
.btn,
.tool-btn,
.download-btn,
.upload-btn,
.download-button,
.filter-btn,
.export-btn,
.import-btn,
.confirm-btn,
#save-btn,
#validate-btn {
  min-height: 42px;
  border-radius: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.btn-primary,
.btn-primary.strong,
.tool-btn,
.download-btn,
.download-button,
.filter-btn,
.export-btn,
.confirm-btn,
#save-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #16a5e9, #2563eb 62%, #7357ee) !important;
  border: 1px solid rgba(37, 99, 235, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 24px rgba(37, 99, 235, 0.2) !important;
}

.btn-primary:hover,
.tool-btn:hover,
.download-btn:hover,
.download-button:hover,
.filter-btn:hover,
.export-btn:hover,
.confirm-btn:hover,
#save-btn:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 30px rgba(37, 99, 235, 0.3) !important;
}

.btn-secondary,
.btn-ghost,
.reset-btn,
.cancel-btn,
.back-btn,
.back-link {
  color: #365474 !important;
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
}

button:disabled,
.disabled {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  filter: saturate(0.45);
}

table,
.budget-table,
.data-table {
  color: var(--dp-text) !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

th {
  color: #254160 !important;
  background: #eef5ff !important;
  border-color: rgba(37, 99, 235, 0.12) !important;
}

td {
  color: #40546d !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(37, 99, 235, 0.08) !important;
}

tr:hover td { background: #f3f8ff !important; }

.message.success,
.success-message {
  color: #087f5b !important;
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}

.message.error,
.error-message,
.error {
  color: #d83b54 !important;
  background: rgba(244, 63, 94, 0.07) !important;
  border-color: rgba(244, 63, 94, 0.18) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
