/*
Theme Name: VPSDeal
Description: VPS 优惠 / 测评资讯站主题，配合「VPS 推广链接管理」插件使用。
Version: 1.0
Text Domain: vpsdeal
*/

:root {
	--bg: #f4f6f9;
	--card: #ffffff;
	--text: #1f2933;
	--muted: #6b7785;
	--line: #e3e8ee;
	--brand: #1d6ff2;
	--brand-dark: #1557c2;
	--accent: #ff6a00;
	--radius: 8px;
	--maxw: 1160px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: #0f1b2d; color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.site-title { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.site-title:hover { color: #fff; text-decoration: none; }
.site-title span { color: var(--accent); }
.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a { display: block; white-space: nowrap; color: #cfd8e3; padding: 8px 12px; border-radius: 6px; font-size: 15px; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-parent > a { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #0f1b2d; min-width: 160px; padding: 6px; border-radius: 0 0 6px 6px; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.main-nav li:hover > .sub-menu { display: flex; }
.header-search input { background: rgba(255,255,255,.1); border: 0; color: #fff; padding: 7px 12px; border-radius: 6px; width: 180px; }
.header-search input::placeholder { color: #9aa8b8; }

/* Layout */
.site-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 24px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* Post list */
.post-item { padding: 20px 22px; margin-bottom: 14px; }
.post-item h2 { font-size: 18px; line-height: 1.5; margin: 0 0 8px; }
.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--brand); text-decoration: none; }
.post-item .excerpt { color: #4a5560; margin: 0 0 10px; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 12px; }
.meta a { color: var(--muted); }
.badge { display: inline-block; font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 4px; background: #eaf1fe; color: var(--brand); margin-right: 6px; vertical-align: 2px; }
.badge.sticky-badge { background: #fff0e6; color: var(--accent); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.pagination .page-numbers { padding: 6px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Single */
.entry { padding: 28px 32px; }
.entry h1 { font-size: 24px; line-height: 1.45; margin: 0 0 10px; }
.entry .meta { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.entry-content h2 { font-size: 20px; margin: 30px 0 12px; padding-left: 10px; border-left: 4px solid var(--brand); }
.entry-content h3 { font-size: 17px; margin: 24px 0 10px; }
.entry-content pre { background: #0f1b2d; color: #e6edf3; padding: 14px 16px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.entry-content code { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.entry-content :not(pre) > code { background: #f0f3f7; padding: 2px 6px; border-radius: 4px; }
.entry-content blockquote { margin: 16px 0; padding: 10px 16px; background: #f7f9fc; border-left: 4px solid var(--line); color: #4a5560; }
.entry-content table:not(.vps-plans) { border-collapse: collapse; width: 100%; margin: 16px 0; }
.entry-content table:not(.vps-plans) th, .entry-content table:not(.vps-plans) td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.entry-tags a { display: inline-block; font-size: 13px; padding: 3px 10px; margin: 0 6px 6px 0; border-radius: 999px; background: #f0f3f7; color: #4a5560; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px 22px; font-size: 14px; }

/* Affiliate components */
.vps-btn { display: inline-block; background: var(--accent); color: #fff !important; font-weight: 600; padding: 10px 22px; border-radius: 6px; white-space: nowrap; text-decoration: none !important; }
.vps-btn:hover { background: #e65f00; }
.vps-btn-sm { padding: 5px 14px; font-size: 13px; }
.vps-plans-wrap { overflow-x: auto; margin: 16px 0; }
.vps-plans { width: 100%; border-collapse: collapse; font-size: 14px; }
.vps-plans th { background: #0f1b2d; color: #fff; font-weight: 600; padding: 9px 10px; text-align: left; white-space: nowrap; }
.vps-plans td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.vps-plans tr:nth-child(even) td { background: #f8fafc; }
.vps-plans td:nth-last-child(2) { color: var(--accent); font-weight: 700; white-space: nowrap; }
.vps-coupon { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border: 2px dashed var(--accent); background: #fff8f2; padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; }
.vps-coupon-label { font-weight: 700; color: var(--accent); }
.vps-coupon-code { font-size: 18px !important; font-weight: 700; letter-spacing: 1px; background: #fff !important; padding: 4px 12px !important; }
.vps-copy { border: 0; background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.vps-coupon-note { color: var(--muted); font-size: 13px; }
.vps-provider { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1px solid var(--line); border-left: 4px solid var(--brand); background: #f7faff; padding: 16px 20px; border-radius: var(--radius); margin: 18px 0; }
.vps-provider-main { flex: 1; min-width: 220px; }
.vps-provider-name { font-size: 17px; }
.vps-provider p { margin: 4px 0 0; color: #4a5560; font-size: 14px; }
.vps-provider-pay { font-size: 13px !important; color: var(--muted) !important; }
.vps-disclosure { margin-top: 28px; font-size: 13px; color: var(--muted); background: #f7f9fc; padding: 10px 14px; border-radius: 6px; }

/* Sidebar */
.sidebar .widget { padding: 18px 20px; margin-bottom: 16px; }
.widget-title { font-size: 16px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.5; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--text); }
.widget li a:hover { color: var(--brand); }
.rank-list { counter-reset: rank; }
.rank-list li { display: flex; gap: 10px; align-items: baseline; }
.rank-list li::before { counter-increment: rank; content: counter(rank); flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 12px; border-radius: 4px; background: #e8edf3; color: var(--muted); }
.rank-list li:nth-child(-n+3)::before { background: var(--accent); color: #fff; }
.provider-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.provider-list .tag { font-size: 12px; color: var(--muted); }
.search-form { display: flex; gap: 6px; }
.search-form input[type=search] { flex: 1; border: 1px solid var(--line); padding: 7px 10px; border-radius: 6px; min-width: 0; }
.search-form button { border: 0; background: var(--brand); color: #fff; padding: 7px 14px; border-radius: 6px; cursor: pointer; }

/* Footer */
.site-footer { background: #0f1b2d; color: #8b98a8; font-size: 13px; padding: 24px 0; margin-top: 20px; }
.site-footer a { color: #b6c2d0; }
.site-footer p { margin: 4px 0; }

.archive-head { padding: 16px 22px; margin-bottom: 14px; }
.archive-head h1 { font-size: 20px; margin: 0; }
.archive-head p { margin: 6px 0 0; color: var(--muted); }

@media (max-width: 900px) {
	.site-main { grid-template-columns: 1fr; }
	.header-search { display: none; }
	.site-header { position: static; }
	.site-header .wrap { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
	.main-nav ul { overflow-x: auto; flex-wrap: nowrap; }
	.main-nav .sub-menu { display: none !important; }
	.entry { padding: 20px 16px; }
	.entry h1 { font-size: 20px; }
	.site-title { font-size: 18px; }
	.post-item { padding: 16px; }
	.vps-plans thead { display: none; }
	.vps-plans tr { display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; padding: 6px 10px; }
	.vps-plans tr:nth-child(even) td { background: transparent; }
	.vps-plans td { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 6px 0; }
	.vps-plans td:last-child { border-bottom: 0; justify-content: flex-end; }
	.vps-plans td[data-label]::before { content: attr(data-label); color: var(--muted); }
}
