/* ============================================================
  大家对脚本 — Design System v3
   Confirm dialogs, notifications, shot colors, inline edit,
   comment shot references, conditional attachments
   ============================================================ */

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

:root {
  --bg: #f6f9fc;
  --bg-white: #ffffff;
  --surface-2: #f0f4f8;
  --surface-3: #e8eef4;
  --border: #e3e8ee;
  --border-light: #d4dbe4;
  --text: #1a1f36;
  --text-2: #4f566b;
  --text-3: #8792a2;
  --text-4: #a3acb9;
  --green: #0a8a4a;
  --green-light: #0ead5c;
  --green-pale: #e6f7ed;
  --green-glow: rgba(10, 138, 74, 0.08);
  --green-gradient: linear-gradient(135deg, #0a8a4a 0%, #0ead5c 50%, #34d399 100%);
  --orange: #d97706;
  --orange-bg: #fef3e2;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --icon-sm: 14px;
  --icon-md: 18px;
  --icon-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shot color palette */
.shot-color-1 { --sc: #0a8a4a; } .shot-color-2 { --sc: #3b82f6; }
.shot-color-3 { --sc: #d97706; } .shot-color-4 { --sc: #8b5cf6; }
.shot-color-5 { --sc: #ec4899; } .shot-color-6 { --sc: #06b6d4; }
.shot-color-7 { --sc: #f59e0b; } .shot-color-8 { --sc: #10b981; }

html { font-size: 15px; }
body {
  font-family: 'Sora', 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.icon {
  width: var(--icon-md);
  height: var(--icon-md);
  stroke-width: 1.9;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-md { width: var(--icon-md); height: var(--icon-md); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon-inline { margin-right: 2px; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 54px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em;
}
.topbar-logo:hover { text-decoration: none; }
.brand-mark {
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}
.topbar-logo .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(10,138,74,0.25);
}
.topbar-nav { display: flex; gap: 6px; margin-left: 24px; align-items: center; }
.topbar-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px; border-radius: 6px; font-size: 0.82rem;
  color: var(--text-3); font-weight: 500; transition: var(--transition);
  text-decoration: none;
}
.topbar-nav a:hover { color: var(--text-2); background: var(--surface-2); text-decoration: none; }
.topbar-nav a.active { color: var(--green); background: var(--green-glow); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  display: none;
  flex-shrink: 0;
}
.notif-dot.show { display: block; }

/* ===== USER PILL & MENU ===== */
.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: 24px;
  font-size: 0.78rem; color: var(--text-2); cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.user-pill:hover { border-color: var(--border-light); }
.user-pill .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--green-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: #fff; font-weight: 600;
}
.user-pill #userName {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px;
  min-width: 140px; z-index: 200;
}
.user-menu.show { display: block; }
.user-menu-item {
  display: block; width: 100%; padding: 8px 14px; border: none;
  background: transparent; color: var(--text-2); font-family: inherit;
  font-size: 0.8rem; cursor: pointer; text-align: left; border-radius: 6px;
  transition: var(--transition);
}
.user-menu-item:hover { background: var(--surface-2); color: var(--text); }
.user-menu-item.danger:hover { background: var(--red-bg); color: var(--red); }

/* ===== BUTTONS ===== */
.btn {
  padding: 8px 20px; border-radius: var(--radius); border: none;
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--green-gradient); color: #fff; box-shadow: 0 2px 8px rgba(10,138,74,0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,138,74,0.25); }
.btn-secondary { background: var(--bg-white); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-green-outline { background: var(--bg-white); color: var(--green); border: 1px solid var(--border); }
.btn-green-outline:hover { background: var(--green-pale); border-color: var(--green); }
.btn-danger { background: var(--bg-white); color: var(--red); border: 1px solid var(--border); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-approve { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(10,138,74,0.2); }
.btn-approve:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,138,74,0.25); }
.btn-revise { background: var(--bg-white); color: var(--orange); border: 1px solid var(--orange); }
.btn-revise:hover { background: var(--orange-bg); }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-white);
  font-family: inherit; font-size: 0.9rem; color: var(--text); transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(10,138,74,0.1); }
.form-input::placeholder { color: var(--text-4); }
.form-input.error { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.form-select {
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--bg-white); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.82rem; cursor: pointer;
}
.form-select:focus { outline: none; border-color: var(--green); }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; font-size: 0.73rem; font-weight: 600;
}
.status-draft { background: var(--surface-2); color: var(--text-3); }
.status-review { background: var(--blue-bg); color: var(--blue); }
.status-revision { background: var(--orange-bg); color: var(--orange); }
.status-approved { background: var(--green-pale); color: var(--green); }
.brand-tag {
  display: inline-block; padding: 2px 8px; font-size: 0.65rem;
  border-radius: 4px; background: var(--green-pale); color: var(--green); font-weight: 600;
}

/* ===== CARD ===== */
.card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}

/* ===== INLINE EDIT (dashboard welcome name) ===== */
.inline-edit-name {
  display: inline-block; font: inherit; font-size: inherit; font-weight: inherit;
  color: inherit; border: none; background: none; outline: none;
  border-bottom: 2px dashed transparent; cursor: text;
  padding: 0 2px; transition: var(--transition); letter-spacing: inherit;
  max-width: 200px;
}
.inline-edit-name:hover { border-bottom-color: var(--border-light); }
.inline-edit-name:focus { border-bottom-color: var(--green); border-bottom-style: solid; }

.locate-flash {
  animation: locate-flash-pulse 1.1s ease;
}

@keyframes locate-flash-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
  20% {
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.8), 0 0 0 8px rgba(59, 130, 246, 0.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* ===== COMMENT COMPONENTS ===== */
.comment-item {
  padding: 12px; border-radius: 8px; background: var(--bg);
  margin-bottom: 6px; border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 10px;
}
.comment-author { font-size: 0.78rem; font-weight: 600; color: var(--green); }
.comment-role {
  font-size: 0.62rem; color: var(--text-3); margin-left: 6px; padding: 1px 6px;
  background: var(--surface-2); border-radius: 3px; font-weight: 500;
}
.comment-time { font-size: 0.68rem; color: var(--text-4); margin-top: 2px; }
.comment-text { font-size: 0.82rem; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.comment-delete {
  background: none; border: none; color: var(--text-4);
  cursor: pointer; font-size: 0.7rem; padding: 2px 4px; opacity: 0;
  transition: var(--transition); flex-shrink: 0; align-self: flex-start;
}
.comment-item:hover .comment-delete { opacity: 1; }
.comment-delete:hover { color: var(--red); }
.comment-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; color: #fff; font-weight: 600; flex-shrink: 0; margin-top: 1px;
}
.comment-avatar.client { background: linear-gradient(135deg, var(--blue) 0%, #60a5fa 100%); }
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.comment-header .comment-time { margin-top: 0; margin-left: auto; }

/* Comment shot reference tag */
.comment-shot-ref {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); color: #fff; margin-bottom: 4px;
}
.comment-shot-ref:hover { opacity: 0.85; transform: scale(1.02); }

/* Comment input quote indicator */
.comment-quote-indicator {
  display: none; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 6px;
  background: var(--surface-2); border-radius: 6px;
  font-size: 0.75rem; color: var(--text-2); font-weight: 500;
}
.comment-quote-indicator.show { display: flex; }
.comment-quote-indicator .quote-shot-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 3px; color: #fff; font-size: 0.68rem; font-weight: 600;
}
.comment-quote-close {
  margin-left: auto; background: none; border: none;
  color: var(--text-4); cursor: pointer; font-size: 0.75rem; padding: 2px 4px;
}
.comment-quote-close:hover { color: var(--text-2); }

/* Shot comment trigger button */
.shot-comment-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: var(--text-4); cursor: pointer;
  font-size: 0.72rem; font-family: inherit; transition: var(--transition);
}
.shot-comment-btn:hover { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bg); }

/* Activity timeline */
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 4px 12px; margin-bottom: 2px; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-light); margin-top: 5px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-text { font-size: 0.75rem; color: var(--text-4); line-height: 1.5; }
.activity-time { font-size: 0.65rem; color: var(--text-4); margin-top: 1px; }
.comment-input-wrap { display: flex; gap: 8px; }
.comment-input {
  flex: 1; padding: 8px 12px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text); font-family: inherit;
  font-size: 0.82rem; resize: none; transition: var(--transition);
  min-height: 44px; line-height: 1.5; overflow-y: hidden; white-space: pre-wrap; word-break: break-word;
}
.comment-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(10,138,74,0.08); }

/* ===== SHOT CARD ===== */
.shot-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 12px; overflow: hidden; transition: var(--transition);
}
.shot-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
.shot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.shot-header-left { display: flex; align-items: center; gap: 10px; }

/* Shot number badge — colored */
.shot-num {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  font-weight: 600; color: #fff;
  padding: 3px 10px; border-radius: 5px; min-width: 56px; text-align: center;
}

.shot-duration {
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-3);
  display: flex; align-items: center; gap: 4px;
}
.shot-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.shot-field { background: var(--bg-white); padding: 10px 14px; min-height: 60px; }
.shot-field-label {
  font-size: 0.65rem; color: var(--text-4); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.shot-field-content {
  font-size: 0.84rem; line-height: 1.55; color: var(--text-2);
  border: none; outline: none; width: 100%; min-height: 36px;
  resize: none; font-family: inherit; background: transparent;
}
.shot-field-content:focus { color: var(--text); }

/* Add ref image button in field label */
.add-ref-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 4px; border: none;
  background: transparent; color: var(--text-4); cursor: pointer;
  font-size: 0.62rem; font-family: inherit; transition: var(--transition);
}
.add-ref-btn:hover { background: var(--green-glow); color: var(--green); }

/* Attachment area — hidden when empty */
.shot-attachment {
  grid-column: 1 / -1; background: var(--bg-white);
  padding: 10px 14px; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
}
.shot-attachment.hidden { display: none; }

.attachment-thumb {
  width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); position: relative; cursor: pointer;
  transition: var(--transition); flex-shrink: 0;
}
.attachment-thumb:hover { border-color: var(--green); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb .remove-att {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  font-size: 0.6rem; cursor: pointer; display: none;
  align-items: center; justify-content: center; line-height: 1;
}
.attachment-thumb:hover .remove-att { display: flex; }
.attachment-file {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-2); transition: var(--transition);
}
.attachment-file .remove-att {
  margin-left: 4px; background: none; border: none; color: var(--text-4);
  cursor: pointer; font-size: 0.7rem; display: none;
}
.attachment-file:hover .remove-att { display: inline; }
.attachment-file .remove-att:hover { color: var(--red); }
.add-attachment-btn {
  width: 72px; height: 72px; border-radius: 8px;
  border: 1px dashed var(--border); background: transparent;
  color: var(--text-4); cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 0.62rem; font-family: inherit; flex-shrink: 0;
}
.add-attachment-btn .plus { font-size: 1.1rem; line-height: 1; }
.add-attachment-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-glow); }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(26,31,54,0.35); backdrop-filter: blur(4px);
  justify-content: center; align-items: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 28px 32px;
  width: 90%; max-width: 380px; box-shadow: var(--shadow-lg);
  text-align: center; animation: fadeInUp 0.2s ease;
}
.confirm-icon {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.confirm-icon.danger { background: var(--red-bg); }
.confirm-icon.warning { background: var(--orange-bg); }
.confirm-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.confirm-desc { font-size: 0.82rem; color: var(--text-3); line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(26,31,54,0.3); backdrop-filter: blur(6px);
  justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px;
  width: 90%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.modal-box p { font-size: 0.82rem; color: var(--text-3); margin-bottom: 20px; line-height: 1.5; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 10px 24px; border-radius: var(--radius);
  background: var(--green); color: #fff; font-size: 0.84rem; font-weight: 600;
  opacity: 0; transition: all 0.35s ease; z-index: 400;
  pointer-events: none; box-shadow: 0 4px 16px rgba(10,138,74,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); box-shadow: 0 4px 16px rgba(220,38,38,0.3); }

/* ===== TIMELINE BAR ===== */
.timeline-bar {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2);
}
.timeline-segment {
  height: 100%; transition: width 0.3s ease; position: relative; cursor: pointer;
}
.timeline-segment:hover { opacity: 0.8; }
.timeline-segment:hover::after {
  content: attr(data-label);
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 3px 10px; border-radius: 5px;
  font-size: 0.68rem; white-space: nowrap; z-index: 10; pointer-events: none;
}

/* ===== LOADING ===== */
.loading-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--green);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading {
  display: flex; align-items: center; justify-content: center;
  height: 300px; color: var(--text-3); font-size: 0.85rem; gap: 10px;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; margin-bottom: 20px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shotAppear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.4s ease forwards; opacity: 0; }
.delay-1 { animation-delay: 0.06s; } .delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; } .delay-4 { animation-delay: 0.24s; }

/* ===== TOUCH & ACTIVE STATES ===== */
* { -webkit-tap-highlight-color: transparent; }
.btn-primary:active, .btn-approve:active, .btn-submit:active { transform: scale(0.97); box-shadow: none; }
.btn-secondary:active { background: var(--surface-3); }
.btn-danger:active { background: var(--red-bg); }
.btn-green-outline:active { background: var(--green-pale); }
.btn-revise:active { background: var(--orange-bg); }

/* ===== RESPONSIVE — 768px ===== */
@media (max-width: 768px) {
  .topbar {
    padding: 10px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 0;
  }
  .topbar-left {
    display: contents;
  }
  .topbar-logo { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  .topbar-nav {
    order: 3;
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    padding: 6px 0 2px;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-nav a { white-space: nowrap; }
  .shot-body { grid-template-columns: 1fr; }
  .user-menu { max-width: calc(100vw - 32px); right: 0; }
  .modal-box { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; }
  .confirm-box { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; }
}

/* ===== RESPONSIVE — 480px ===== */
@media (max-width: 480px) {
  .topbar { padding: 8px 12px; }
  .topbar-nav a { padding: 5px 10px; font-size: 0.78rem; }
  .btn { padding: 7px 14px; font-size: 0.78rem; }
  .form-input { padding: 9px 12px; font-size: 0.85rem; }
  .comment-item { padding: 10px; gap: 8px; }
  .comment-avatar { width: 24px; height: 24px; font-size: 0.58rem; }
  .confirm-box { padding: 22px 20px; }
  .modal-box { padding: 24px 20px; }
}

/* ===== MOBILE-ONLY — touch devices ===== */
@media (hover: none) {
  .comment-delete { opacity: 0.45; }
  .comment-item:active .comment-delete { opacity: 1; }
  .attachment-thumb .remove-att { display: flex; }
  .attachment-file .remove-att { display: inline; }
  .review-att-thumb .remove-att { display: flex; }
  .review-att-file .remove-att { display: inline; }
  .shot-action-btn { color: var(--text-3); }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.share-role-btn { transition: var(--transition); }
.share-role-btn.active { background: var(--green-pale); color: var(--green); border-color: var(--green); }
.share-role-btn.active:hover { background: var(--green-pale); }
