/* PromptLib hand-written CSS — no Tailwind, no CDN */ /* Sora font, fully local under /fonts */ @font-face { font-family: 'Sora'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/sora-400.ttf') format('truetype'); } @font-face { font-family: 'Sora'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/sora-500.ttf') format('truetype'); } @font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/sora-600.ttf') format('truetype'); } @font-face { font-family: 'Sora'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/sora-700.ttf') format('truetype'); } :root { --background: #f5f5f5; --foreground: #111827; --card: #ffffff; --border: rgba(0, 0, 0, 0.08); --secondary: #f3f4f6; --secondary-foreground: #374151; --text-secondary: #4b5563; --text-tertiary: #6b7280; --primary: #111827; --primary-foreground: #ffffff; --muted: #f3f4f6; --destructive: #dc2626; --search-input: rgba(0, 0, 0, 0.03); } @media (prefers-color-scheme: dark) { :root { --background: #0b0d10; --foreground: #e5e7eb; --card: #14171c; --border: rgba(255, 255, 255, 0.08); --secondary: #1f242b; --secondary-foreground: #d1d5db; --text-secondary: #9ca3af; --text-tertiary: #6b7280; --primary: #e5e7eb; --primary-foreground: #0b0d10; --muted: #1f242b; --destructive: #f87171; --search-input: rgba(255, 255, 255, 0.04); } } * { box-sizing: border-box; } html, body { margin: 0; padding: 0; } body { font-family: 'Sora', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--background); color: var(--foreground); min-height: 100vh; overflow-x: hidden; } .hidden { display: none !important; } .mobile-menu-btn, .sidebar-backdrop { display: none; } /* Sidebar */ .sidebar { background: var(--card); border-right: 1px solid var(--border); width: 220px; min-height: 100vh; padding: 20px 16px; position: fixed; left: 0; top: 0; bottom: 0; overflow-y: auto; z-index: 50; -webkit-overflow-scrolling: touch; } .sidebar-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; padding-left: 12px; } .sidebar-divider { border-top: 1px solid var(--border); margin: 20px 12px; } .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; margin-bottom: 4px; user-select: none; } .nav-item:hover { background: var(--secondary); color: var(--foreground); } .nav-item.active { background: var(--foreground); color: var(--background); } .filter-group { margin-bottom: 20px; } .filter-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 8px; padding-left: 12px; } .filter-chips { padding-left: 8px; } .filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; margin: 0 4px 6px 0; border: 1px solid transparent; user-select: none; } .filter-chip:hover { background: var(--secondary); } .filter-chip.active { background: var(--foreground); color: var(--background); border-color: var(--foreground); } /* Main */ .main { margin-left: 220px; padding: 24px 32px; min-height: 100vh; } .security-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 8px; background: #fffbeb; color: #78350f; } .security-banner > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .security-banner strong { font-size: 14px; font-weight: 700; } .security-banner span { font-size: 12px; line-height: 1.45; } @media (prefers-color-scheme: dark) { .security-banner { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.32); color: #fcd34d; } } .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; } .page-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; } .page-header h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.3px; } .page-header p { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; } .toolbar { display: flex; gap: 10px; margin-bottom: 16px; } .stats { display: flex; gap: 16px; margin-bottom: 20px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; } .stats .sep { color: var(--border); } .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; } @media (max-width: 720px) { .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 42px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font: inherit; font-size: 18px; } .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(0, 0, 0, 0.38); } .sidebar { width: min(82vw, 300px); padding: calc(68px + env(safe-area-inset-top)) 16px 20px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 16px 0 36px rgba(0, 0, 0, 0.18); } .sidebar.open { transform: translateX(0); } .main { margin-left: 0; padding: calc(18px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom)); } .security-banner { align-items: stretch; flex-direction: column; } .security-banner .btn { justify-content: center; } .page-header { align-items: stretch; gap: 14px; } .page-title-row > div { min-width: 0; } .page-header h1 { font-size: 20px; line-height: 1.25; } .page-header p { line-height: 1.4; } .page-header .btn { width: 100%; justify-content: center; min-height: 42px; } .toolbar { margin-bottom: 14px; } .stats { gap: 8px 10px; margin-bottom: 14px; line-height: 1.5; } .stats .sep { display: none; } .card-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } } /* Card */ .card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: box-shadow 0.15s, transform 0.15s; } .card:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); transform: translateY(-1px); } .card-body { padding: 14px 16px; } .card-title-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; } .card-title-row h3 { font-size: 15px; font-weight: 600; margin: 0; flex: 1; word-break: break-word; } .card-tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; } .card-prompt-block { margin-bottom: 8px; } .card-prompt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; } .card-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; } .spacer { margin-left: auto; } .elapsed { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; } .gen-error { display: flex; align-items: center; gap: 8px; background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.3); color: var(--destructive); padding: 8px 10px; border-radius: 8px; font-size: 12px; margin-bottom: 10px; cursor: pointer; } .gen-error > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } @media (prefers-color-scheme: dark) { .gen-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); color: #fca5a5; } } .tag { background: var(--secondary); color: var(--secondary-foreground); border-radius: 6px; font-size: 11px; padding: 3px 8px; font-weight: 500; display: inline-block; white-space: nowrap; } .model-badge-gpt { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; } .model-badge-seedance { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; } @media (prefers-color-scheme: dark) { .model-badge-gpt { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.35); } .model-badge-seedance { background: rgba(251, 191, 36, 0.12); color: #fcd34d; border-color: rgba(251, 191, 36, 0.3); } } .btn { border-radius: 8px; font-size: 13px; font-weight: 500; padding: 7px 14px; cursor: pointer; transition: all 0.15s ease-out; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-family: inherit; } .btn:hover { background: var(--secondary); } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); } .btn-primary:hover { opacity: 0.9; background: var(--primary); } .btn-ghost { background: transparent; border: none; } .btn-sm { padding: 5px 10px; font-size: 12px; } .icon-btn { font-size: 18px; padding: 4px 8px; } .search-box { background: var(--search-input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; width: 100%; outline: none; font-family: inherit; color: inherit; } .search-box:focus { border-color: var(--primary); } textarea.search-box { resize: vertical; } .img-preview { width: 100%; aspect-ratio: 16 / 10; background: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-tertiary); overflow: hidden; position: relative; cursor: pointer; } .img-preview img { width: 100%; height: 100%; object-fit: cover; } .img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%); opacity: 0; transition: opacity 0.2s; display: flex; align-items: flex-end; justify-content: flex-end; padding: 12px; gap: 6px; } .card:hover .img-overlay { opacity: 1; } .img-preview:focus-within .img-overlay { opacity: 1; } .img-overlay .btn { background: rgba(255, 255, 255, 0.95); border: none; color: #111; } .img-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; } .prompt-text { line-height: 1.5; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; } .translation { color: var(--text-secondary); font-size: 12px; line-height: 1.4; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* Modal */ .modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; } .modal-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 560px; max-height: min(90vh, 900px); overflow-y: auto; -webkit-overflow-scrolling: touch; } .modal-card-large { max-width: min(960px, 90vw); } .info-img-wrap.large { max-height: 65vh; display: flex; align-items: center; justify-content: center; } .info-img-wrap.large img { max-height: 65vh; width: auto; max-width: 100%; } .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; } .modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; } .modal-body { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 16px; } .modal-actions { display: flex; gap: 10px; margin-top: 4px; } .modal-actions .btn { flex: 1; } .form-label { font-size: 13px; font-weight: 500; margin-bottom: 6px; display: block; } .form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; } .required { color: var(--destructive); } .hint-inline { font-weight: 400; color: var(--text-tertiary); font-size: 12px; } .setting-group { border: 1px solid var(--border); border-radius: 10px; padding: 16px; } .setting-group-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; } .size-select { display: flex; gap: 8px; flex-wrap: wrap; } .size-option { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; background: var(--card); transition: all 0.15s; user-select: none; } .size-option:hover { background: var(--secondary); } .size-option.active { background: var(--foreground); color: var(--background); border-color: var(--foreground); } .info-img-wrap { border-radius: 10px; overflow: hidden; background: var(--muted); } .info-img-wrap img { width: 100%; height: auto; display: block; } .meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; font-size: 13px; } .meta-item { display: flex; flex-direction: column; gap: 4px; } .meta-label { color: var(--text-tertiary); font-size: 12px; } .meta-value { font-weight: 500; word-break: break-word; } .meta-item.span2 { grid-column: span 2; } .toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--foreground); color: var(--background); padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 1000; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); animation: slideDown 0.2s; } .toast.error { background: #dc2626; color: #fff; } @keyframes slideDown { from { transform: translate(-50%, -20px); opacity: 0; } } .empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); } .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } @media (hover: none), (pointer: coarse) { .btn, .nav-item, .filter-chip, .size-option { min-height: 40px; } .img-overlay { opacity: 1; background: linear-gradient(to top, rgba(0, 0, 0, 0.48) 0%, transparent 58%); } } @media (max-width: 520px) { .card { border-radius: 10px; } .card-body { padding: 13px 14px; } .card-title-row { align-items: center; } .card-prompt-head { flex-wrap: wrap; } .card-prompt-head .spacer { margin-left: auto; } .card-actions .btn { flex: 1 1 auto; justify-content: center; } .card-actions .spacer { margin-left: 0; flex: 0 0 44px; } .prompt-text { -webkit-line-clamp: 4; } .search-box { font-size: 16px; padding: 11px 12px; } .modal-overlay { align-items: flex-end; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); } .modal-card { max-height: calc(100vh - 20px - env(safe-area-inset-top)); border-radius: 14px 14px 10px 10px; } .modal-card-large { max-width: 100%; } .modal-head { padding: 16px 16px 0; } .modal-body { padding: 14px 16px 18px; gap: 14px; } .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { width: 100%; min-height: 42px; justify-content: center; } .setting-group { padding: 14px; } .size-select { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .size-option { text-align: center; padding: 9px 8px; } .meta-grid { grid-template-columns: 1fr; } .meta-item.span2 { grid-column: auto; } .info-img-wrap.large, .info-img-wrap.large img { max-height: 46vh; } .toast { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); width: calc(100vw - 28px); max-width: 360px; text-align: center; } }