.generation-records-page {
    --gr-border: #dedfe3;
    --gr-muted: #6e7076;
    --gr-surface: #fff;
    --gr-soft: #f6f7f8;
    --gr-accent: #087f6a;
    --gr-danger: #c13d36;
}

.gr-page-header, .gr-filter-bar, .gr-card-header, .gr-card-footer, .gr-modal-header {
    display: flex;
    align-items: center;
}

.gr-page-header { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.gr-page-header .page-title { margin-bottom: 0; }
.gr-filter-bar {
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--gr-surface);
    border: 1px solid var(--gr-border);
    border-radius: 6px;
}
.gr-filter-field { min-width: 150px; }
.gr-filter-field.gr-filter-search { flex: 1; min-width: 220px; }
.gr-filter-field label { display: block; margin-bottom: 6px; color: var(--gr-muted); font-size: 12px; font-weight: 600; }
.gr-filter-field input, .gr-filter-field select {
    width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--gr-border);
    border-radius: 5px; background: #fff; color: #25262a; font-size: 13px;
}
.gr-summary { margin-bottom: 12px; color: var(--gr-muted); font-size: 13px; }
.gr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.gr-card { min-width: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr); overflow: hidden; background: var(--gr-surface); border: 1px solid var(--gr-border); border-radius: 7px; }
.gr-card-summary-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: #f0f2f3; border-right: 1px solid var(--gr-border); color: #4f5257; }
.gr-card-summary-icon span { font-size: 26px; line-height: 1; }
.gr-card-summary-icon small { color: var(--gr-muted); font-size: 11px; }
.gr-card-body { padding: 12px; }
.gr-card-header { justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.gr-card-type { color: #27282b; font-size: 14px; font-weight: 700; }
.gr-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.gr-status-completed, .gr-status-success { color: #126b3a; background: #e7f5ec; }
.gr-status-processing { color: #765600; background: #fff4cd; }
.gr-status-failed { color: #a52f2a; background: #fdebea; }
.gr-prompt {
    min-height: 40px; margin-bottom: 10px; overflow: hidden; color: #3d3e42; font-size: 13px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gr-meta-line { overflow: hidden; color: var(--gr-muted); font-size: 12px; line-height: 1.65; text-overflow: ellipsis; white-space: nowrap; }
.gr-card-footer { justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #ececef; }
.gr-media-count { color: var(--gr-muted); font-size: 12px; }
.gr-btn {
    min-height: 34px; padding: 7px 12px; border: 1px solid var(--gr-border); border-radius: 5px;
    background: #fff; color: #2b2c30; cursor: pointer; font-size: 13px; font-weight: 600;
}
.gr-btn:hover { border-color: #a8aaaf; background: var(--gr-soft); }
.gr-btn:disabled { cursor: default; opacity: .45; }
.gr-btn-primary { border-color: var(--gr-accent); background: var(--gr-accent); color: #fff; }
.gr-btn-primary:hover { border-color: #056b59; background: #056b59; }
.gr-empty, .gr-loading, .gr-error {
    grid-column: 1 / -1; padding: 56px 20px; text-align: center; color: var(--gr-muted);
    background: #fff; border: 1px solid var(--gr-border); border-radius: 6px;
}
.gr-error { color: var(--gr-danger); }
.gr-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; }
.gr-pagination span { color: var(--gr-muted); font-size: 13px; }
.gr-modal-overlay {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: rgba(15, 16, 18, .62);
}
.gr-modal { width: min(1120px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 7px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.gr-modal-header { position: sticky; top: 0; z-index: 2; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--gr-border); }
.gr-modal-header h3 { margin: 0; font-size: 18px; }
.gr-icon-btn { width: 34px; height: 34px; border: 1px solid var(--gr-border); border-radius: 5px; background: #fff; color: #303136; cursor: pointer; font-size: 22px; line-height: 1; }
.gr-modal-body { padding: 20px; }
.gr-detail-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; margin-bottom: 20px; }
.gr-detail-meta-item span { display: block; margin-bottom: 4px; color: var(--gr-muted); font-size: 11px; }
.gr-detail-meta-item strong { display: block; overflow-wrap: anywhere; color: #292a2e; font-size: 13px; }
.gr-detail-section { padding: 18px 0; border-top: 1px solid var(--gr-border); }
.gr-detail-section h4 { margin: 0 0 12px; font-size: 15px; }
.gr-detail-text {
    margin: 0; padding: 12px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--gr-soft);
    border: 1px solid #e6e7ea; border-radius: 5px; color: #303136; font-family: inherit; font-size: 13px; line-height: 1.65;
}
.gr-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gr-media-item { min-width: 0; }
.gr-media-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #eceef0; border: 1px solid var(--gr-border); border-radius: 5px; }
.gr-media-frame img, .gr-media-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }
.gr-media-frame audio { width: calc(100% - 20px); margin: calc(37.5% - 20px) 10px 0; }
.gr-media-lazy, .gr-media-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #777a80; font-size: 12px; }
.gr-media-lazy img { width: 100%; height: 100%; object-fit: contain; }
.gr-media-load-error { color: var(--gr-danger); }
.gr-media-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 7px; }
.gr-media-info > div { min-width: 0; }
.gr-media-label { overflow: hidden; color: #393a3e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.gr-media-sub { margin-top: 3px; color: var(--gr-muted); font-size: 11px; }
.gr-media-action { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; border: 1px solid var(--gr-border); border-radius: 4px; background: #fff; color: #34363a; cursor: pointer; font-size: 12px; }
.gr-media-action:hover { background: var(--gr-soft); }
.gr-media-action:disabled { cursor: default; opacity: .55; }
.gr-image-viewer { position: fixed; inset: 0; z-index: 2200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 13, 15, .82); }
.gr-image-viewer-panel { width: min(1680px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 7px; }
.gr-image-viewer-header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--gr-border); }
.gr-image-viewer-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-image-viewer-body { min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 16px; background: #eef0f2; color: var(--gr-muted); }
.gr-image-viewer-body img { display: block; max-width: 100%; max-height: calc(100vh - 134px); object-fit: contain; }

@media (max-width: 1200px) { .gr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .gr-grid, .gr-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gr-detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .gr-grid, .gr-media-grid, .gr-detail-meta { grid-template-columns: 1fr; }
    .gr-filter-field, .gr-filter-field.gr-filter-search { width: 100%; min-width: 0; }
    .gr-modal-overlay { padding: 8px; }
    .gr-modal { max-height: calc(100vh - 16px); }
    .gr-image-viewer { padding: 8px; }
    .gr-image-viewer-panel { max-height: calc(100vh - 16px); }
}
