/* ============================================================
   Files Manager - Online Tutorial (dark theme)
   Shared stylesheet
   ============================================================ */
:root {
	--bg: #0d1117;
	--bg-soft: #161b22;
	--bg-card: #1c2128;
	--border: #2d333b;
	--text: #e6edf3;
	--text-dim: #9aa4b0;
	--accent: #2f81f7;
	--accent-strong: #58a6ff;
	--accent-bg: rgba(47, 129, 247, 0.15);
	--ad-bg: #10151b;
	--ad-border: #262c33;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.7;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- Top site navigation ---------- */
.topnav {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--bg-soft);
	border-bottom: 1px solid var(--border);
}
.topnav-inner {
	max-width: 1560px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 16px;
	height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand .logo {
	width: 28px; height: 28px; border-radius: 6px;
	background: var(--accent);
	display: inline-flex; align-items: center; justify-content: center;
	color: #fff; font-size: 15px;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
	color: var(--text-dim);
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 15px;
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); text-decoration: none; }
.nav-links a.active { color: var(--accent-strong); font-weight: 600; }

.store-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--accent); color: #fff !important;
	padding: 8px 16px; border-radius: 6px;
	font-weight: 600; font-size: 14px;
	white-space: nowrap;
}
.store-btn:hover { background: var(--accent-strong); text-decoration: none; }

/* ---------- Hero / title ---------- */
.hero {
	max-width: 1560px; margin: 0 auto; padding: 28px 16px 8px;
}
.hero h1 { margin: 0 0 6px; font-size: 30px; }
.hero .crumbs { color: var(--text-dim); font-size: 14px; }
.hero .sub { color: var(--text-dim); font-size: 16px; max-width: 900px; }

/* ---------- Layout columns ---------- */
.layout {
	max-width: 1560px;
	margin: 12px auto 40px;
	padding: 0 16px;
	display: grid;
	grid-template-columns: 210px 240px minmax(0, 1fr) 260px;
	grid-template-areas: "ad-left outline content related";
	gap: 16px;
	align-items: start;
}

/* ---------- Left fixed ad column (far left, responsive) ---------- */
.ad-left {
	grid-area: ad-left;
	position: sticky;
	top: 76px;
	align-self: start;
}
.ad-left-inner {
	width: 100%;
	min-width: 160px;
	max-width: 210px;
	background: var(--ad-bg);
	border: 1px solid var(--ad-border);
	border-radius: 8px;
	min-height: 300px;
	overflow: hidden;
	position: relative;
}
.ad-left-inner .ad-label { text-align: center; font-size: 11px; color: var(--text-dim); padding: 6px; }

/* ---------- Outline (left) ---------- */
.outline {
	grid-area: outline;
	position: sticky;
	top: 76px;
	align-self: start;
	max-height: calc(100vh - 92px);
	overflow: auto;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px;
}
.outline h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.outline ol { margin: 0; padding: 0; list-style: none; }
.outline li { margin-bottom: 4px; }
.outline a {
	display: block; padding: 7px 10px; border-radius: 6px;
	color: var(--text-dim); font-size: 14px; border-left: 3px solid transparent;
}
.outline a:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.outline a.active { color: var(--accent-strong); background: var(--accent-bg); border-left-color: var(--accent); font-weight: 600; }
.outline .intro { font-size: 13px; color: var(--text-dim); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- Content ---------- */
.content {
	grid-area: content;
	min-width: 0;
}
.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 22px 24px;
	margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 22px; }
.card h3 { margin: 18px 0 8px; font-size: 18px; color: var(--accent-strong); }
.card p { margin: 8px 0; }
.card ul, .card ol { margin: 8px 0; padding-left: 22px; }
.card li { margin: 4px 0; }
.card kbd {
	background: var(--bg); border: 1px solid var(--border); border-bottom-width: 2px;
	border-radius: 4px; padding: 1px 6px; font-family: "Segoe UI", monospace; font-size: 13px;
}
.card .step { margin: 14px 0; }
.card .step b { color: var(--text); }

/* Screenshot placeholder the user can replace with real images */
.shot {
	display: block; margin: 12px 0; border-radius: 8px;
	background:
		repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 12px, var(--bg-card) 12px, var(--bg-card) 24px);
	border: 1px dashed var(--border);
	color: var(--text-dim); font-size: 13px;
	min-height: 120px;
	display: flex; align-items: center; justify-content: center; text-align: center;
	padding: 16px;
}
.shot img { display: block; width: 100%; border-radius: 8px; }

.tip {
	background: var(--accent-bg);
	border: 1px solid rgba(47,129,247,.4);
	border-radius: 8px; padding: 10px 14px; font-size: 14px;
	margin: 12px 0;
}
.tip b { color: var(--accent-strong); }

/* In-content reusable ad unit */
.ad-inline {
	background: var(--ad-bg);
	border: 1px solid var(--ad-border);
	border-radius: 8px;
	margin: 16px 0;
	text-align: center;
	min-height: 100px;
}
.ad-inline .ad-label { font-size: 11px; color: var(--text-dim); padding: 6px; }

/* ---------- Related apps (right) ---------- */
.related {
	grid-area: related;
	position: sticky;
	top: 76px;
	align-self: start;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px;
}
.related h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.related ul { margin: 0; padding: 0; list-style: none; }
.related li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.related li:first-child { border-top: none; }
.related .thumb {
	width: 40px; height: 40px; border-radius: 6px; flex: none;
	background: var(--bg-card); border: 1px solid var(--border);
	display: flex; align-items: center; justify-content: center;
	color: var(--text-dim); font-size: 18px; overflow: hidden;
}
.related .thumb img { width: 100%; height: 100%; object-fit: cover; }
.related a { font-size: 14px; color: var(--text); line-height: 1.3; }
.related a:hover { color: var(--accent-strong); text-decoration: none; }
.related .ad-box { margin-top: 12px; }

/* ---------- Pagination ---------- */
.pagination {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	margin: 20px 0; flex-wrap: wrap;
}
.pagination a, .pagination span {
	min-width: 38px; text-align: center; padding: 8px 12px;
	border: 1px solid var(--border); border-radius: 6px; font-size: 14px; color: var(--text-dim);
}
.pagination a:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pagination .next-prev { font-weight: 600; }

/* ---------- Footer ---------- */
.footer {
	border-top: 1px solid var(--border);
	background: var(--bg-soft);
	padding: 24px 16px; text-align: center; color: var(--text-dim); font-size: 14px;
}
.footer a { margin: 0 12px; color: var(--accent-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
	.layout { grid-template-columns: 190px 230px minmax(0,1fr); grid-template-areas: "ad-left outline content"; }
	.related { display: none; }
}
@media (max-width: 960px) {
	.layout { grid-template-columns: 1fr; grid-template-areas: "content"; }
	.ad-left, .outline { display: none; }
	.topnav-inner { flex-wrap: wrap; height: auto; padding: 10px 12px; }
	.nav-links { width: 100%; justify-content: flex-start; }
}
