:root {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--dark-bg: #0f172a;
	--card-bg: #27364E;
	--text-light: #f1f5f9;
	--text-light-light: #ffffff;
	--text-gray: #94a3b8;
	--text-active: #cacaca;
	--python: #3572A5;
	--javascript: #f1e05a;
	--html: #e34c26;
	--css: #563d7c;
	--overlay: rgba(0, 0, 0, 0.7);
	--filter-bg: rgba(30, 41, 59, 0.8);
	--success: #10b981;
	--btn-type1: #3b82f6;
	--btn-over-type1: #2563eb;
	--accent: #38bdf8;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: "Source Code Pro", 'Microsoft JhengHei', 'Segoe UI', sans-serif;
}

body {
	background-color: var(--dark-bg);
	color: var(--text-light);
	line-height: 1.6;
	overflow-x: hidden;
}
/*我的*/
.container{/*max-width:1100px;*/ margin:0 auto; padding: 3rem 5%;}
.course{background:#1e293b; padding:1rem; border-radius:8px; margin-bottom:1rem;}
.course-head{display:flex; gap:1rem; align-items:center;}
.thumb{flex-shrink: 0; width:80px; height:80px; border-radius:8px; overflow:hidden; flex:0 0 80px;}
.thumb img{width:100%; height:100%; object-fit:cover;}
.course-body{flex:1;}
.card{background:linear-gradient(180deg,#0f172a,#0b1422);padding:1.5rem;border-radius:12px;box-shadow:0 10px 30px rgba(2,6,23,.6);border:1px solid rgba(255,255,255,0.03);}
p.lead{color:#9fb5d9;margin-top:0;margin-bottom:1rem;}
.form-row{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem;}
.label { padding:.25rem .5rem; border-radius:6px; font-size:.85rem; background:#0b1220; color:#a8b3d9; }
input[type="text"], input[type="email"], input[type="password"]{background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.05);padding:.65rem;border-radius:8px;color:#e6eef8;width:100%;}
.input-inline{display:flex;gap:.5rem;}
.notice{background:#0b2238;padding:.8rem;border-radius:8px;color:#cfe7ff;margin-bottom:1rem;}
.alert{background:#ffecec;color:#8b1c1c;padding:.7rem;border-radius:8px;margin-bottom:1rem;}
.helper{font-size:.85rem;color:#88a9d0;margin-top:.25rem;}
/* 基本狀態：白字、無底線 */
.course-body a{
  color:#fff;
  text-decoration:none;
  position:relative;
  transition: color .2s ease, transform .2s ease;
}

/* 動態底線（預設寬度 0） */
.course-body a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-2px;
  width:0;
  height:2px;
  background:currentColor;
  transition:width .25s ease;
}

/* 滑過/聚焦：上浮 + 底線展開 */
.course-body a:hover,
.course-body a:focus{
  transform:translateY(-1px);
}

/* 展開底線 */
.course-body a:hover::after,
.course-body a:focus::after{
  width:100%;
}

/* 鍵盤可及性（不破壞設計） */
.course-body a:focus-visible{
  outline:2px dashed rgba(255,255,255,.6);
  outline-offset:3px;
}

.badge{background:#2563eb; padding:.25rem .5rem; border-radius:6px; font-size:.9rem;}
.session-list{margin-top:.5rem;}
.small{font-size:.9rem; padding-left:15px; color:#94a3b8;}
.article-list{margin-top:0.5rem;}
.article-item{padding:.4rem 0; border-bottom:1px dashed rgba(255,255,255,0.04);}
.kv{color:#cbd5e1;}
.progress-bar{height:8px; background:#334155; border-radius:4px; margin-top:4px; overflow:hidden;}
.progress-fill{height:100%; background:#3b82f6; border-radius:4px;}

/*作業顯示*/
.article-tasks { margin: 0; background: #0f172a; color: #eef2ff; border-radius: 10px; padding: 1rem; }
.article-tasks h3 { margin: 0 0 0.8rem 0; color: #a5b4fc; font-size: 1.6rem;}
.task-item { background:var(--card-bg); border-radius:8px; padding:12px; margin-bottom:20px; box-shadow: 0 6px 18px rgba(2,6,23,0.6); }
.task-meta { font-size:.9rem; color:#94a3b8; margin-bottom:8px; display:flex; gap:12px; flex-wrap:wrap; align-items:center }
.task-title { font-weight:700; font-size:1.05rem; color:#f8fafc; margin-bottom:6px; }
.task-content { margin-bottom:8px; color:#e6eef8; line-height:1.5; }
.task-actions { display:flex; gap:8px; align-items:center; }
.overdue { background:#ef4444; }
/* 作業上傳相關樣式 */
.no-bullet-gap {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  flex-direction: column; /* 垂直堆疊 */
  gap: 12px;              /* 各項目之間的間距（可調） */
}

.homework-section {
	margin-top: 1.5rem;
	padding: 1rem;
	background: #1a243a;
	border-radius: 8px;
}

.homework-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.upload-btn {
	background: #EB8125;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
}

.upload-btn:hover {
	background: #D8651D;
}

.upload-form {
	display: none;
	margin-top: 1rem;
	padding: 1rem;
	background: #1e293b;
	border-radius: 6px;
}

.file-input-wrapper {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.file-list {
	margin-top: 1rem;
}

.file-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem;
	border-bottom: 1px solid #334155;
}

.file-item:last-child {
	border-bottom: none;
}

.file-actions {
	display: flex;
	gap: 0.5rem;
}

.download-btn, .delete-btn {
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-size: 0.8rem;
	text-decoration: none;
}

.download-btn {
	background: #10b981;
	color: white;
}

.delete-btn {
	background: #ef4444;
	color: white;
	border: none;
	cursor: pointer;
}

.flash-message {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: 4px;
	font-size: 0.9rem;
}

.flash-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.flash-error {
	background: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/*分數*/
.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.file-name {
    font-weight: 600;
    flex: 1;
}

.score-badge {
    padding: 2px 5px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: bold;
    margin-left: 10px;
}

.score-pass {
    background-color: #10b981;
    color: white;
}

.score-fail {
    background-color: #ef4444;
    color: white;
}

.score-pending {
    background-color: #6b7280;
    color: white;
}

/* 回到頂部 進階 CSS */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
}

.back-to-top .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.back-to-top .progress-circle {
    fill: none;
    stroke: #007bff;
    stroke-width: 3;
    stroke-dasharray: 138.2;
    stroke-dashoffset: 138.2;
    transition: stroke-dashoffset 0.3s ease;
    opacity: 0.3;
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .backToTop {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* 自定義滾動條樣式 - 適用於Webkit瀏覽器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

::-webkit-scrollbar-track {
	background: rgba(10, 25, 47, 0.6);
	border-radius: 10px;
	border: 1px solid rgba(0, 195, 255, 0.1);
}

::-webkit-scrollbar-thumb {
	background: linear-gradient(45deg, #00c6ff, #0072ff);
	border-radius: 10px;
	border: 2px solid rgba(10, 25, 47, 0.8);
}

::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(45deg, #00d2ff, #0066ff);
	box-shadow: 0 0 8px rgba(0, 195, 255, 0.6);
}

::-webkit-scrollbar-corner {
	background: rgba(10, 25, 47, 0.8);
}

/* 自定義滾動條樣式 - 適用於Firefox */
html {
	scrollbar-width: thin;
	scrollbar-color: #0072ff rgba(10, 25, 47, 0.6);
}

/* 編輯器 */
.ql-size-large {
	font-size: 1.3rem;
}
.ql-indent-1 {
  margin-left: 1.5em; /* 或 1.5rem，可依需要調整 */
}

.ql-indent-2 {
  margin-left: 3em; /* 是 2 倍的 2em */
}

.navbar-brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text-light);}
.site-logo { width:40px; height:40px; display:block; object-fit:contain; }
.brand-text { font-size:1.6rem; font-weight:700; color:var(--text-light); }


/* 導航欄 */
.navbar {
	background-color: rgba(15, 23, 42, 0.95);
	padding: 1rem 5%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(10px);
}

.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary);
}

.nav-links {
	display: flex;
	gap: 2rem;
}

.nav-links a {
	color: var(--text-light);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s;
}

.nav-links a:hover {
	color: var(--primary);
}
.nav-links a.active {
	color: var(--primary);
	position: relative;
}
.nav-links a.active::after {
	content: '';
	position: absolute;
	bottom: -5px;
	left: 0;
	right: 0;
	height: 2px;
	background-color: var(--primary);
}

.mobile-menu-btn {
	display: none;
	background: none;
	border: none;
	color: var(--text-light);
	font-size: 1.5rem;
	cursor: pointer;
	z-index: 101;
}

/* 重新設計的手機選單 */
.mobile-nav {
	position: fixed;
	top: 0;
	left: -66.6%;
	width: 66.6%;
	height: 100vh;
	background-color: var(--dark-bg);
	z-index: 200;
	padding: 1.5rem;
	box-shadow: 3px 0 15px rgba(0, 0, 0, 0.5);
	transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.mobile-nav.active {
	transform: translateX(100%);
}

.mobile-nav-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	margin-bottom: 1.5rem;
}

.mobile-nav-links {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
}

.mobile-nav-links a {
	color: var(--text-light);
	text-decoration: none;
	font-size: 1.2rem;
	padding: 0.8rem 1rem;
	border-radius: 8px;
	transition: all 0.3s;
	display: flex;
	align-items: center;
	gap: 12px;
}

.mobile-nav-links a:hover {
	background-color: rgba(37, 99, 235, 0.2);
	color: var(--primary);
}

.mobile-nav-links a i {
	width: 24px;
	text-align: center;
}

.close-menu-btn {
	background: none;
	border: none;
	color: var(--text-light);
	font-size: 1.5rem;
	cursor: pointer;
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--overlay);
	z-index: 150;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}

.overlay.active {
	opacity: 1;
	visibility: visible;
}

/* 英雄區域 */
.hero {
	padding: 4rem 5%;
	text-align: center;
	background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
	position: relative;
}

.hero h1 {
	font-size: 2.5rem;
	margin-bottom: 1rem;
	background: linear-gradient(to right, #4ade80, #60a5fa);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hero p {
	font-size: 1.2rem;
	max-width: 800px;
	margin: 0 auto 2rem;
	color: var(--text-gray);
}

.cta-button {
	display: inline-block;
	background-color: var(--primary);
	color: white;
	padding: 12px 30px;
	border-radius: 30px;
	text-decoration: none;
	font-weight: 600;
	font-size: 1.1rem;
	transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* 課程分類 */
.categories {
	padding: 3rem 5%;
}

.section-title {
	text-align: center;
	margin-bottom: 2.5rem;
	font-size: 2rem;
}

.category-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5rem;
	max-width: 1200px;
	margin: 0 auto;
}

.category-card {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 2rem;
	text-align: center;
	transition: transform 0.3s;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-card:hover {
	transform: translateY(-10px);
	border-color: var(--primary);
}

.category-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
}
.cat-thumb {
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  margin: 0 auto 8px; /* <- 置中 */
}
.cat-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* 保證置中裁切 */
}
.no-thumb {
  width: 80px;
  height: 80px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff2;
  color:#fff;
  border-radius:6px;
  margin: 0 auto 8px; /* 同樣置中 */
}

.python { color: var(--python); }
.javascript { color: var(--javascript); }
.html { color: var(--html); }
.css { color: var(--css); }



/* 精選教程 */
.featured-tutorials {
	padding: 3rem 5%;
	background-color: rgba(30, 41, 59, 0.5);
}

.tutorial-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2rem;
	max-width: 1200px;
	margin: 0 auto;
}

.tutorial-card {
	background-color: var(--card-bg);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s;
}

.tutorial-card:hover {
	transform: scale(1.03);
}

.tutorial-image {
	height: 180px;
	background-size: cover;
	background-position: center;
	position: relative;
}

.tutorial-content {
	padding: 1.5rem;
}

.difficulty {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.beginner { background-color: rgba(0, 0, 0, 0.2);}
.intermediate { background-color: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.advanced { background-color: rgba(239, 68, 68, 0.2); color: #ef4444; }

.tutorial-card h3 {
	margin-bottom: 0.8rem;
	font-size: 1.3rem;
}

.tutorial-card p {
	color: var(--text-gray);
	margin-bottom: 1.5rem;
}

.meta-info {
	display: flex;
	justify-content: space-between;
	color: var(--text-gray);
	font-size: 0.9rem;
}

/* 頁面標題區 */
.page-header {
	padding: 2rem 5% 2rem;
	background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
	position: relative;
	text-align: center;
}

.page-header h1 {
	font-size: 2.8rem;
	margin-bottom: 1rem;
	background: linear-gradient(to right, #4ade80, #60a5fa);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.page-header p {
	font-size: 1.2rem;
	max-width: 800px;
	margin: 0 auto;
	color: var(--text-gray);
}

.breadcrumb {
	display: flex;
	/*justify-content: center;*/
	margin-bottom: 1.5rem;
	color: var(--text-gray);
	font-size: 0.95rem;
	flex-wrap: wrap;
}

.breadcrumb a {
	color: var(--primary);
	text-decoration: none;
	transition: opacity 0.3s;
}

.breadcrumb a:hover {
	opacity: 0.8;
}

.breadcrumb span {
	margin: 0 10px;
}

/* 課程頁面主體 */
.courses-container {
	padding: 1rem 5%;
	/*max-width: 1400px;*/
	margin: 0 auto;
}

.courses-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	flex-wrap: wrap;
	gap: 20px;
}

/* 文章頁面主體 */
.articles-container {
	padding: 3rem 5%;
	max-width: 1400px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 2.5rem;
}

.articles-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	flex-wrap: wrap;
	gap: 20px;
	grid-column: 1 / -1;
}

/* 文章標題區 */
.article-header {
	padding: 2rem 5% 2rem;
	background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
	position: relative;
}

.section-title {
	font-size: 2rem;
	position: relative;
	padding-left: 15px;
}

.section-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 10%;
	bottom: 10%;
	width: 4px;
	background: var(--primary);
	border-radius: 2px;
}

.filters {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
}

/*.filters::before {
	content: '';
	position: absolute;
	left: 0;
	top: 10%;
	bottom: 10%;
	width: 4px;
	background: var(--primary);
	border-radius: 2px;
}*/

/* 原本的 filter-btn */
.filter-btn { 
  background-color: var(--filter-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 連結的基本樣式 */
.filter-btn a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 1.1rem;
  transition: all 0.3s;
}

/* 當外層 .filter-btn 有 active 時，改變 a 的狀態 */
.filter-btn.active a {
  color: var(--text-light-light);
  font-size: 1.2rem;
  font-weight: 700;
}

/* 滑鼠移到外層按鈕時，改變邊框與內部連結文字 */
.filter-btn:hover {
  border-color: var(--primary);
}
.filter-btn:hover a {
  color: var(--text-light-light);
  font-weight: 600;
}

/* 外層 filter-btn 自己的 active 樣式 (背景與邊框) */
.filter-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
}


.search-box {
	position: relative;
	width: 100%;
	max-width: 400px;
}

.search-box input {
	width: 100%;
	padding: 12px 20px;
	padding-left: 45px;
	background-color: var(--filter-bg);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 30px;
	color: var(--text-light);
	font-size: 1rem;
	transition: all 0.3s;
}

.search-box input:focus {
	border-color: var(--primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.search-icon {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-gray);
}

/* 課程網格 */
.courses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 2rem;
}

.course-card {
	background-color: var(--card-bg);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s, box-shadow 0.3s;
	display: flex;
	flex-direction: column;
	height: 100%;
}

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

.course-image {
	height: 180px;
	position: relative;
}

.course-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.course-tag {
	position: absolute;
	top: 15px;
	left: 15px;
	padding: 5px 15px;
	border-radius: 30px;
	font-size: 0.85rem;
	font-weight: 600;
}

.course-content {
	padding: 1.5rem;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.course-category {
	display: inline-block;
	margin-bottom: 10px;
	font-size: 0.9rem;
	color: var(--primary);
}

.course-title {
	font-size: 1.4rem;
	margin-bottom: 0.8rem;
	transition: color 0.3s;
}

.course-card:hover .course-title {
	color: var(--primary);
}

.course-description {
	color: var(--text-gray);
	margin-bottom: 1.5rem;
	flex-grow: 1;
}

.course-meta {
	display: flex;
	justify-content: space-between;
	color: var(--text-gray);
	font-size: 0.9rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 1rem;
	margin-top: auto;
}

.course-stats {
	display: flex;
	align-items: center;
	gap: 15px;
}

.course-stats span {
	display: flex;
	align-items: center;
	gap: 5px;
}

.course-action {
	display: flex;
	justify-content: space-between;
	margin-top: 1.5rem;
	gap: 15px;
}

/* 文章網格 */
.articles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 2rem;
	grid-column: 1;
}

.article-card {
	background-color: var(--card-bg);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s, box-shadow 0.3s;
	display: flex;
	flex-direction: column;
	height: 100%;
}

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

.article-image {
	height: 200px;
	position: relative;
	overflow: hidden;
}

.article-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s;
}

.article-card:hover .article-image img {
	transform: scale(1.05);
}
.article-tag-top {
	display: inline-block;
	padding: 5px 15px;
	border-radius: 30px;
	color: white;
	font-size: 0.9rem;
	font-weight: 600;
}
.article-tag {
	position: absolute;
	top: 15px;
	right: 15px;
	padding: 5px 15px;
	border-radius: 30px;
	font-size: 0.85rem;
	font-weight: 600;
	z-index: 10;
}
.python-bg { background-color: rgba(53, 114, 165, 0.85); }
.js-bg { background-color: rgba(241, 224, 90, 0.85); color: #333; }
.html-bg { background-color: rgba(227, 76, 38, 0.85); }
.css-bg { background-color: rgba(86, 61, 124, 0.85); }

.article-content {
	padding: 1.5rem;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}
.article-meta-top {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	padding: 0.2rem 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	margin-bottom: 2rem;
}
.article-meta {
	display: flex;
	justify-content: space-between;
	margin-bottom: 12px;
	font-size: 0.9rem;
	color: var(--text-gray);
}
.meta-item {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text-gray);
}

.article-author {
	display: flex;
	align-items: center;
	gap: 8px;
}

.author-avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background-color: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
}

.article-title {
	font-size: 1.4rem;
	margin-bottom: 1rem;
	transition: color 0.3s;
}
.article-title-top {
	font-size: 2rem;
	margin-bottom: 0.2rem;
	line-height: 1.3;
}

.article-title a {
	justify-content: space-between;
	color: var(--text-light);
	text-decoration: none;
	transition: color 0.3s;
}

.article-title a:hover {
	color: var(--primary);
}

.article-card:hover .article-title {
	color: var(--primary);
}

.article-excerpt {
	color: var(--text-gray);
	margin-bottom: 1.5rem;
	flex-grow: 1;
	line-height: 1.7;
}

.article-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: auto;
}

.read-time {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--text-gray);
	font-size: 0.9rem;
}

.article-stats {
	display: flex;
	gap: 15px;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--text-gray);
	font-size: 0.9rem;
}

.btn-outline {
	border: 2px solid var(--primary);
	color: var(--primary);
	background: transparent;
}

.btn-outline:hover {
	background-color: var(--primary);
	color: white;
}

/* 文章內容 */
.article-container {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 1.5rem;
	padding: 3rem 5%;
	/*max-width: 1400px;*/
	width : 100%;
	margin: 0 auto;
}

.article-content-tutorial {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 2.5rem;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.content-section {
	margin-bottom: 1rem;
	/*max-width: 732px;*/
}

.content-section h2 {
	font-size: 1.8rem;
	margin-bottom: 1.5rem;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--primary);
	position: relative;
}

.content-section h2::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 100px;
	height: 2px;
	background: linear-gradient(to right, var(--primary), transparent);
}

.content-section p {
	margin-bottom: 1.0rem;
	line-height: 1.5;
	font-size: 1.1rem;
}

.content-section p a {
  position: relative;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  padding-left: 1.4em; /* 給前面圖示空間 */
}

/* 🔗 符號放在文字前面 */
.content-section p a::before {
  content: '🔗';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1em;
  color: #60a5fa;
  transition: transform 0.3s ease;
}

/* 漸層底線動畫 */
.content-section p a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #818cf8);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.content-section p a:hover {
  color: #cbd5e1;
}

/* 滑過時底線展開 */
.content-section p a:hover::after {
  width: 100%;
}

/* 滑過時圖示微位移強化感覺 */
.content-section p a:hover::before {
  transform: translateX(-2px);
}

.content-section ul, .content-section ol {
	padding-left: 1.5rem;
	margin-bottom: 1.5rem;
}

.content-section li {
	margin-bottom: 0.8rem;
	line-height: 1.7;
	font-size: 1.1rem;
}

.content-section img {
	max-width: 100%;
	border-radius: 10px;
	margin: 1.5rem 0;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.content-section blockquote {
  background-color: #27364E;
  color: #E2E8F0;               /* 淡灰文字，對深色背景更清晰 */
  border-left: 4px solid #60A5FA; /* 左側亮藍線條提升質感 */
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  border-radius: 6px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* 輕微陰影更立體 */
  transition: background-color 0.3s ease;
}

/* 程式碼區塊 */
.code-block {
	position: relative;
	margin: 2rem 0;
	border-radius: 10px;
	overflow: hidden;
}

.code-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: rgba(0, 0, 0, 0.3);
	padding: 10px 15px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
}

.copy-btn {
	background-color: rgba(37, 99, 235, 0.2);
	color: var(--primary);
	border: none;
	padding: 5px 12px;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s;
	display: flex;
	align-items: center;
	gap: 5px;
}

.copy-btn:hover {
	background-color: var(--primary);
	color: white;
}

pre {
	margin: 0;
	border-radius: 0 0 10px 10px;
	overflow-x: auto;
}

code {
	font-family: "Source Code Pro", 'Microsoft JhengHei', 'Segoe UI', sans-serif;
	font-size: 0.95rem;
}

.hljs {
	background: #1a1f2c !important;
	padding: 1.5rem !important;
	line-height: 1.5;
}


/* 側邊欄 */
.sidebar {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 1rem;
	margin-bottom: 2rem;
}

.sidebar h3 {
	margin-bottom: 1.5rem;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	gap: 10px;
}

.sidebar h3 i {
	color: var(--primary);
}

.sidebar-section {
	margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
	margin-bottom: 0;
}

.category-list {
	list-style: none;
}

.category-list li {
	margin-bottom: 0.8rem;
}

.category-list a {
	display: flex;
	justify-content: space-between;
	color: var(--text-gray);
	text-decoration: none;
	transition: color 0.3s;
	padding: 8px 0;
}

.category-list a:hover {
	color: var(--primary);
}

.category-list .count {
	background-color: rgba(37, 99, 235, 0.2);
	color: var(--primary);
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 0.8rem;
}

.toc {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 0.5rem;
	margin-bottom: 2rem;
}

.toc h3 {
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	gap: 10px;
}

.toc ul {
	list-style: none;
}

.toc li {
	margin-bottom: 0.8rem;
	position: relative;
	padding-left: 15px;
}

.toc li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--primary);
}

.toc a {
	color: var(--text-gray);
	text-decoration: none;
	transition: color 0.3s;
	display: block;
	padding: 5px 0;
	font-size: 0.95rem;
}

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

/* 熱門文章 */
.popular-article {
	display: flex;
	gap: 15px;
	margin-bottom: 1.2rem;
	padding-bottom: 1.2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popular-article:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.popular-image {
	width: 80px;
	height: 80px;
	border-radius: 10px;
	overflow: hidden;
	flex-shrink: 0;
}

.popular-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.popular-content {
	flex-grow: 1;
}

.popular-content h4 {
	font-size: 1rem;
	margin-bottom: 5px;
	transition: color 0.3s;
}

.popular-content h4:hover {
	color: var(--primary);
}

.popular-meta {
	color: var(--text-gray);
	font-size: 0.85rem;
	display: flex;
	gap: 10px;
}

/* 標籤雲 */
.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tag {
	background-color: rgba(37, 99, 235, 0.15);
	color: var(--text-light);
	padding: 6px 15px;
	border-radius: 30px;
	font-size: 0.9rem;
	transition: all 0.3s;
	text-decoration: none;
	display: inline-block;
}

.tag:hover {
	background-color: var(--primary);
	transform: translateY(-2px);
}

/* 分頁 */
.pagination {
	display: flex;
	justify-content: center;
	margin-top: 3rem;
	grid-column: 1 / -1;
}

.pagination a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background-color: var(--card-bg);
	color: var(--text-light);
	text-decoration: none;
	margin: 0 5px;
	transition: all 0.3s;
}

.pagination a:hover, 
.pagination a.active {
	background-color: var(--primary);
}

/* 相關工具 */
.tools {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 1.5rem;
}

.tools h3 {
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	gap: 10px;
}

.tool-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-item:last-child {
	border-bottom: none;
}

.tool-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--primary), #7c3aed);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.tool-content h4 {
	margin-bottom: 3px;
	font-size: 1.05rem;
}

.tool-content p {
	font-size: 0.9rem;
	color: var(--text-gray);
}

/* 評論區 */
.comments-section {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 2.5rem;
	margin-top: 3rem;
	grid-column: 1 / -1;
}

.section-title {
	font-size: 1.8rem;
	margin-bottom: 2rem;
	position: relative;
	padding-left: 15px;
}

.section-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 10%;
	bottom: 10%;
	width: 4px;
	background: var(--primary);
	border-radius: 2px;
}

.comment-form {
	background:var(--card-bg);	
	border-radius: 15px;
	padding: 0.2rem;
	margin-bottom: 0.5rem;
	min-width: 470px;
}

.form-group {
	margin-bottom: 1.5rem;

}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
}

.form-control {
	width: 100%;
	padding: 12px 15px;
	background-color: rgba(15, 23, 42, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	color: var(--text-light);
	font-size: 1rem;
	transition: all 0.3s;
}

.form-control:focus {
	border-color: var(--primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

textarea.form-control {
	min-height: 150px;
	resize: vertical;
}

/* 評論列表 */
.comment-list {
	margin-top: 2rem;
}

.comment {
	display: flex;
	gap: 20px;
	padding: 1.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comment:last-child {
	border-bottom: none;
}

.comment-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(45deg, #8b5cf6, #ec4899);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.2rem;
	flex-shrink: 0;
}

.comment-content {
	flex-grow: 1;
}

.comment-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	flex-wrap: wrap;
	gap: 10px;
}

.comment-header a {
	color: #fff;
	background-color: var(--btn-type1);         /* 藍色背景 */
	text-decoration: none;
	transition: all 0.3s ease;
	display: inline-block;
	padding: 5px 5px;
	font-size: 0.95rem;
	border-radius: 6px;                /* 圓角 */
	box-shadow: 0 2px 4px rgba(0,0,0,0.7);
	border: none;
	cursor: pointer;
}

.comment-header a:hover {
	background-color: var(--btn-over-type1);         /* hover 深藍 */
	color: #fff;
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.comment-author {
	font-weight: 600;
	font-size: 1.1rem;
}

.comment-time {
	color: var(--text-gray);
	font-size: 0.9rem;
}

.comment-text {
	line-height: 1.7;
	margin-bottom: 15px;
	font-size: 1.05rem;
}

.comment-actions {
	display: flex;
	gap: 20px;
}

.comment-action {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--text-gray);
	cursor: pointer;
	transition: color 0.3s;
	font-size: 0.95rem;
}

.comment-action:hover {
	color: var(--primary);
}

.comment-action a {
	display: flex;
	align-items: center;
	gap: 5px;
	color: var(--text-gray);
	cursor: pointer;
	transition: color 0.3s;
	font-size: 0.95rem;
	text-decoration: none;
}

.comment-action a:hover {
	color: var(--primary);
	text-decoration: none;
}


/* 挑戰排行榜 */
.leaderboard {
	background-color: var(--card-bg);
	border-radius: 15px;
	padding: 2rem;
	margin-top: 1rem;
	grid-column: 1 / -1;
}

.leaderboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
}

.leaderboard-title {
	font-size: 1.8rem;
	position: relative;
	padding-left: 15px;
}

.leaderboard-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 10%;
	bottom: 10%;
	width: 4px;
	background: var(--primary);
	border-radius: 2px;
}

.view-all {
	color: var(--primary);
	text-decoration: none;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 5px;
}

.leaderboard-list {
	list-style: none;
}

.leaderboard-item {
	display: flex;
	align-items: center;
	padding: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	transition: background-color 0.3s;
}

.leaderboard-item:hover {
	background-color: rgba(255, 255, 255, 0.05);
	border-radius: 10px;
}

.rank {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0B1120, #0F172A);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.1rem;
	margin-right: 15px;
	flex-shrink: 0;
}

.rank-1 {
	background: linear-gradient(135deg, #f59e0b, #fcd34d);
}

.rank-2 {
	background: linear-gradient(135deg, #94a3b8, #cbd5e1);
}

.rank-3 {
	background: linear-gradient(135deg, #a16207, #fcd34d);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-grow: 1;
}

.user-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(45deg, #8b5cf6, #ec4899);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 1.2rem;
	flex-shrink: 0;
}

.user-details {
	flex-grow: 1;
}

.user-details a {
  color: #ffffff;                 /* 白色文字 */
  font-size: 1.1rem;              /* 字體大小 */
  text-decoration: none;          /* 取消預設底線 */
  position: relative;             /* 下方滑動效果用到 */
  transition: color 0.3s ease;    /* 文字顏色動態 */
  display: inline-block;          /* 讓伺服滑動線條時較順暢 */
}

/* 滑鼠懸停：顏色變淡，並出現底部滑動線 */
.user-details a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* 在底部增加一條滑動線，預設寬度 0，hover 時展開 */
.user-details a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;                 /* 線條距文字底部稍微往下 */
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s ease;
}

.user-details a:hover::after {
  width: 100%;
}

.user-name {
	font-weight: 600;
	margin-bottom: 5px;
}

.user-title {
	color: var(--text-gray);
	font-size: 0.9rem;
}

.stats {
	display: flex;
	gap: 30px;
	text-align: center;
}

.stat-value {
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 5px;
}

.stat-label {
	color: var(--text-gray);
	font-size: 0.9rem;
}

/* 關於內容部分 */
.about-section {
	background: var(--card-bg);
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	border: 1px solid var(--card-border);
	position: relative;
	overflow: hidden;
	padding: 3rem 5%;
	margin-bottom:10px;
}

.about-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 5px;
	height: 100%;
	background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.about-section-title {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 30px;
}

.about-section-title i {
	font-size: 2rem;
	color: var(--accent);
	background: rgba(56, 189, 248, 0.1);
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.about-section-title h2 {
	font-size: 2.2rem;
	color: var(--text-light-light);
}

.about-section-content {
	font-size: 1.1rem;
	line-height: 1.8;
	color: var(--text-light);
}

.about-section-content p {
	margin-bottom: 20px;
}

/* 網站特色部分 */
.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 25px;
	margin-top: 30px;
}

.feature-card {
	background: rgba(30, 41, 59, 0.7);
	border-radius: 12px;
	padding: 25px;
	border: 1px solid rgba(56, 189, 248, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
	border-color: var(--accent);
}

.feature-icon {
	font-size: 2.5rem;
	color: var(--accent);
	margin-bottom: 15px;
}

.feature-card h3 {
	font-size: 1.4rem;
	color: var(--text-light-light);
	margin-bottom: 10px;
}

.feature-card p {
	color: var(--text-gray);
	font-size: 1rem;
}

/* 作者介紹部分 */
.author-profile {
	display: flex;
	gap: 40px;
	margin-top: 30px;
	align-items: center;
	flex-wrap: wrap;
}

.author-avatar-about {
	flex: 0 0 250px;
	border-radius: 15px;
	overflow: hidden;
	border: 3px solid var(--accent);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.author-avatar img {
	width: 100%;
	height: auto;
	display: block;
}

.author-info {
	flex: 1;
	min-width: 300px;
}

.author-info h3 {
	font-size: 2rem;
	color: var(--text-light-light);
	margin-bottom: 20px;
	position: relative;
	display: inline-block;
}

.author-info h3::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 0;
	width: 100px;
	height: 4px;
	background: var(--accent);
	border-radius: 2px;
}

.author-bio {
	margin-bottom: 25px;
	font-size: 1.1rem;
	line-height: 1.8;
}

.author-details {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 30px;
}

.detail-card {
	background: rgba(30, 41, 59, 0.7);
	border-radius: 10px;
	padding: 20px;
	flex: 1;
	min-width: 200px;
	border: 1px solid rgba(56, 189, 248, 0.2);
}

.detail-card i {
	font-size: 1.8rem;
	color: var(--accent);
	margin-bottom: 10px;
}

.detail-card h4 {
	font-size: 1.2rem;
	color: var(--text-light-light);
	margin-bottom: 5px;
}

.detail-card p {
	color: var(--text-gray);
}

/* 語言切換部分 */
.lang-switcher {
	display: flex;
	gap: 10px;
	margin-top: 30px;
	margin-bottom: 20px;
}

.lang-btn {
	background: transparent;
	border: 2px solid var(--accent);
	color: var(--accent);
	padding: 8px 20px;
	border-radius: 30px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.3s ease;
}

.lang-btn.active {
	background: var(--accent);
	color: var(--dark-bg);
	font-weight: 600;
}

.lang-btn:hover:not(.active) {
	background: rgba(56, 189, 248, 0.1);
}

.lang-content {
	display: none;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.lang-content.active {
	display: block;
	opacity: 1;
}

/* 動畫效果 */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

.animated {
	animation: fadeIn 0.8s ease forwards;
}

/* 登入動態背景元素 */
.background-elements {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: -1;
}

.bubble {
	position: absolute;
	border-radius: 50%;
	background: rgba(59, 130, 246, 0.1);
	animation: float 15s infinite ease-in-out;
}

.bubble:nth-child(1) {
	width: 80px;
	height: 80px;
	top: 10%;
	left: 5%;
	animation-delay: 0s;
}

.bubble:nth-child(2) {
	width: 120px;
	height: 120px;
	top: 40%;
	left: 80%;
	animation-delay: 2s;
}

.bubble:nth-child(3) {
	width: 60px;
	height: 60px;
	top: 70%;
	left: 15%;
	animation-delay: 4s;
}

.bubble:nth-child(4) {
	width: 100px;
	height: 100px;
	top: 20%;
	left: 60%;
	animation-delay: 6s;
}

.bubble:nth-child(5) {
	width: 70px;
	height: 70px;
	top: 65%;
	left: 85%;
	animation-delay: 8s;
}

@keyframes float {
	0% {
		transform: translateY(0) rotate(0deg);
		opacity: 1;
	}
	50% {
		transform: translateY(-100px) rotate(180deg);
		opacity: 0.7;
	}
	100% {
		transform: translateY(0) rotate(360deg);
		opacity: 1;
	}
}

/* 登入容器 */
.login-container {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

.login-card {
	background-color: var(--card-bg);
	border-radius: 20px;
	box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
	width: 100%;
	max-width: 450px;
	padding: 2.5rem;
	position: relative;
	overflow: hidden;
	transition: all 0.4s ease;
	z-index: 10;
}

.login-card::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
	opacity: 0.1;
	z-index: -1;
	animation: rotate 20s linear infinite;
}

.login-card:hover {
	transform: translateY(-10px);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.login-header {
	text-align: center;
	margin-bottom: 2rem;
}

.login-header h1 {
	font-size: 2.2rem;
	margin-bottom: 0.5rem;
	background: linear-gradient(to right, #60a5fa, #3b82f6);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.login-header p {
	color: var(--text-gray);
	font-size: 1rem;
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.input-group {
	position: relative;
}

.input-group i {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-gray);
	transition: color 0.3s;
}

.input-group input {
	width: 100%;
	padding: 14px 20px 14px 45px;
	background-color: var(--card-bg-light);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	color: var(--text-light);
	font-size: 1rem;
	transition: all 0.3s;
}

.input-group input:focus {
	border-color: var(--primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.input-group input:focus + i {
	color: var(--primary);
}

.remember-forgot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.9rem;
}

.remember {
	display: flex;
	align-items: center;
	gap: 8px;
}

.remember input {
	accent-color: var(--primary);
}

.forgot-password {
	color: var(--primary);
	text-decoration: none;
	transition: opacity 0.3s;
}

.forgot-password:hover {
	opacity: 0.8;
}

.password-rules {
	background: rgba(30, 41, 59, 0.5);
	border-radius: 10px;
	padding: 12px 15px;
	margin-top: -10px;
	font-size: 0.85rem;
	color: var(--text-gray);
}

.password-rules ul {
	list-style: none;
	padding-left: 5px;
}

.password-rules li {
	margin-bottom: 5px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.password-rules li i {
	font-size: 0.8rem;
	color: var(--primary);
}

.login-link {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.95rem;
	color: var(--text-gray);
}

.login-link a {
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	margin-left: 5px;
	transition: opacity 0.3s;
}

.login-link a:hover {
	opacity: 0.8;
}

/* 密碼顯示 */
.password-group {
  position: relative;
}
.password-group .toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-gray);
}
.password-group .toggle-password:hover {
  color: var(--text-active);
}

.btn {
	padding: 14px 20px;
	border-radius: 30px;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.3s;
	text-align: center;
	cursor: pointer;
	font-size: 1rem;
	border: none;
	flex-grow: 1;
	/*display: inline-block;*/
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.btn-primary {
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	color: white;
	padding:.6rem 1rem;
	border-radius:8px;
	border:none;
	cursor:pointer;
	text-decoration:none;
	display:inline-flex;
	align-items:center;
	gap:.5rem;
	box-shadow:0 6px 18px rgba(37,99,235,.18);
	transition:transform .12s ease, box-shadow .12s;}
}

.btn-primary:hover {
	background: linear-gradient(135deg, var(--primary), var(--primary-dark));
	transform: translateY(-3px);
	box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
	transform:translateY(-3px);
}

.btn-primary:active {
	transform: translateY(-1px);
}

.social-login {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1.5rem;
}

.divider {
	display: flex;
	align-items: center;
	text-align: center;
	color: var(--text-gray);
	font-size: 0.9rem;
	margin: 1rem 0;
}

.divider::before,
.divider::after {
	content: '';
	flex: 1;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider:not(:empty)::before {
	margin-right: 1rem;
}

.divider:not(:empty)::after {
	margin-left: 1rem;
}

.social-buttons {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.8rem;
}

.social-btn {
	background-color: var(--card-bg-light);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s;
}

.social-btn:hover {
	transform: translateY(-3px);
	border-color: var(--primary);
}

.social-btn i {
	font-size: 1.2rem;
}

.google i { color: #DB4437; }
.facebook i { color: #4267B2; }
.github i { color: #f1f5f9; }

.register-link {
	text-align: center;
	margin-top: 1.5rem;
	font-size: 0.95rem;
	color: var(--text-gray);
}

.register-link a {
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	margin-left: 5px;
	transition: opacity 0.3s;
}

.register-link a:hover {
	opacity: 0.8;
}

.floating-icons {
	position: absolute;
	top: 20px;
	right: 20px;
	display: flex;
	gap: 10px;
}

.floating-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	color: var(--primary);
	font-size: 1.2rem;
	animation: floatIcon 6s infinite ease-in-out;
}

.floating-icon:nth-child(1) { animation-delay: 0s; }
.floating-icon:nth-child(2) { animation-delay: 2s; }
.floating-icon:nth-child(3) { animation-delay: 4s; }

@keyframes floatIcon {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-15px); }
}

@keyframes rotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* 成功狀態 */
.success-message {
	text-align: center;
	padding: 20px;
	background: rgba(16, 185, 129, 0.1);
	border-radius: 12px;
	border: 1px solid var(--success);
	margin-bottom: 1.5rem;
	word-wrap: break-word;     /* 長單字或連結也會換行 */
	overflow-wrap: break-word; /* 新寫法，與上列相同 */
	white-space: normal;       /* 確保會換行 */		
}

.success-message a {
	position: relative;
	color: var(--text-light-light);
	font-size: 0.8rem;
	text-decoration: none;
	transition: color 0.3s;
}
/* 加入動態底線的偽元素 */
.success-message a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px; /* 線條略低於文字底部 */
  width: 0;
  height: 2px;
  background-color: currentColor; /* 同文字顏色 */
  transition: width 0.3s ease;
}

/* 滑鼠移上去時展開底線 */
.success-message a:hover::after {
  width: 100%;
  color: #2568f8;
}

.success-message a:hover {
  color: #b6edff;
  font-weight: 600;
}

.success-icon {
	font-size: 3rem;
	color: var(--success);
	margin-bottom: 1rem;
	animation: successPulse 1.5s infinite;
}

.reset-link {
	display: block;
	background: var(--card-bg-light);
	padding: 15px;
	border-radius: 10px;
	word-break: break-all;
	margin: 20px 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	transition: all 0.3s;
}

.reset-link:hover {
	border-color: var(--primary);
	transform: translateY(-3px);
}

/* 錯誤狀態 */
.error-message {
	background: rgba(239, 68, 68, 0.1);
	border-radius: 12px;
	border: 1px solid var(--error);
	padding: 15px;
	margin-bottom: 1.5rem;
}

.error-message ul {
	list-style: none;
	padding-left: 10px;
}

.error-message li {
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.error-message li:before {
	content: "•";
	color: var(--error);
	font-weight: bold;
	display: inline-block;
	width: 1em;
}

@keyframes successPulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.1); }
	100% { transform: scale(1); }
}

/* 頁腳 */
.footer {
	padding: 3rem 5%;
	background-color: #0b1120;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
	max-width: 1200px;
	margin: 0 auto;
}

.footer-column h3 {
	margin-bottom: 1.5rem;
	font-size: 1.2rem;
}

.footer-links {
	list-style: none;
}

.footer-links li {
	margin-bottom: 0.8rem;
}

.footer-links a {
	color: var(--text-gray);
	text-decoration: none;
	transition: color 0.3s;
}

.footer-links a:hover {
	color: var(--primary);
}

.social-links {
	display: flex;
	gap: 1rem;
	margin-top: 1rem;
}

.social-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: var(--card-bg);
	color: var(--text-light);
	transition: all 0.3s;
}

.social-icon:hover {
	background-color: var(--primary);
	transform: translateY(-3px);
}

.copyright {
	text-align: center;
	padding-top: 2rem;
	margin-top: 2rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--text-gray);
}

/* 響應式設計 */
@media (max-width: 992px) {
	.nav-links {
		display: none;
	}
	
	.mobile-menu-btn {
		display: block;
	}
	.articles-container {
		grid-template-columns: 1fr;
	}	
}

@media (max-width: 768px) {
	.hero h1 {
		font-size: 2rem;
	}
    .thumb {
        display: none;
    }	
	
	.tutorial-grid {
		grid-template-columns: 1fr;
	}
	.page-header h1 {
		font-size: 2rem;
	}
	
	.articles-grid {
		grid-template-columns: 1fr;
	}
	.article-container {
		display: grid;
		grid-template-columns: minmax(0, 1fr); /* 防止 overflow */
		padding: 3rem 1%;
		
	}
	
	.articles-header {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.filters {
		width: 100%;
	}
	.article-header {
		padding: 2rem 5% 2px;
	}
	
	.article-title-top {
		font-size: 1.6rem;
	}
	
	.article-meta-top {
		flex-direction: column;
		gap: 15px;
	}
	
	.sidebar {
		grid-template-columns: 1fr;
		margin-bottom: 2px;
	}
	
	.comment {
		flex-direction: column;
		gap: 15px;
	}

	.comments-section {
		margin-top: 2px;
		padding: 0rem;
	}
	
	.nav-links {
		display: none;
	}
	
	.mobile-menu-btn {
		display: block;
	}
	
	.article-content {
		padding: 1.5rem;
		max-width: 100%;
	}
	
	.section-title {
		font-size: 1.5rem;
	}
	
	.comment-form {
		padding: 1rem;
		min-width: 270px;
	}
	/* 關於作者 */
	.about-section {
		padding: 30px 20px;
	}
	
	.author-profile {
		flex-direction: column;
		text-align: center;
	}
	
	.author-info h3::after {
		left: 50%;
		transform: translateX(-50%);
	}	
	.login-card {
		padding: 2rem 1.5rem;
	}
	
	.navbar {
		padding: 1rem;
	}
	
	.login-header h1 {
		font-size: 1.8rem;
	}
}

@media (max-width: 480px) {
	.hero {
		padding: 2rem 5%;
	}
	
	.hero h1 {
		font-size: 1.8rem;
	}
	
	.section-title {
		font-size: 1.5rem;
	}
	
	.mobile-nav {
		width: 80%;
		left: -80%;
	}
	.page-header {
		padding: 2rem 5%;
	}
	
	.page-header h1 {
		font-size: 1.8rem;
	}
	
	.section-title {
		font-size: 1.5rem;
	}
	
	.article-footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
	
	.article-stats {
		width: 100%;
		justify-content: space-between;
	}
	.article-title-top {
		font-size: 1.2rem;
	}
	
	.breadcrumb {
		font-size: 0.85rem;
	}
	
	.breadcrumb span {
		margin: 0 5px;
	}
	
	.article-meta-top {
		font-size: 0.9rem;
	}
	
	.content-section h2 {
		font-size: 1.4rem;
	}
	
	.content-section p, .content-section li {
		font-size: 1rem;
	}
	
	.comment-content {
		width: 100%;
	}
	
	.comment-header {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.footer-content {
		grid-template-columns: 1fr;
	}
	
	.code-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	
	.copy-btn {
		align-self: flex-end;
	}
	
	.hljs {
		padding: 1rem !important;
		font-size: 0.85rem;
	}
	.login-card {
		padding: 1.5rem;
	}
	
	.remember-forgot {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.8rem;
	}
	
	.social-buttons {
		grid-template-columns: 1fr;
	}	
}
@media (max-width: 360px) {
	.article-title-top {
		font-size: 1.2rem;
	}
	
	.content-section h2 {
		font-size: 1.3rem;
	}
	
	.btn {
		padding: 10px 20px;
		width: 100%;
	}
	
	.comment-actions {
		flex-direction: column;
		gap: 10px;
	}
}