*,
*::before,
*::after {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f5f7fb;
  color: #1f2933;
}

body {
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #f5f7fb;
}

.page-banner {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.page-banner img {
  width: 80%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  background: rgba(245, 247, 251, 0.96);
  backdrop-filter: blur(12px);
}

.app-logo {
  padding: 8px 12px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  font-weight: 600;
  font-size: 15px;
  color: #2563eb;
}

.app-header-right {
  display: flex;
  gap: 8px;
}

.icon-button {
  border: none;
  background: #ffffff;
  border-radius: 999px;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  padding: 0 10px;
  font-size: 13px;
}

.user-button {
  border: none;
  background: #ffffff;
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 15px;
  color: #2563eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.user-button span {
  white-space: nowrap;
}

.app-main {
  flex: 1;
  padding: 8px 16px 80px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  border-radius: 18px;
  padding: 16px 16px 18px;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 14px;
}

.card.muted {
  background: #f9fafb;
  box-shadow: none;
}

.welcome-card {
  margin-top: 4px;
}

.welcome-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-size: 13px;
  color: #6b7280;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 2px 8px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.section-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.record-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 6px;
  align-items: flex-start;
}

.record-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #e0f2fe, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.record-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.record-unit {
  font-weight: 600;
  font-size: 14px;
}

.record-time {
  font-size: 12px;
  color: #9ca3af;
}

.record-description {
  font-size: 13px;
  color: #4b5563;
}

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

.record-photos-count {
  font-size: 12px;
  color: #6b7280;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #eff6ff;
  color: #2563eb;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.form-input {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  background: #ffffff;
}

.date-picker-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 8px;
}

.date-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%),
    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.primary-button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.primary-button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.secondary-button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 8px 14px;
  font-size: 13px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
}

.full-width {
  width: 100%;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: env(safe-area-inset-bottom, 0);
  width: 100%;
  max-width: 960px;
  padding: 6px 12px 10px;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  justify-content: space-around;
  gap: 8px;
  border-radius: 18px 18px 0 0;
}

.bottom-nav-item {
  flex: 1;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  gap: 2px;
  font-size: 11px;
  color: #6b7280;
  cursor: pointer;
}

.bottom-nav-icon {
  font-size: 18px;
}

.bottom-nav-item.active {
  background: #e0f2fe;
  color: #2563eb;
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-1px);
}

.photo-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.photo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7eb;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #f9fafb;
  font-size: 12px;
  cursor: pointer;
}

.record-photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.record-photo-item {
  position: relative;
  width: 140px;
  height: 90px;
  border-radius: 16px;
  overflow: hidden;
  background: #e5e7eb;
}

.record-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9fafb;
  display: block;
}

.record-photo-item.more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #374151;
  background: rgba(37, 99, 235, 0.06);
  border: 1px dashed rgba(37, 99, 235, 0.3);
}

.image-viewer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.image-viewer.hidden {
  display: none;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.image-viewer-content {
  position: relative;
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.6);
  z-index: 1;
}

.image-viewer-content img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
}

.image-viewer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #f9fafb;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-print-area {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 800px;
  padding: 24px 32px;
  background: #ffffff;
  color: #111827;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.login-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.login-dialog.hidden {
  display: none;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.login-panel {
  position: relative;
  max-width: 360px;
  width: 88vw;
  z-index: 1;
}

.login-panel .section-title {
  margin-top: 4px;
}

.login-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logout-button {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}

.logout-button:hover {
  color: #2563eb;
}

.login-info {
  margin: 4px 2px 6px;
}

.login-info-text {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}

.login-error {
  color: #ef4444;
}

.export-preview {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background: #ffffff;
  font-size: 12px;
}

.export-preview-header,
.export-preview-row {
  display: grid;
  grid-template-columns: 1.2fr 2.2fr 1.3fr;
  gap: 6px;
  padding: 6px 10px;
}

.export-preview-header {
  background: #eff6ff;
  font-weight: 600;
}

.export-preview-row:nth-child(even) {
  background: #f9fafb;
}

.export-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}

.export-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.export-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.export-item-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-item-title {
  font-size: 13px;
  font-weight: 600;
}

.export-item-desc {
  font-size: 12px;
  color: #6b7280;
}

.export-item-time {
  font-size: 12px;
  color: #9ca3af;
}

.export-item-photos {
  font-size: 12px;
  color: #6b7280;
}

.export-item-thumb {
  width: 100%;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #9ca3af;
}

.export-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9fafb;
  display: block;
}

.export-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 4px 0 4px;
}

.export-selected-text {
  font-size: 12px;
  color: #6b7280;
}

.export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.export-actions .secondary-button.full-width {
  background: #f9fafb;
}

@media (min-width: 768px) {
  .export-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .app-main {
    padding-inline: 24px;
  }

  .card {
    border-radius: 20px;
  }
}

