/* ============================================
   Swiss Records — 内容记录
   ============================================ */

.record-add-mini {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.record-card-list {
  min-height: 156px;
  max-height: 156px;
  overflow-y: auto;
}

.record-mini-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.record-mini-item:hover .record-mini-title { color: var(--accent); }

.record-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}

.record-mini-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.record-mini-time {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.record-empty {
  text-align: center;
  padding: 28px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.record-empty.large { padding: 48px 0; }

.record-card-foot {
  text-align: center;
  margin-top: auto;
  padding-top: var(--sp-sm);
}

.record-card-foot a {
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
}

.record-card-foot a:hover { color: var(--accent); }

.records-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: 86vh;
  overflow-y: auto;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.records-head h3 {
  font-size: 15px;
  font-weight: 650;
}

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

.records-close {
  font-size: 22px;
  color: var(--text-faint);
  line-height: 1;
}

.record-search-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-warm);
  color: var(--text);
  font-size: 14px;
}

.record-filter-block {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.record-filter-btn,
.record-type-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-warm);
  border: 1px solid transparent;
}

.record-filter-btn.active,
.record-type-btn.active {
  background: var(--accent);
  color: #fff;
}

.record-library-list {
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 2px;
}

.record-date-label {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-faint);
}

.record-library-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.record-library-item:hover strong { color: var(--accent); }

.record-library-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.record-library-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.record-library-line span:last-child {
  font-size: 11px;
  color: var(--text-faint);
}

.record-library-preview {
  margin-top: 5px;
  margin-left: 44px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-edit-panel {
  width: min(620px, calc(100vw - 32px));
  max-height: 86vh;
  overflow-y: auto;
}

.record-content-input {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-warm);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.record-type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px;
}

.record-edit-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

.record-image-placeholder {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-faint);
  background: var(--bg-warm);
}

.record-edit-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

@media (min-width: 769px) {
  #card-records { min-height: 360px; }
  #card-records .record-card-list {
    min-height: 216px;
    max-height: 216px;
  }
}

@media (max-width: 768px) {
  .records-panel,
  .record-edit-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .record-library-list { max-height: none; }
  .record-edit-grid { grid-template-columns: 1fr; }
}
