/* 我们的日记 - mobile-first warm diary aesthetic */ :root { --bg: #faf6f0; --bg-card: #fffdf9; --ink: #3d3429; --ink-muted: #7a6f63; --accent: #c97b63; --accent-soft: #f3e0d6; --border: #e8ddd0; --shadow: 0 8px 24px rgba(61, 52, 41, 0.08); --radius: 14px; --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; --touch-min: 44px; --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px); } *, *::before, *::after { box-sizing: border-box; } html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } html, body { margin: 0; min-height: 100%; font-family: var(--font); background: linear-gradient(165deg, #faf6f0 0%, #f5ebe0 45%, #efe4d4 100%); color: var(--ink); } body { padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); } body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.35; background-image: radial-gradient(circle at 20% 10%, #fff 0, transparent 50%), radial-gradient(circle at 80% 90%, #ffe8d6 0, transparent 45%); z-index: -1; } .hidden { display: none !important; } .app-shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 0.75rem 1rem 2rem; } .view-panel { margin-bottom: 1rem; } .app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; } .app-title { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; margin: 0; line-height: 1.3; } .header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; } .user-greeting { font-size: 0.9rem; color: var(--ink-muted); width: 100%; } .btn { border: none; border-radius: 999px; padding: 0.65rem 1.15rem; min-height: var(--touch-min); font-size: 1rem; cursor: pointer; font-family: inherit; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; touch-action: manipulation; } .btn:active { transform: scale(0.98); } .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(201, 123, 99, 0.35); } .btn-primary:hover { filter: brightness(1.05); } .btn-secondary { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); } .btn-ghost { background: var(--bg-card); color: var(--ink); border: 1px solid var(--border); } .btn-danger { background: #e74c3c; color: #fff; } .btn-sm { padding: 0.45rem 0.9rem; min-height: 38px; font-size: 0.875rem; } .btn-icon { min-width: var(--touch-min); padding: 0.5rem; font-size: 1.35rem; line-height: 1; } .btn-block { width: 100%; } .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; } .login-card { max-width: 400px; margin: 1.5rem auto 2rem; text-align: center; padding: 1.5rem 1.25rem; } .login-card h1 { margin: 0 0 0.35rem; font-size: 1.5rem; } .login-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 16px; background: linear-gradient(145deg, var(--accent-soft), #fff); border: 2px solid var(--border); position: relative; } .login-icon::before { content: ""; position: absolute; inset: 10px 12px 14px; border: 2px solid var(--accent); border-radius: 4px 8px 4px 4px; } .login-icon::after { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 14px; height: 6px; border: 2px solid var(--accent); border-bottom: none; border-radius: 6px 6px 0 0; } .field { text-align: left; margin-bottom: 1rem; } .field label { display: block; font-size: 0.875rem; color: var(--ink-muted); margin-bottom: 0.4rem; } .field input { width: 100%; padding: 0.75rem 0.9rem; min-height: var(--touch-min); border-radius: 10px; border: 1px solid var(--border); font-size: 16px; background: #fff; } .field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); } .hint { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 0.75rem; line-height: 1.5; } .hint-center { text-align: center; margin-top: 0.75rem; } .nav-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; gap: 0.5rem; } .month-label { font-weight: 600; font-size: 1rem; text-align: center; flex: 1; } .calendar, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; } .cal-head { text-align: center; font-size: 0.7rem; color: var(--ink-muted); padding: 0.35rem 0; font-weight: 600; white-space: nowrap; min-width: 0; line-height: 1.2; } .cal-day { aspect-ratio: 1; min-height: 42px; border: 1px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, 0.65); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; position: relative; font-size: 0.875rem; transition: background 0.15s, border-color 0.15s; touch-action: manipulation; padding: 2px; } .cal-day:hover { border-color: var(--accent-soft); background: #fff; } .cal-day.other { opacity: 0.35; pointer-events: none; } .cal-day.today { border-color: var(--accent); font-weight: 700; } .cal-day.selected { background: var(--accent-soft); border-color: var(--accent); } .mood-dots { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; } .mood-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; } .entry-cards { display: flex; flex-direction: column; gap: 0.75rem; } .entry-card { padding: 0.9rem 1rem; } .entry-card-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.65rem; flex-wrap: wrap; } .entry-user { font-weight: 600; } .mood-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; font-size: 0.8125rem; background: var(--accent-soft); } .block-text { line-height: 1.7; white-space: pre-wrap; margin: 0.5rem 0; font-size: 1rem; } .block-media img { max-width: 100%; border-radius: 10px; margin: 0.5rem 0; } .block-media audio, .block-media video { width: 100%; margin: 0.5rem 0; border-radius: 10px; } .comments-section { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px dashed var(--border); } .comments-title { margin: 0 0 0.6rem; font-size: 0.875rem; color: var(--ink-muted); font-weight: 600; } .comment-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; } .comment-item { background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 0.65rem 0.75rem; } .comment-empty { color: var(--ink-muted); font-size: 0.875rem; padding: 0.25rem 0; } .comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; font-size: 0.8125rem; flex-wrap: wrap; } .comment-author { font-weight: 600; color: var(--accent); } .comment-time { color: var(--ink-muted); } .comment-text { margin: 0; line-height: 1.55; white-space: pre-wrap; font-size: 0.9375rem; } .comment-delete { margin-top: 0.35rem; padding: 0.2rem 0.55rem; font-size: 0.75rem; } .comment-form { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; } .comment-input { flex: 1 1 160px; min-width: 0; padding: 0.65rem 0.85rem; min-height: var(--touch-min); border: 1px solid var(--border); border-radius: 999px; font-family: inherit; font-size: 16px; background: #fff; } .comment-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 123, 99, 0.15); } .comment-form .btn { flex-shrink: 0; } .editor-section { margin-top: 0.75rem; } .section-label { margin: 0 0 0.35rem; font-size: 0.875rem; color: var(--ink-muted); font-weight: 600; } .mood-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0.5rem 0 1rem; } .mood-option { border: 2px solid var(--border); border-radius: 12px; padding: 0.4rem 0.2rem; min-height: var(--touch-min); text-align: center; cursor: pointer; background: #fff; transition: border-color 0.15s, transform 0.15s; touch-action: manipulation; } .mood-option .emoji { font-size: 1.25rem; display: block; line-height: 1.2; } .mood-option .label { font-size: 0.65rem; color: var(--ink-muted); margin-top: 2px; } .mood-option.selected { border-color: var(--accent); background: var(--accent-soft); } .editor-text { width: 100%; min-height: 120px; padding: 0.85rem; border-radius: 12px; border: 1px solid var(--border); font-family: inherit; font-size: 16px; resize: vertical; line-height: 1.6; } .media-blocks { display: flex; flex-direction: column; gap: 0.65rem; margin: 0.65rem 0; } .media-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.65rem; background: #fff; border-radius: 10px; border: 1px dashed var(--border); flex-wrap: wrap; font-size: 0.875rem; } .upload-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9375rem; min-height: var(--touch-min); padding: 0.25rem 0; } .upload-label input { display: none; } .upload-icon { width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 3px; position: relative; flex-shrink: 0; } .upload-icon::after { content: "+"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--accent); line-height: 1; } .editor-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; } .editor-actions .btn-primary { flex: 1 1 auto; } #toast-container { position: fixed; bottom: calc(1rem + var(--safe-bottom)); left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; width: min(92vw, 400px); } .toast { background: rgba(61, 52, 41, 0.92); color: #fff; padding: 0.7rem 1rem; border-radius: 999px; font-size: 0.9375rem; box-shadow: var(--shadow); animation: toast-in 0.25s ease; text-align: center; } .toast.error { background: rgba(231, 76, 60, 0.95); } @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } #loading-overlay { position: fixed; inset: 0; background: rgba(250, 246, 240, 0.65); display: flex; align-items: center; justify-content: center; z-index: 10000; } .spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .view-title { margin: 0 0 0.75rem; font-size: 1.1rem; } .empty-state { text-align: center; color: var(--ink-muted); padding: 1.5rem 1rem; font-size: 0.9375rem; } @media (min-width: 480px) { .app-shell { padding: 1rem 1.25rem 2.5rem; } .app-title { font-size: 1.4rem; } .login-card { margin-top: 3rem; } .calendar, .calendar-grid { gap: 6px; } .cal-day { min-height: 48px; font-size: 0.9rem; } .mood-picker { gap: 8px; } .mood-option .emoji { font-size: 1.35rem; } .mood-option .label { font-size: 0.7rem; } } @media (min-width: 768px) { .app-shell { max-width: 720px; } .user-greeting { width: auto; } .header-actions { flex-wrap: nowrap; } }