:root {
	--bg-main: #f5f7fa;
	--bg-card: #ffffff;
	--bg-header: #1c1c1e;
	--bg-nav: #c6ddfb;
	--bg-search: #ffffff;
	--color-bg: #f5f7fa;
	--color-bg-secondary: #f8fafc;
	--color-card: #ffffff;
	--color-card-secondary: #f1f5f9;
	--color-text: #0f172a;
	--color-text-muted: #334155;
	--color-text-secondary: #eee;
	--text-main: #374151;
	--color-primary: #1e40af;
	--color-primary-hover: #1e3a8a;
	--color-border: rgba(15,23,42,.15);
	--border-color: rgba(15,23,42,.12);
	--shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
	--shadow-large: 0 10px 30px rgba(0,0,0,0.09);
}

/* 黑夜模式 */
body.dark {
	--bg-main: #0a0a0c;
	--bg-card: #1c1c1e;
	--bg-header: #000000;
	--bg-nav: #2c2c2e;
	--bg-search: #111827;
	--color-bg: #0b1220;
	--color-bg-secondary: #111827;
	--color-card: #172033;
	--color-card-secondary: #1d2940;
	--color-text: #f3f4f6;
	--color-text-muted: #9ca3af;
	--text-main: #eee;
	--color-primary: #38bdf8;
	--color-primary-hover: #0ea5e9;
	--color-border: rgba(255,255,255,.08);
	--border-color: rgba(255,255,255,.08);
	--shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
	--shadow-large: 0 10px 30px rgba(0,0,0,.35);
}

/* 黑夜模式下，自動調包限免卡片的變數數值 */
body.dark .software-card[style*="--lf-bg"],
body.dark .sidebar-card[style*="--lf-bg"] {
    background: var(--lf-dark-bg) !important;
    border-color: var(--lf-dark-border) !important;
}

html {
	font-size: 16px; 
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans TC", system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	background: var(--color-bg);
	color: var(--color-text);
}

/* --- 連結與選單動畫 --- */
a {
	position: relative;
	text-decoration: none;
	color: var(--color-primary);
	transition: opacity 0.2s ease;
}

a:hover {
	opacity: 0.8;
}

li.dropdown a, .dropdown-content a {
	position: relative;
	display: inline-block;
}

a::after { 
	content: '';
	position: absolute;
	width: 98%;
	height: 2px;
	bottom: -2px;
	left: 1%;
	background: #3498db;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease; 
}

a:hover::after { 
	transform: scaleX(1);
	transform-origin: left; 
}

ul {
    margin: 10px 0 10px 20px;
    padding: 0;
	}
.category-container ul {
	    margin: 0;
	}
	
	
/* --- Header 區塊 --- */
.header {
	padding: 32px 110px 28px 40px;
	border-bottom: 1px solid var(--color-border);
	background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #60a5fa 100%);
}

body.dark .header {
	background: linear-gradient(135deg, #0f172a 0%, #1e2937 50%, #334155 100%);
}

.header__topbar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 32px;
	max-width: 1400px;
	margin: 0 auto;
}

.header__logo-area { 
	display: flex; 
	align-items: center; 
	gap: 18px; 
}

.header__logo {
	display: grid; 
	align-items: center; 
	justify-content: center;
	gap: 6px; 
}
.header__logo p a {
	color: #fff;
	}

.logo-img { 
	height: 80px; 
	width: 110px; 
}

.header__title h1 { 
	font-size: 34px; 
	font-weight: 800; 
	letter-spacing: -0.5px; 
}

.header__title h1 a { 
	color: #ffffff;
}

.header__title p, .header__title p a { 
	margin-top: 6px; 
	font-size: 15px; 
	color: #ffffff !important;
}
#online-users {
	color: #fff;
	}

#limit-free { display: none; }

/* --- 搜尋區塊 --- */
.search { 
	flex: 1; 
	max-width: 780px; 
	margin: 0 auto; 
}

.search__box {
	display: flex; 
	border-radius: 9999px;
	border: 1px solid var(--color-border);
	background: var(--bg-search);
	box-shadow: 0 4px 15px rgba(0,0,0,.08);
	overflow: visible !important; 
	position: relative; 
}

.search__input {
	flex: 1; 
	border: none; 
	outline: none; 
	background: transparent;
	padding: 18px 26px 18px 15px !important; 
	font-size: 1rem;
	border-radius: 9999px 0 0 9999px; 
}

.search__select-wrapper {
	border-right: 1px solid var(--color-border, #eee);
	padding: 0 10px;
	display: flex;
	align-items: center;
}

.search__select {
	border: none;
	background: transparent;
	font-size: 14px;
	color: #666;
	outline: none;
	cursor: pointer;
}

.search__button {
	width: 76px;
	background: var(--color-primary);
	color: white;
	border: none;
	font-size: 20px;
	cursor: pointer;
	transition: all 0.3s ease;
	border-radius: 0 9999px 9999px 0;
	flex-shrink: 0 !important; 
}

.web_function {
    display: flex;
    gap: 16px;              /* 兩個連結之間的間距 */
    margin-top: 10px;       /* 與上方搜尋框的距離，微微微調更和諧 */
    padding-left: 4px;      /* 對齊搜尋框內縮 */
    align-items: center;
}

.web_function span {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.web_function a {
    color: #ffffff;                          /* 👑 完全依據指示：更改為純白色 */
    font-size: 14px;                         /* 適中的字體大小 */
    font-weight: 700;                        /* 👑 完全依據指示：改為粗字體 */
    text-decoration: none;                   /* 移除預設下底線 */
    transition: opacity 0.2s ease;           /* 白字改用透明度過渡，視覺感更高級 */
    padding: 2px 0;
}

/* 👑 優化 Font Awesome 6 圖示與中文字之間的右邊距 */
.web_function a i {
    margin-right: 6px;
    font-size: 13px;                         /* 圖示微調至與文字視覺等高 */
}

/* 滑鼠懸停（Hover）時的視覺變化 */
.web_function a:hover {
    opacity: 0.85;                           /* 懸停時優雅地呈現微微透光感 */
}

/* 精緻的底部白色裝飾線效果（滑鼠移入時由中間向兩旁展開） */
.web_function a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #ffffff;               /* 👑 裝飾底線同步改為純白色 */
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.web_function a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 在兩個連結中間加上精緻的垂直分隔線 */
.web_function span:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3); /* 👑 分隔線同步改為半透明白色，完美融入深色背景 */
    position: absolute;
    right: -9px;                                /* 剛好落在 gap 16px 的正中央 */
    top: calc(50% - 6px);
}

/* 👑 [新增欄位容器]：外層包裹網格/彈性排版，寬螢幕時撐滿並將左右拉開 */
.special-nav {
    display: flex;
    justify-content: space-between; /* 關鍵：左邊靠左，右邊靠右 */
    align-items: center;
    gap: 1.5rem;
    margin-top: 10px;
    padding: 5px 10px;
    width: 100%;
}

/* 👑 [新增個人功能欄]：樣式完全對齊 os-nav */
.personal-nav {
    display: flex;
    gap: 1.15rem;
    align-items: center;
}

/* 👑 [顏色與體積一致性校對]：讓個人功能的 i 圖標與 OS 的 a 連結外觀 100% 同步 */
.personal-nav i {
    color: #f3f3f3;
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.personal-nav i:hover {
    color: #ffd700;
    transform: scale(1.1);
}

/* OS 導覽列美化（100% 保持原代碼核心屬性） */
.os-nav {
    display: flex;
    gap: 1.15rem;
    /* margin-top 與 padding 移至外層 special-nav 統一管理，保持視覺不拉扯 */
    border-radius: 8px;
    justify-content: flex-end; /* 寬螢幕時保持靠右對齊 */
}

.os-nav a {
    color: #f3f3f3;
    font-size: 1.75rem;
    transition: color 0.3s, transform 0.2s;
    text-decoration: none;
}

.os-nav a:hover {
    color: #ffd700;
    transform: scale(1.1);
}

/* 考慮到深色模式切換，顏色微調（將個人功能一併納入對齊） */
body.dark .os-nav a,
body.dark .personal-nav i {
    color: #aaa;
}
body.dark .os-nav a:hover,
body.dark .personal-nav i:hover {
    color: #fff;
}

/* 👑 [新增響應式守門員]：當螢幕小於 768px 時，打破雙欄結界，安全降級為單欄上下排列 */
@media (max-width: 768px) {
    .special-nav {
        flex-direction: column; /* 兩欄變一欄 */
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }
    
    .personal-nav, 
    .os-nav {
        justify-content: center; /* 行動裝置上水平置中，防止右傾歪斜 */
        width: 100%;
    }
}
.category-info .os-nav a {
    color: #828387;
}

body.dark .search__button {
	background: #1e40af;
}

body.dark .search__button:hover {
	background: #1e3a8a;
}

/* 搜尋預覽面板 */
.search-preview {
	position: absolute !important;
	top: calc(100% + 10px) !important;
	left: 10px;
	right: 10px;
	z-index: 99999 !important;
	background: var(--bg-card); 
	border: 1px solid var(--color-border);
	border-radius: 12px;
	box-shadow: var(--shadow-large);
	display: none; 
	max-height: 400px;
	overflow-y: auto;
	padding: 8px; 
}

.preview-item {
	padding: 12px 18px !important;
	cursor: pointer !important;
	transition: background 0.2s ease !important;
	display: block !important; 
	border-bottom: 1px solid rgba(0,0,0,0.05) !important; 
}

.preview-item:hover {
	background: #f8fafc !important; 
}

body.dark .preview-item {
	border-bottom-color: rgba(255,255,255,0.08) !important;
}

body.dark .preview-item:hover {
	background: #1d2940 !important;
}

.preview-item:last-child {
	border-bottom: none !important;
}

/* 搜尋標頭區域 */
.search-header {
	background: var(--color-card); 
	padding: 2rem;
	border-radius: 12px;
	margin-bottom: 2rem;
	box-shadow: 0 4px 6px rgba(0,0,0,0.05);
	border: 1px solid var(--border-color);
	border-left: 5px solid #3498db;
}

.search-header h1 {
	font-size: 1.5rem;
	margin: 0 0 0.5rem 0;
	color: var(--text-main);
	display: flex;
	align-items: center;
	gap: 10px;
}

.search-header .keyword {
	color: #e74c3c; 
	font-weight: 800;
	background: rgba(231, 76, 60, 0.1);
	padding: 2px 8px;
	border-radius: 4px;
}

.search-meta {
	font-size: 0.95rem;
	color: var(--color-text-muted);
	margin: 0;
}

.search-notice {
	padding: 0.8rem 1rem;
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	color: #856404;
	font-size: 1.15rem;
	border-radius: 4px;
}

/* --- 分類導航列 --- */
.category-bar { 
	background-color: var(--bg-nav); 
	border-bottom: 1px solid var(--border-color); 
	position: sticky; 
	top: 0; 
	z-index: 1000; 
}

.menu-toggle { 
	display: none; 
	width: 100%; 
	padding: 12px; 
	background: var(--bg-header); 
	color: white; 
	border: none; 
	font-size: 16px; 
	cursor: pointer; 
}

.category-container { 
	max-width: 1200px; 
	margin: 0 auto; 
}

.category-container ul { 
	display: flex; 
	list-style: none; 
}

.category-bar li { 
	position: relative; 
} 

.category-bar li a { 
	display: block; 
	padding: 12px 18px; 
	color: var(--text-main); 
	text-decoration: none; 
	font-weight: 600; 
	white-space: nowrap; 
}

.dropdown-content {
	display: none; 
	position: absolute; 
	top: 100%; 
	left: 0;
	background-color: var(--color-text-secondary); 
	min-width: 200px;
	box-shadow: var(--shadow); 
	border: 1px solid var(--border-color); 
	z-index: 10001;
}

.dropdown-content a { 
	padding: 10px 15px; 
	font-weight: normal !important; 
	border-bottom: 1px solid var(--border-color); 
}

body.dark .dropdown-content {
	background-color: #1e272e;
	color: #f1f2f6;
}

/* 子分類群組 */
.sub-category-list {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed var(--border-color);
}

.nav-title {
	font-size: 13px;
	color: #888;
	margin-right: 5px;
}

.sub-cat-btn {
	display: inline-block;
	padding: 3px 10px;
	margin: 3px;
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 3px;
	color: #333;
	text-decoration: none;
	font-size: 13px;
}

.sub-cat-btn.is-active {
	background: #ff9800; 
	color: #fff;
	border-color: #e68a00;
	font-weight: bold;
}

.sub-cat-btn:hover:not(.is-active) {
	background: #0056b3;
	color: #fff;
}

body.dark .sub-cat-btn {
    background: var(--color-card-secondary);
    color: var(--color-text);
    border-color: var(--border-color);
	}
	
/* 導航 - 黑夜模式 */
.nav__link {
	font-weight: 700;
	transition: all 0.2s ease;
}

body.dark .nav { 
	background: rgba(15,23,42,.95); 
}

body.dark .nav__link {
	color: #cbd5e1;
}

/* --- 版面主結構 --- */
.layout { 
	max-width: 98%; 
	width: 1580px; 
	margin: 40px auto; 
	padding: 0 24px; 
}

.layout__grid { 
	display: grid; 
	grid-template-columns: 65% 35%; 
	gap: 32px; 
}

/* --- 卡片整體設計 --- */
.software-card, .sidebar-card {
	margin-bottom: 1.5rem;
	border-radius: 24px;
	border: 1px solid var(--color-border);
	background: linear-gradient(180deg, var(--color-card), var(--color-card-secondary));
	overflow: hidden;
	box-shadow: var(--shadow-large);
	transition: all 0.35s ease;
}

.card-body { 
    display: grid;
    padding: 16px; 
	gap: 1px;
	width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-body:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.card-body h3 {
    position: relative;
}

.card-body small {
    /* 在 Grid 佈局中，請改用 justify-self */
    justify-self: end; 
    text-align: right;    
}

.sidebar-card .card-body {
	    display: block;
	}

/* 4:6 左右佈局主容器 */
.card-content {
	display: flex;
	gap: 20px;               
	padding: 15px;
	box-sizing: border-box;
	align-items: center;
	color: #2c3e50;
	min-width: 0;
	overflow-wrap: break-word;
	width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

body.dark .card-content {
	background-color: var(--color-card);
	color: var(--color-text);
}

.software-card .card-content {
	display: flex;
	align-items: flex-start; 
	gap: 20px;
	padding-top: 5px;
	margin-bottom: 12px;
}

.sidebar-card .card-content { 
	flex-direction: column; 
	gap: 20px; 
}

/* 左側圖片區塊 (45%) */
.software-card .card-thumbnail {
	flex: 4.5;               
	min-width: 0;
	width: 100%;
	aspect-ratio: 3 / 2;     
	overflow: hidden;
	background-color: #f8f9fa; 
	box-sizing: border-box;
	flex-shrink: 0;
	border: 1px solid #e9ecef; 
	border-radius: 0.5rem;
	display: flex;
	justify-content: center;
	align-items: center;
}

body.dark .software-card .card-thumbnail {
	background-color: var(--color-card-secondary);
	border-color: var(--border-color);
}

.sidebar-card .card-thumbnail { 
	height: auto; 
	flex: 0 0 100%;
	max-width: 100%;
}

.software-card .card-thumbnail img.software-icon {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center; 
	display: block;
}

.software-icon {
	max-width: 100%;     
	max-height: 100%;    
	object-fit: contain; 
}

/* 右側文字區塊 (55%) */
.software-card .card-description {
	flex: 5.5;
	min-width: 0;
}

.card-description {
	flex: 0 0 55%;
	max-width: 55%;
	display: flex;
	flex-direction: column;
	color: var(--color-text-muted); 
	font-size: 15.5px; 
	line-height: 1.85;
}

.sidebar-card .card-description { 
	height: auto; 
	flex: 0 0 100%;
	max-width: 100%;
}

.highlight-text {
	font-size: 1.15rem;
	font-weight:700;
	margin: 0 0 10px 0;
	line-height: 1.4;
	color: #d53424; 
}

body.dark .highlight-text {
	color: #ff4757; 
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
    color: var(--color-text);
    max-height: 290px;
    overflow: hidden;
}

body.dark .description-text {
	color: #ced4da;
}

/* --- 標籤與徽章管理 --- */
.card-badges { 
	display: flex; 
	gap: 12px; 
	margin-bottom: 20px; 
}

.card-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px; 
	padding: 2px 6px;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: bold;
	margin-bottom: 8px;
	margin-right: 6px;
	color: #fff; 
	vertical-align: middle;
}

.card-badge--headline { background: #ff4500; } 
.card-badge--headline i { color: #ffd700; }    

.card-badge--recommend { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; } 

.card-badge--free { background: #28a745; }    
.card-badge--multi { background: #17a2b8; }   
.card-badge--chinese { background: #007bff; }

.recommend {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: linear-gradient(135deg, #ffd700, #ff8c00);
	color: #000;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: bold;
	margin-bottom: 8px;
	width: fit-content;
}

.recommend i { font-size: 0.7rem; }

.headlines {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #ff4500; 
	color: #fff;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: bold;
	margin-bottom: 8px;
	width: fit-content;
	margin-right: 5px; 
}

.headlines i { color: #ffd700; }

/* 底部標籤區塊 */
.card-tags {
	display: flex;
	gap: 6px;
}

.card-tags .tag {
	background-color: #3f51b5; 
	color: #ffffff;
	padding: 2px 10px;
	border-radius: 12px;      
	font-size: 1rem;          
	font-weight: normal;
	display: inline-block;
	line-height: 1.4;
}

.card-tags .tag:first-child {
	background-color: #d15133; 
}

.card-tags .tag:last-child {
	background-color: #6c757d; 
	opacity: 0.9;
}

/* --- 卡片標題與點擊觸發感 --- */
.card-title {
	display: flex;
	align-items: center;
	gap: 8px; 
	margin: 10px 0;
	text-decoration: none;
	color: #333;                     
}

.software-card .card-title {
	font-size: 1.5em;
}

.sidebar-card .card-title {
	font-size: 1.35em;
}

body.dark .card-title {
	text-decoration: none;
	color: #fff;                     
}

.card_name_icon {
	color: #555;   
	min-width: 20px;
	text-align: center;
}

body.dark .card_name_icon {
		color: #eee;   
	}

.touch-target {
	text-decoration: none !important; 
	display: block;                  
	position: relative;
}

.touch-target:hover .card-title {
	text-decoration: none;           
	opacity: 0.7;                    
	transition: opacity 0.2s;        
}

.touch-target::after {
	content: '';
	position: absolute;
	width: 98%;
	height: 2px;
	bottom: -2px; 
	left: 1%;
	background: #3498db;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}

.touch-target:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

/* --- 卡片底部頁尾與更新時間 --- */
.card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 10px;
	border-top: 1px solid #e5e7eb; 
	margin-top: auto;              
}

body.dark .card-footer {
	border-top: 1px solid var(--border-color); 
}

.card-footer-text {
	font-size: 1rem;
	color: #888;
	font-weight: bold;
	position: relative; 
	overflow: visible;  
}

.card-footer-text a {
	position: relative;
	display: inline-block; 
	text-decoration: none;
}

.card-refresh-date {
	position: relative;
    overflow: visible !important; /* 關鍵：強制顯示容器外內容 */
	color: #a2afb9;
	font-weight: 700;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	font-size: 1.5rem;
}

.card-refresh-date span {
	margin: 0 2px;
	}

/* 增加按鈕的點擊熱區，讓滑鼠更好對準 */
.myfavorite, .remind {
    cursor: pointer;
    display: inline-flex;
    padding: 8px; /* 增加觸控/點擊面積 */
    transition: color 0.2s;
}

.myfavorite.active, .myfavorite.active i,
.remind.active, .remind.active i {
    color: #cc0000 !important; /* 強制變紅 */
}

.remind.active, .remind.active i {
    color: #ff9800 !important; /* 強制變橘 */
}

/* 確保 Tooltip 永遠最上層且文字可見 */
.custom-tooltip {
    display: none;
    position: fixed;
    background: #333 !important;
    color: #fff !important;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 999999 !important;
    pointer-events: none; /* 讓滑鼠穿透 Tooltip 以防干擾按鈕 */
    opacity: 0;
    transition: opacity 0.2s;
}
.custom-tooltip.show {
    display: block;
    opacity: 1;
}

/* 滑鼠移入時顯示 */
.tooltip-container:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

.sidebar-card .card-refresh-date {
	font-size: 1.15rem;
}

/* --- 使用資訊清單排版 --- */
.file_title.use_title {
	/* margin-top: 1rem; */
	/* padding: 0 1rem; */
}

.use_information_ul {
	list-style: none;
	padding: 6px 8px;
	margin: 0;
}

.use_information_ul li {
	display: flex;
	position: relative;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin: 10px 0; 
}

.use_title_link {
	display: inline-flex;
	align-items: center;
	gap: 6px; 
}

.use_title_view {
	margin-left: auto;
	white-space: nowrap; 
}

/* --- 分頁按鈕樣式 --- */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 40px 0;
	padding: 20px;
	width: 100%;       
	flex-wrap: wrap;   
	clear: both;       
}

.pagination button {
	padding: 10px 18px;
	border: 1px solid var(--color-border);
	background: var(--color-card);
	color: var(--color-text);
	cursor: pointer;
	border-radius: 12px;
	font-weight: 600;
	transition: all 0.3s ease;
	min-width: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pagination button.active {
	background: var(--color-primary);
	color: white;
	border-color: var(--color-primary);
	box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.pagination button:hover:not(:disabled):not(.active) {
	background: var(--color-card-secondary);
	border-color: var(--color-primary);
	transform: translateY(-2px);
}

.pagination button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pagination span {
	color: var(--color-text-muted);
	padding: 0 10px;
}

.page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	text-decoration: none;
	color: var(--text-main);
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.page-btn:hover {
	background: #3498db;
	color: #fff;
	border-color: #3498db;
}

.page-btn.active {
	background: #3498db;
	color: #fff;
	border-color: #3498db;
	cursor: default;
}

.dots {
	color: var(--color-text-muted);
	padding: 0 5px;
}

/* --- 管理員齒輪與元件 --- */
.admin-quick-edit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: rgba(255, 0, 0, 0.1); 
	border: 1px solid rgba(255, 0, 0, 0.3);
	border-radius: 4px;
	color: #ff0000;
	text-decoration: none;
	margin-left: 8px;
	transition: all 0.3s ease;
	vertical-align: middle;
}

.admin-quick-edit:hover {
	background: #ff0000;
	color: #ffffff;
	transform: rotate(90deg); 
	box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.admin-quick-edit::before {
	content: '⚙';
	font-size: 16px;
}

.theme-toggle {
	position: fixed;
	top: 8px; right: 40px; z-index: 10000;
	width: 54px; height: 54px;
	border-radius: 16px;
	border: none;
	background: none;
	color: #eee;
	display: flex; align-items: center; justify-content: center;
	font-size: 2rem; cursor: pointer;
	box-shadow: none;
}

#themeToggleButton svg {
	stroke: currentColor; 
}

#themeToggleButton .icon-sun { display: none; }
#themeToggleButton .icon-moon { display: block; }

body.dark #themeToggleButton .icon-sun { display: block; }
body.dark #themeToggleButton .icon-moon { display: none; }

#themeToggleButton:hover {
	--text-main: #2563EB; 
}

body.dark #themeToggleButton:hover {
	--text-main: #FDE68A; 
}

#backToTop {
	position: fixed; bottom: 30px; right: 30px;
	width: 50px; height: 50px;
	background: var(--color-primary); color: white;
	border: none; border-radius: 50%; font-size: 24px;
	cursor: pointer; box-shadow: var(--shadow-large);
	display: none; align-items: center; justify-content: center;
	z-index: 9999;
}

.footer {
	margin-top: 60px;
	padding: 40px 24px;
	text-align: center;
	color: var(--color-text-muted);
	border-top: 1px solid var(--color-border);
}

.mobile-arrow {
	display: none; 
}

.admin-controls {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
	margin-left: 10px;
}

/* 右側教學欄位 */
.tutorial-block { background: var(--bg-card); padding: 15px; border-radius: 24px; border: 1px solid var(--border-color); margin-bottom: 1rem; }
.tutorial-block h2 { font-size: 1.1rem; margin-top: 0; padding-bottom: 5px; border-bottom: 2px solid var(--border-color); color: var(--text-main); display: flex; align-items: center; }
.side_information_ul { list-style: none; padding: 0; margin: 0; }
.side_information_ul li { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(--border-color); }
.side_information_ul a { text-decoration: none; color: var(--text-main); font-size: 0.95rem; }
.side_information_ul a:hover { color: var(--color-primary); }
.fa-lg-blue { color: var(--color-primary); margin-right: 5px; }
.fa-lg-gray { color: var(--color-text-muted); margin-right: 5px; }
.side_information_ul div { position: relative; padding: 0.25rem;}
.side_information_ul li div:nth-child(2) {margin-left: 1.25rem;}

.site-footer {
    background-color: var(--bg-card); /* 對應卡片背景色 */
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 30px 24px;
    transition: var(--ft-transition, all 0.25s ease);
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer-nav {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.site-footer-link {
    display: inline-block;
    color: var(--color-text); /* 對應全站主文字色 */
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    margin: 0 16px;
    transition: var(--ft-transition, all 0.25s ease);
}

.site-footer-link:hover {
    color: var(--color-primary); /* 對應全站主色 */
}

.site-footer-link i {
    margin-right: 6px;
    color: var(--color-text-muted);
}

.site-footer-link:hover i {
    color: var(--color-primary);
}

.site-footer-meta {
    text-align: center;
    line-height: 1.8;
}

.site-footer-copyright {
    font-size: 13.5px;
    color: var(--color-text);
}

.site-footer-statement {
    font-size: 12.5px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

/* 👑 [優化個人專區大外框排版] */
.my-space-container {
    width: 100%;
    background: transparent;
}

.my-space-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.my-space-header h2 {
    color: #ffd700;
    font-size: 1.5rem;
    margin: 0;
}

.my-space-count {
    color: #888;
    font-size: 1rem;
}

/* 👑 [管理外殼：確保刪除鈕能絕對定位貼在卡片右上方] */
.my-space-item-wrapper {
    position: relative; 
    margin-bottom: 20px;
    width: 100%;
}

/* 👑 [移除管理按鈕] */
.my-space-delete-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; 
    background: #ff4d4d;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.2s, transform 0.1s;
}

.my-space-delete-btn:hover {
    background: #e60000;
    transform: scale(1.05);
}

.no-data-hint, .my-space-loading {
    padding: 40px;
    text-align: center;
    color: #888;
    font-size: 1.2rem;
}

/* 👑 保持原佈局結構，利用 Flexbox 將內部元素往兩端撐開 */
.stats-bar#page-status-info {
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.stats-bar.my_space#page-status-info {
	display: flex;
}

.item_l {
  display: flex;
  gap: 5px; /* 讓左邊的兩個 span 之間有固定的間距，免寫 margin */
}

.item_r {
  margin-left: auto; /* 核心：自動填滿左側剩餘空間，將自己完美推至最右方 */
}
.remind i, .myfavorite i {
	font-size: 1.3rem;
	color: #a2afb9 ;
}
/* 👑 標記此頁為已讀按鈕的美化與設計 */
.mark-all-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #27ae60; /* 帶有安全、完成感的專業綠色 */
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

/* 👑 滑鼠懸停時的視覺回饋 */
.mark-all-read-btn:hover {
    background-color: #219653;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 👑 點擊瞬間的按壓回饋 */
.mark-all-read-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* 定義搖晃動畫 */
@keyframes shake-bell {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(-15deg); }
    20% { transform: rotate(15deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* 應用動畫到您的圖示 */
#Subscribe_list.shaking {
    animation: shake-bell 1s ease-in-out infinite;
    display: inline-block; /* 確保 rotate 生效 */
    color: #f1c40f; /* 加上顏色提示會更明顯 */
    cursor: pointer;
}

    .privacy-container {
        max-width: 900px;
        margin: 40px auto;
        padding: 40px;
        background-color: var(--bg-card);
        border-radius: 12px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color);
        color: var(--color-text);
        line-height: 1.8;
    }
    .privacy-container h1 {
        font-size: 2em;
        margin-bottom: 30px;
        color: var(--color-primary);
        border-bottom: 2px solid var(--color-primary);
        padding-bottom: 10px;
    }
    .privacy-container h2 {
        font-size: 1.5em;
        margin-top: 30px;
        margin-bottom: 15px;
        color: var(--color-text);
    }
    .privacy-container p {
        margin-bottom: 15px;
        color: var(--color-text-muted);
    }
    .privacy-container ul {
        margin-bottom: 20px;
        padding-left: 25px;
    }
    .privacy-container li {
        margin-bottom: 8px;
        color: var(--color-text-muted);
    }

/* ==========================================================================
   響應式斷點與佈局優化 (由大至小排列)
   ========================================================================== */

/* --- 超大型螢幕 (>= 2100px) --- */
@media (min-width: 2100px) {
    .layout,
    .use_layout {
        max-width: 90%;
        width: 1900px;
    }
}

/* --- 桌面版 (>= 1025px) --- */
@media (min-width: 1025px) {
    .category-container ul {
        display: flex !important;
    }

    .dropdown:hover .dropdown-content {
        display: block !important;
    }
}

/* --- 平板 / 小筆電 (769px - 1024px) --- */
@media (max-width: 1024px) {
    .header {
        padding: 20px 16px;
    }

    .header__topbar {
        flex-direction: column;
        gap: 15px;
    }

    .header__title h1 {
        font-size: 24px;
    }

    .nav__inner {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .menu-toggle#mobile-menu-btn {
        display: block !important;
        width: 100%;
        padding: 12px;
        background-color: var(--bg-card);
        color: var(--text-main);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 16px;
        font-weight: bold;
        text-align: center;
        cursor: pointer;
        margin-bottom: 5px;
        box-sizing: border-box;
    }

    .layout {
        max-width: 100%;
        width: 100%;
        padding: 6px;
        margin: 10px auto;
    }

    .layout__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .layout__main-column,
    .layout__sidebar {
        min-width: 0;
        width: 100%;
    }

    .mobile-arrow {
        display: inline-block;
        float: right;
        margin-top: 5px;
        transition: transform 0.3s ease;
    }

    .category-container {
        width: 100%;
        overflow: hidden;
    }

    .category-container ul#dynamic-menu {
        display: none !important;
        flex-direction: column;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .category-container ul#dynamic-menu.is-active {
        display: flex !important;
    }

    .dropdown.is-active .dropdown-content {
        display: block !important;
        position: static;
        width: 100%;
        box-shadow: none;
    }

    .software-card .card-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .software-card .card-thumbnail {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100%;
        max-height: 300px;
        min-height: 0;
        aspect-ratio: 3 / 2;
        background: #f0f0f0;
        border-radius: 8px;
    }

    .software-card .card-thumbnail img,
    .software-card .card-thumbnail img.software-icon {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .software-card .card-description {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0;
        line-height: 1.7;
        font-size: 15px;
        display: block !important;
        height: auto;
        overflow: visible !important;
        text-overflow: clip;
    }

    .sidebar-card {
        width: 100%;
        margin-bottom: 20px;
    }

    .search {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .search__button {
        width: 50px;
    }

    .card-body {
        padding: 10px;
    }

    .card-refresh-date {
        font-size: 0.75rem;
    }

    .card-badge {
        font-size: 0.6rem;
    }

    .software-card .card-title {
        font-size: 1.2em;
    }

    .highlight-text {
        font-size: 1rem;
    }

    .category-info h2 {
        font-size: 1.15rem;
    }

    .item_l {
        gap: 1px;
    }

    .item_r {
        display: flex;
        margin-left: auto;
        margin-top: 0.75rem;
        justify-content: flex-end;
    }

    .stats-bar#page-status-info {
        display: flex;
        flex-wrap: wrap;
    }

    .read-toggle-btn,
    .my-space-delete-btn {
        top: 50px !important;
    }

    .review_time-block {
        font-size: 0.9rem;
    }
}

/* --- 手機橫向短螢幕 --- */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 6px 15px !important;
    }

    .header__topbar {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .header__title h1 {
        font-size: 20px !important;
        margin: 0;
    }

    .header__title p {
        display: none;
    }

    .menu-toggle#mobile-menu-btn {
        padding: 5px !important;
        margin: 4px 0 !important;
        font-size: 14px !important;
    }

    .layout {
        padding: 5px 10px;
    }

    .layout__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .software-card .card-thumbnail {
        max-height: 140px !important;
    }

    .card-title {
        font-size: 1rem;
        margin-top: 5px;
    }

    .software-card .card-description {
        display: -webkit-box !important;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        font-size: 14px;
        margin-top: 8px;
    }

    .card-tags .tag {
        font-size: 0.75rem;
    }
}

/* --- 手機 / 小平板 (<= 768px) --- */
@media (max-width: 768px) {
    .special-nav {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    .personal-nav,
    .os-nav {
        justify-content: center;
        width: 100%;
    }

    .layout__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-content {
        flex-direction: column;
        align-items: stretch;
    }

    .card-thumbnail,
    .card-description {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .software-card .card-thumbnail {
        max-height: 260px;
    }

    .pagination {
        gap: 5px;
        padding: 12px 5px;
        margin: 25px 0;
    }

    .pagination button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .mobile-arrow {
        display: inline-block;
        float: right;
        margin-top: 5px;
    }

    .dropdown.is-active .dropdown-content {
        display: block !important;
        position: static;
        width: 100%;
        box-shadow: none;
        background: var(--color-bg-secondary);
    }

    .dropdown.is-active .mobile-arrow {
        transform: rotate(180deg);
    }

    .card-title,
    .description-text {
        font-size: 1rem;
    }

    .privacy-container {
        max-width: none;
        width: auto;
        margin: 20px 15px;
        padding: 25px;
    }

    .search-header {
        padding: 1.5rem;
    }

    .my-space-header {
        gap: 12px;
        align-items: flex-start;
    }

    .my-space-header h2 {
        font-size: 1.25rem;
    }

    .my-space-delete-btn {
        right: 10px;
        top: 45px !important;
    }

    .site-footer-link {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* --- 640px 以下 --- */
@media (max-width: 640px) {
    .site-footer {
        padding: 30px 16px 24px 16px;
    }

    .site-footer-link {
        display: block;
        margin: 12px 0;
    }

    .header__logo-area {
        gap: 10px;
        max-width: 100%;
    }

    .logo-img {
        width: 80px;
        height: auto;
    }

    .header__title h1 {
        font-size: 21px;
    }

    .header__title p {
        font-size: 13px;
    }

    .search__box {
        width: 100%;
    }

    .search__input {
        min-width: 0;
        padding-left: 12px !important;
        padding-right: 10px !important;
    }

    .search__select-wrapper {
        padding: 0 6px;
    }

    .search__select {
        max-width: 90px;
        font-size: 12px;
    }

    .web_function {
        flex-wrap: wrap;
        gap: 10px;
    }

    .special-nav {
        padding: 5px 0;
    }

    .personal-nav i,
    .os-nav a {
        font-size: 1.5rem;
    }

    .card-content {
        padding: 10px;
        gap: 12px;
    }

    .software-card .card-thumbnail {
        max-height: 220px;
    }

    .card-badges {
        gap: 6px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .card-tags {
        flex-wrap: wrap;
    }

    .card-footer {
        gap: 8px;
        flex-wrap: wrap;
    }

    .card-refresh-date {
        font-size: 0.8rem;
    }

    .item_l,
    .item_r {
        min-width: 0;
    }

    .stats-bar#page-status-info {
        align-items: flex-start;
    }
}

/* --- 小手機 (<= 480px) --- */
@media (max-width: 480px) {
    .layout {
        padding: 4px;
        margin: 8px auto;
    }

    .header {
        padding: 14px 10px;
    }

    .header__topbar {
        gap: 10px;
    }

    .header__title h1 {
        font-size: 19px;
    }

    .header__title p {
        font-size: 12px;
    }

    .search__input {
        font-size: 0.75rem;
    }

    .search__button {
        width: 46px;
    }

    .search-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .search-header h1 {
        font-size: 1.15rem;
        flex-wrap: wrap;
    }

    .search-notice {
        font-size: 0.95rem;
    }

    .search__select-wrapper {
        padding: 0 4px;
    }

    .card-tags .tag,
    .card-footer-text,
    .review_time-block,
    .dowload_time-block,
    .stats-bar {
        font-size: 0.8rem;
    }

    .pagination {
        padding: 8px 2px;
    }

    .pagination button {
        min-width: 38px;
        padding: 7px 9px;
    }

    .page-btn {
        min-width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    .myfavorite,
    .remind {
        padding: 2px;
    }

    .my-space-header {
        flex-wrap: wrap;
    }

    .my-space-delete-btn {
        position: static;
        margin-left: auto;
        margin-bottom: 8px;
    }

    .use_information_ul li {
        align-items: flex-start;
        gap: 8px;
    }

    .use_title_link {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .use_title_view {
        flex-shrink: 0;
    }

    .privacy-container {
        margin: 15px 8px;
        padding: 18px 15px;
    }

    .privacy-container h1 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .privacy-container h2 {
        font-size: 1.25em;
    }
}

/* --- 極窄手機 (<= 390px) --- */
@media (max-width: 390px) {
    .web_function {
        gap: 8px;
    }

    .web_function a {
        font-size: 13px;
    }

    .header__logo-area {
        gap: 7px;
    }

    .logo-img {
        width: 65px;
    }

    .header__title h1 {
        font-size: 17px;
    }

    .layout__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .software-card .card-content {
        width: 100%;
    }

    .software-card .card-thumbnail {
        max-height: 190px;
    }

    .card-title {
        width: auto;
        max-width: 100%;
        font-size: 0.95rem;
    }

    .card-refresh-date {
        font-size: 0.7rem;
    }
}

