@charset "UTF-8";

/* --- Design System Tokens (Hero-Centric Red & Black) --- */
:root {
    --primary-red: #c3424f; /* 更淺淡江紅，減少暗度 */
    --primary-red-hover: #9c192b; /* 稍深的紅，保持互動對比 */
    --secondary-red: #e5e7eb; /* Secondary */

    --dark-bg: #ffffff; /* White background for Sidebar */
    --dark-bg-hover: #f9fafb; /* Slightly darker white for Sidebar Item Hover */
    --sidebar-submenu-bg: #ffffff; /* Submenu background */

    --body-bg: #fdfbf7; /* 暖紙張背景 */
    --text-dark: #2d2926; /* Text from template */
    --text-muted: #6b7280; /* Gray muted text */
    /* Sidebar Text Variables */
    --sidebar-text: #2d2926;
    --sidebar-text-muted: #6b7280;
    --border-color: #f3f4f6; /* Soft gray border */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-brand: "Noto Serif TC", serif;
    --font-body: "Inter", -apple-system, sans-serif;
    --sidebar-width: 256px;
    --header-height: 72px;
    --transition-speed: 0.4s;
}

/* --- Base Typography & Reset --- */
body,
html {
    font-family: var(--font-body);
    background-color: var(--body-bg);
    color: var(--text-dark);
    height: 100%;
}

.brand-font {
    font-family: var(--font-brand);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-brand);
    color: #111;
    font-weight: 700;
}

a {
    color: var(--primary-red);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-red-hover);
}

/* Overriding Bootstrap Primary */
.text-primary {
    color: var(--primary-red) !important;
}

.bg-primary {
    background-color: rgba(157, 34, 53, var(--bs-bg-opacity, 1)) !important;
}

.btn-primary {
    background-color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
    color: #fff;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-red-hover) !important;
    border-color: var(--primary-red-hover) !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.25);
}

.btn-outline-primary {
    color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-outline-primary:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-red);
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25);
}

/* --- CMS Layout Structure --- */
.cms-body {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.cms-sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(157, 34, 53, 0.04), rgba(157, 34, 53, 0.01));
    color: var(--sidebar-text);
    border-right: 1px solid var(--border-color);
    transition: all var(--transition-speed);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cms-sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.cms-sidebar .sidebar-header {
    height: var(--header-height) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--border-color) !important;
    background: linear-gradient(180deg, rgba(157, 34, 53, 0.04), rgba(157, 34, 53, 0.02)) !important;
    position: relative;
    overflow: hidden;
}

.cms-sidebar .sidebar-header img {
    max-height: 44px !important;
    z-index: 2;
}

/* Custom Sidebar Utilities */
.sidebar-text {
    color: var(--sidebar-text) !important;
}

.sidebar-text-muted {
    color: var(--sidebar-text-muted) !important;
}

.sidebar-submenu-bg {
    background-color: var(--sidebar-submenu-bg) !important;
    border: 1px solid var(--border-color);
}

.cms-sidebar .sidebar-header h5 {
    color: #FDE7B9 !important; /* 與 page-hero 一致的香檳金 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cms-sidebar .components {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.cms-sidebar .cms-nav-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.cms-sidebar .cms-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 1.25rem !important; /* 微小的左移互動 */
}

.cms-sidebar .cms-nav-link:hover,
.cms-sidebar .dropdown-toggle[aria-expanded="true"] {
    background-color: var(--dark-bg-hover);
    color: var(--primary-red-hover) !important;
}

.cms-sidebar .cms-nav-link.active {
    background-color: var(--primary-red);
    color: #fff !important;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.hover-bg-primary:hover {
    background-color: var(--primary-red) !important;
    color: #fff !important;
}

/* Navbar Header (Top navigation area with image) */
.cms-header {
    height: var(--header-height) !important;
    min-height: var(--header-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    /* 科技感深紅漸層 */
    background: linear-gradient(135deg, var(--primary-red) 0%, #7a1a29 100%) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(157, 34, 53, 0.2) !important;
}

.cms-header .container-fluid {
    position: relative;
    z-index: 10;
}

.cms-header h4 {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cms-header .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.cms-header .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

/* 側邊欄收合按鈕 - 針對深色背景優化 */
#sidebarCollapse {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    box-shadow: none;
    transition: all 0.2s;
}

#sidebarCollapse:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
    color: #ffffff !important;
    transform: scale(1.05);
}

/* Main Content Area */
.cms-content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
}

/* Cards & UI Elements */
.card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-brand);
    font-weight: 700;
}

/* DataTable Customization */
.table {
    border-color: var(--border-color);
}

.table > thead {
    background-color: #fcebeb;
    color: var(--text-dark);
    border-bottom: 2px solid var(--secondary-red);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--body-bg);
}

/* Badges */
.badge.bg-success {
    background-color: #059669 !important;
}

.badge.bg-warning {
    background-color: #d97706 !important;
    color: #fff;
}

/* Utility */
.cursor-pointer {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cms-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        position: absolute;
        height: 100vh;
    }

    .cms-sidebar.active {
        margin-left: 0;
        box-shadow: var(--shadow-lg);
    }

    .cms-content {
        width: 100%;
    }
}

/* ==========================================================
   TKU Modern — 共用元件 (Paper / News / 全站重複使用)
   ========================================================== */

/* --- 頁面標題 Hero 區 --- */
.page-hero {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-red-hover));
    border-radius: 1rem;
    color: #fff;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none; /* 確保裝飾層不會擋住按鈕點擊 */
}
.page-hero h2 {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
    color: #FDE7B9; /* 優雅香檳金 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.page-hero .subtitle {
    opacity: 0.8;
    font-size: 0.875rem;
}
.page-hero .badge-info {
    background: rgba(255,255,255,0.2);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* --- 舊式頁面標題 (Paper 系列兼容) → 統一為 page-header --- */
.page-header h2 {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}
.page-header .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- 面板卡片 --- */
.panel-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 1rem;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.06);
    overflow: hidden;
}
.panel-card:hover {
    transform: none; /* 覆蓋全域 .card:hover 上移 */
}
.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header h5 {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0;
    color: var(--text-dark);
}
.panel-header .count-badge {
    background: rgba(157,34,53,0.08);
    color: var(--primary-red);
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.panel-body {
    padding: 1rem 1.5rem;
    max-height: 65vh;
    overflow-y: auto;
}

/* --- 篩選搜尋列 --- */
.filter-bar {
    position: relative;
    margin-bottom: 1.25rem;
}
.filter-bar input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 0.875rem;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(157,34,53,0.08);
}
.filter-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
}

/* --- 期數 / 篩選選擇器列 --- */
.paper-selector {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.06);
}

/* --- 表格卡片 (DataTable 容器) --- */
.table-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 1rem;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.06);
    overflow: hidden;
}
.table-card:hover {
    transform: none;
}
.table-card .card-body {
    padding: 1.5rem;
}

/* DataTable 搜尋/長度選單覆寫 */
.dataTables_filter input {
    border-radius: 999px !important;
    border: 1px solid #e5e7eb !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.875rem !important;
}
.dataTables_filter input:focus {
    border-color: var(--primary-red) !important;
    box-shadow: 0 0 0 3px rgba(157,34,53,0.08) !important;
    outline: none;
}
.dataTables_length select {
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    padding: 0.3rem 0.5rem !important;
}

/* DataTable 表頭樣式 */
.table-tku thead th {
    background: #fdfbf7;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
}
.table-tku tbody td {
    font-size: 0.875rem;
    vertical-align: middle;
    border-bottom: 1px solid #f7f7f7;
}
.table-tku tbody tr:hover {
    background-color: rgba(157,34,53,0.03) !important;
}

/* --- 標題欄 (表格內) --- */
.cell-title {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-dark);
}
.cell-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}
.cell-title a:hover {
    color: var(--primary-red);
}

/* --- Badge 系列 --- */
.badge-typ {
    background: rgba(157,34,53,0.08);
    color: var(--primary-red);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-lang {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-lang-zh { background: #dbeafe; color: #1e40af; }
.badge-lang-en { background: #fef3c7; color: #92400e; }
.badge-img {
    background: #f0fdf4;
    color: #166534;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-sdgs {
    background: #f0f9ff;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    margin: 1px 2px;
}
.badge-md {
    background: #f5f3ff;
    color: #7c3aed;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* --- 操作按鈕 --- */
.btn-action-sm {
    width: 32px; height: 32px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 0;
    text-decoration: none;
}
.btn-action-sm:hover {
    background: #f9fafb;
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* --- 底部操作列 --- */
.action-bar {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.btn-save {
    background: var(--primary-red);
    color: #fff;
    border: none;
    padding: 0.65rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.btn-save:hover:not(:disabled) {
    background: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(157,34,53,0.3);
}
.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-back {
    background: transparent;
    border: 1px solid #d1d5db;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.btn-back:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: var(--text-dark);
}

/* --- 空狀態 --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.4;
}
.empty-state p {
    font-size: 0.875rem;
}

/* --- Vue v-cloak --- */
[v-cloak] {
    display: none !important;
}

/* --- UI Helper Classes (Tailwind-like) --- */
.bg-white-10 { background-color: rgba(255, 255, 255, 0.1) !important; }
.bg-white-20 { background-color: rgba(255, 255, 255, 0.2) !important; }
.bg-black-10 { background-color: rgba(0, 0, 0, 0.1) !important; }
.bg-black-20 { background-color: rgba(0, 0, 0, 0.2) !important; }
.border-white-10 { border-color: rgba(255, 255, 255, 0.1) !important; }
.border-white-20 { border-color: rgba(255, 255, 255, 0.2) !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.5) !important; }
.text-white-80 { color: rgba(255, 255, 255, 0.8) !important; }
.text-glow { text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }

/* Navbar Toggler for dark gradient background */
.cms-header .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.cms-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}
