/* ==========================================================================
   端點星基地｜機密站內信系統 (Commander Interstellar Inbox) - 樣式表
   深空賽博龐克 HUD 視覺風格 / 現代化三欄分割閱讀架構
   ========================================================================== */

:root {
  --bg-deep: #030712;
  --bg-dark: #070d1e;
  --bg-surface: #0b152d;
  --bg-panel: rgba(13, 24, 49, 0.85);
  --bg-panel-hover: rgba(22, 38, 77, 0.9);
  --bg-active: rgba(30, 58, 110, 0.6);
  --bg-glass: rgba(11, 21, 45, 0.75);

  --border-dim: rgba(70, 100, 150, 0.2);
  --border-glow: rgba(56, 239, 125, 0.4);
  --border-cyan: rgba(112, 228, 255, 0.35);

  --accent-cyan: #70e4ff;
  --accent-green: #38ef7d;
  --accent-yellow: #ffd166;
  --accent-red: #ff5252;
  --accent-purple: #c084fc;

  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38ef7d;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft JhengHei", sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-hud: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 1px rgba(112, 228, 255, 0.25);
  --shadow-glow: 0 0 20px rgba(56, 239, 125, 0.25);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(56, 239, 125, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 自訂捲軸 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(3, 7, 18, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(70, 100, 150, 0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* ==========================================================================
   頂部導航 HUD
   ========================================================================== */
.inbox-header {
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0e7490, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 239, 125, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.commander-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-sub);
  background: rgba(14, 165, 233, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.commander-tag strong {
  color: var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 按鈕樣式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  border-color: rgba(112, 228, 255, 0.5);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #0891b2);
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-main);
  border-color: var(--border-dim);
}
.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: var(--border-cyan);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #020617;
  font-weight: bold;
}
.btn-accent:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
  border-color: #ef4444;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-dim);
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  background: rgba(51, 65, 85, 0.8);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   收件匣核心容器：三欄分割閱讀架構
   ========================================================================== */
.inbox-workspace {
  flex: 1;
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* 1. 左側導航欄 (Sidebar) */
.inbox-sidebar {
  width: 250px;
  background: var(--bg-dark);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 0.8rem;
  flex-shrink: 0;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0.8rem 0.6rem 0.4rem;
}

.nav-folder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-folder-item:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.nav-folder-item.active {
  background: var(--bg-active);
  color: var(--accent-cyan);
  font-weight: 600;
  border-left-color: var(--accent-cyan);
}

.nav-folder-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.folder-badge {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: bold;
}
.folder-badge.badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #ff6b6b;
}

.sidebar-stats-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.storage-status-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-green);
  font-size: 0.75rem;
}

/* 2. 中間信件列表欄 (Message List Pane) */
.inbox-list-pane {
  width: 380px;
  border-right: 1px solid var(--border-dim);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.list-pane-header {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(11, 21, 45, 0.4);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  background: rgba(7, 13, 30, 0.8);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(112, 228, 255, 0.2);
}

.list-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.priority-filter-select {
  background: rgba(7, 13, 30, 0.8);
  border: 1px solid var(--border-dim);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  outline: none;
}

/* 信件卡片清單 */
.messages-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.msg-card {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(70, 100, 150, 0.15);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  border-left: 3px solid transparent;
}

.msg-card:hover {
  background: rgba(22, 38, 77, 0.5);
}

.msg-card.active {
  background: var(--bg-active);
  border-left-color: var(--accent-cyan);
}

.msg-card.is-unread {
  background: rgba(14, 165, 233, 0.05);
}
.msg-card.is-unread .msg-card-subject {
  font-weight: 700;
  color: #fff;
}
.msg-card.is-unread::after {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.msg-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sender-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.msg-sender-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-planet-chip {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  white-space: nowrap;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.msg-card-subject {
  font-size: 0.88rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-card-snippet {
  font-size: 0.78rem;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.msg-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
}

/* 優先級 Badge */
.priority-pill {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.priority-pill.urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.priority-pill.tech {
  background: rgba(255, 209, 102, 0.18);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.35);
}
.priority-pill.collab {
  background: rgba(192, 132, 252, 0.2);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
}
.priority-pill.routine {
  background: rgba(56, 239, 125, 0.15);
  color: #38ef7d;
  border: 1px solid rgba(56, 239, 125, 0.35);
}

.card-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.star-icon-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.star-icon-btn:hover {
  transform: scale(1.15);
  color: var(--accent-yellow);
}
.star-icon-btn.starred {
  color: var(--accent-yellow);
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
}

/* 3. 右側閱讀詳情欄 (Detail Reading Pane) */
.inbox-detail-pane {
  flex: 1;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* 空白狀態 */
.empty-reading-state {
  margin: auto;
  text-align: center;
  max-width: 450px;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-radar-icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  opacity: 0.8;
  filter: drop-shadow(0 0 15px rgba(112, 228, 255, 0.3));
}

.empty-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* 詳情閱讀內容區 */
.message-detail-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-top-toolbar {
  padding: 0.85rem 1.8rem;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(11, 21, 45, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-content-area {
  padding: 2rem 2.5rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.detail-subject-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.detail-subject-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  letter-spacing: 0.3px;
}

.detail-meta-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  font-size: 0.85rem;
}

.meta-field-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.meta-field-value {
  color: var(--text-main);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-body-container {
  background: rgba(13, 24, 49, 0.45);
  border: 1px solid rgba(70, 100, 150, 0.2);
  border-radius: var(--radius-md);
  padding: 2rem;
  line-height: 1.8;
  font-size: 1rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 指揮官備忘錄專區 */
.commander-notes-card {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.15), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid rgba(70, 100, 150, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  font-family: var(--font-sans);
}
.notes-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(112, 228, 255, 0.25);
}

/* ==========================================================================
   指揮官量子驗證終端 (Clearance Gateway)
   ========================================================================== */
.gateway-wrapper {
  margin: auto;
  width: 100%;
  max-width: 480px;
  padding: 2rem 1.5rem;
}

.gateway-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(14, 165, 233, 0.15);
  position: relative;
  overflow: hidden;
}

.gateway-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0e7490, #10b981, #70e4ff);
}

.gateway-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ff6b6b;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  margin-bottom: 1.2rem;
}

.gateway-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #fff;
}

.gateway-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(112, 228, 255, 0.25);
}

.gateway-tip {
  margin-top: 1.2rem;
  padding: 0.75rem;
  background: rgba(255, 209, 102, 0.08);
  border-left: 3px solid var(--accent-yellow);
  font-size: 0.78rem;
  color: #ffd166;
  line-height: 1.5;
}

/* ==========================================================================
   發送信件頁面 / 視窗 (Send Mail Modal / Send.php)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 239, 125, 0.15);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Toast 提示 */
.inbox-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  font-size: 0.9rem;
}
.inbox-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* 響應式佈局 */
@media (max-width: 992px) {
  .inbox-sidebar {
    width: 200px;
  }
  .inbox-list-pane {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .inbox-workspace {
    position: relative;
  }
  .inbox-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -260px;
    z-index: 90;
    transition: var(--transition);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
  }
  .inbox-sidebar.open {
    left: 0;
  }
  .inbox-list-pane {
    width: 100%;
  }
  .inbox-detail-pane {
    position: absolute;
    inset: 0;
    z-index: 80;
    transform: translateX(100%);
    transition: var(--transition);
  }
  .inbox-detail-pane.open {
    transform: translateX(0);
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   視圖切換標籤 (View Tabs)
   ========================================================================== */
.view-tabs {
  display: flex;
  align-items: center;
  background: rgba(7, 13, 30, 0.85);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.view-tab-btn {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-sub);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
}

.view-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.view-tab-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(56, 239, 125, 0.18));
  color: var(--accent-cyan);
  border: 1px solid rgba(112, 228, 255, 0.4);
  box-shadow: 0 0 12px rgba(112, 228, 255, 0.25);
}

.view-container {
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

