 /* 基礎變數與通用設定 */
 :root {
   --primary-color: #2563eb;
   --success-color: #16a34a;
   --error-color: #ef4444;
   --border-color: #e2e8f0;
   --bg-slate: #f8fafc;
   --text-slate: #1e293b;
 }

 body {
   font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans TC", sans-serif;
   max-width: 900px;
   margin: 24px auto;
   padding: 0 12px;
   background-color: var(--bg-slate);
   color: var(--text-slate);
 }

 /* 輸入框與按鈕通用樣式 */
 input,
 button,
 select {
   font-size: 16px;
   padding: 12px;
   border: 1px solid #ddd;
   border-radius: 10px;
   outline: none;
   transition: all 0.2s ease;
 }

 /* Editor.js 容器 */
 #editor {
   border: 1px solid var(--border-color);
   border-radius: 14px;
   padding: 20px;
   min-height: 400px;
   background: #fff;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 }

 /* 佈局行 (Row) */
 .row {
   display: flex;
   gap: 12px;
   margin: 10px 0;
 }

 .row>* {
   flex: 1;
 }

 /* 優化下拉選單樣式 */
 .row select {
   appearance: none;
   -webkit-appearance: none;
   background-color: #ffffff;
   border-color: var(--border-color);
   color: #475569;
   cursor: pointer;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 12px center;
   background-size: 16px;
   padding-right: 40px;
 }

 .row select:hover {
   border-color: #cbd5e1;
   background-color: var(--bg-slate);
 }

 .row select:focus {
   border-color: var(--primary-color);
   box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
 }

 /* 警告標語 */
 .warning-text {
   font-size: 13px;
   color: var(--error-color);
   margin: -5px 0 15px 5px;
   font-weight: 500;
   display: flex;
   align-items: center;
   gap: 4px;
 }

 /* 操作按鈕區域 */
 .actions {
   display: flex;
   gap: 12px;
   align-items: center;
   margin-top: 20px;
 }

 /* 主按鈕 (發佈/儲存) */
 #publish,
 #save {
   background: var(--primary-color);
   color: white;
   border: none;
   font-weight: 600;
   cursor: pointer;
   padding: 12px 30px;
 }

 #publish:disabled,
 #save:disabled {
   background: #94a3b8;
   cursor: not-allowed;
 }

 /* 刪除按鈕 (編輯頁面用) */
 #del {
   background: #fff;
   border: 1px solid #fca5a5;
   color: #dc2626;
   cursor: pointer;
 }

 #del:hover {
   background: #fef2f2;
 }

 /* 懸浮狀態通知框 (發佈/上傳) */
 #uploadStatus,
 #statusBox {
   display: none;
   position: fixed;
   top: 30px;
   left: 50%;
   transform: translateX(-50%);
   z-index: 9999;
   min-width: 280px;
   padding: 14px 24px;
   border-radius: 50px;
   background: white;
   box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
   border: 1px solid #eee;
   text-align: center;
   font-weight: 500;
   transition: all 0.3s ease;
   opacity: 0;
 }

 .uploading {
   background: #fffbe6;
   color: #856404;
   border-color: #ffe58f;
 }

 .success {
   background: #f6ffed;
   color: #52c41a;
   border-color: #b7eb8f;
 }

 .error {
   background: #fff2f0;
   color: #ff4d4f;
   border-color: #ffccc7;
 }

 /* 發佈成功結果框 (發佈頁面用) */
 .box {
   background: #fff;
   border: 1px solid var(--border-color);
   border-radius: 14px;
   padding: 20px;
   margin-top: 20px;
   display: none;
 }

 .url-item {
   display: flex;
   align-items: center;
   gap: 8px;
   margin-bottom: 8px;
 }

 code {
   word-break: break-all;
   background: #f1f5f9;
   padding: 4px 8px;
   border-radius: 4px;
   flex: 1;
 }

 .copy-btn {
   padding: 4px 12px;
   font-size: 12px;
   cursor: pointer;
   background: #f1f5f9;
   border: 1px solid var(--border-color);
   white-space: nowrap;
 }

 /* 影片預覽 */
 video {
   display: none;
   border-radius: 8px;
   background: #000;
   margin-top: 10px;
   width: 100%;
 }

 /* 手機版適應 */
 @media (max-width: 600px) {
   .row {
     flex-direction: column;
   }

   .actions {
     flex-direction: column;
     align-items: stretch;
   }

   #publish,
   #save,
   #del {
     width: 100%;
   }
 }

 /* 文章網址列專屬樣式 */
 .url-preview-row {
   align-items: center;
   /* 垂直置中 */
   gap: 12px;
   margin-bottom: 20px;
 }

 .url-preview-row b {
   flex: none;
   /* 固定標題寬度 */
   color: #1e293b;
 }

 #displayViewUrl {
   background: #f1f5f9;
   /* 淺灰色背景 */
   color: #334155;
   padding: 6px 12px;
   border-radius: 6px;
   border: 1px solid #e2e8f0;
   font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
   font-size: 14px;
   flex: 1;
   /* 網址框自動伸展 */
   word-break: break-all;
 }

 #goToView {
   flex: none;
   color: #2563eb;
   /* 連結顏色 */
   text-decoration: none;
   /* 移除底線 */
   font-size: 15px;
   font-weight: 500;
   display: inline-flex;
   align-items: center;
   gap: 4px;
 }

 /* 如果希望滑鼠移上去時也不要有底線，可以加上這段 */
 #goToView:hover {
   text-decoration: none;
   filter: brightness(1.2);
   /* 稍微變亮作為視覺回饋 */
 }

 /* 定義閃爍與高亮動畫 */
@keyframes highlight-glow {
  0% {
    background-color: transparent;
    border-color: #ddd;
    box-shadow: none;
  }
  20% {
    background-color: #f0fdf4; /* 淡淡的綠色背景 */
    border-color: #22c55e;    /* 綠色邊框 */
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
  }
  100% {
    background-color: transparent;
    border-color: #ddd;
    box-shadow: none;
  }
}

.highlight-flash {
  /* 讓動畫跑 2 次，每次 1.5 秒，這看起來像閃動 */
  animation: highlight-glow 1.5s ease-in-out 2;
  border: 2px solid transparent; /* 預留邊框空間防止跳動 */
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
}



.url-card {
    background: #f0fdf4; /* 剛才推薦的質感綠 */
    border: 1px solid #dcfce7;
    border-radius: 12px;
    padding: 16px;
    margin: 15px 0;
}

.url-label {
    font-size: 0.85rem;
    color: #166534;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

.url-body {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 10px;
}

#displayViewUrl {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    color: #334155;
    overflow-x: auto; /* 手機版可以左右滑動網址，不會撐開畫面 */
    white-space: nowrap;
    /* 隱藏捲軸但保留功能 (選配) */
    scrollbar-width: none; 
}

.copy-mini-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.url-footer {
    margin-top: 10px;
    text-align: right;
}

#goToView {
    text-decoration: none;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 500;
}