/*
Theme Name: TM
Theme URI: https://tm.vmcc.cn/
Author: TM
Author URI: https://tm.vmcc.cn/
Description: A clean, responsive WordPress theme for the TM site.
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tm
Tags: custom-logo, custom-menu, featured-images, blog, responsive-layout, translation-ready
*/

:root {
	--tm-bg: #f5f7fb;
	--tm-surface: #ffffff;
	--tm-text: #1f2937;
	--tm-muted: #6b7280;
	--tm-accent: #2563eb;
	--tm-border: #e5e7eb;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--tm-bg);
	color: var(--tm-text);
	line-height: 1.7;
	min-height: 100vh;
}

.site-wrapper {
	min-height: 100vh;
	position: relative;
}

#app {
	min-height: calc(100vh - 0px);
}

a {
	color: var(--tm-accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.container {
	width: min(1120px, calc(100% - 32px));
	margin: 0 auto;
}

.site-header,
.site-footer {
	background: var(--tm-surface);
	border-bottom: 1px solid var(--tm-border);
}

.site-footer {
	border-top: 1px solid var(--tm-border);
	border-bottom: 0;
	margin-top: 48px;
}

.header-inner,
.footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 24px 0;
}

.site-title,
.site-description {
	margin: 0;
}

.site-title {
	font-size: 1.5rem;
	font-weight: 700;
}

.site-description {
	color: var(--tm-muted);
	font-size: 0.95rem;
}

.primary-menu {
	display: flex;
	gap: 18px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.site-main {
	padding: 48px 0;
}

.market-app {
	min-height: 100vh;
	background: #f5f7fb;
}

.market-header,
.market-topbar,
.market-filters,
.market-summary,
.market-actions-bar,
.market-pagination--bottom,
.market-footer {
	background: #fff;
}

.market-header {
	border-bottom: 1px solid var(--tm-border);
	box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.market-header__inner {
	display: grid;
	grid-template-columns: 120px minmax(320px, 1fr) auto;
	align-items: center;
	gap: 20px;
	padding: 12px 0;
}

.market-logo {
	display: inline-flex;
	align-items: center;
	color: var(--tm-accent);
	font-weight: 800;
	font-size: 20px;
}

.market-search {
	display: flex;
	align-items: stretch;
	gap: 0;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
}

.market-search__mode {
	padding: 0 16px;
	display: inline-flex;
	align-items: center;
	border-right: 1px solid #e5e7eb;
	color: #4b5563;
	background: #fff;
	min-width: 80px;
	justify-content: center;
}

.market-search__input {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 12px 14px;
	font-size: 15px;
	outline: none;
}

.market-search__button {
	border: 0;
	background: var(--tm-accent);
	color: #fff;
	padding: 0 18px;
	font-weight: 700;
	cursor: pointer;
}

.market-header__nav {
	display: flex;
	gap: 18px;
	align-items: center;
}

.market-header__nav a { color: #374151; font-weight: 600; }
.market-header__nav .is-active { color: var(--tm-accent); }

.market-main { padding-bottom: 84px; }

.market-topbar,
.market-filters,
.market-summary,
.market-actions-bar,
.market-pagination--bottom {
	border: 1px solid var(--tm-border);
	border-radius: 18px;
	padding: 14px 16px;
	margin-top: 14px;
}

.market-topbar__left,
.market-topbar__right,
.market-actions-inline {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.market-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.market-filter-btn,
.market-action-btn,
.market-check {
	border: 1px solid var(--tm-border);
	background: #fff;
	border-radius: 12px;
	padding: 10px 14px;
	font-weight: 600;
	color: var(--tm-text);
}

.market-filter-btn.is-active { border-color: #dbeafe; color: var(--tm-accent); background: #eff6ff; }
.market-action-btn.is-primary { background: var(--tm-accent); color: #fff; border-color: var(--tm-accent); }
.market-action-btn.is-ghost { background: transparent; }

.market-sort { padding-right: 36px; }
.market-view-switch { display: inline-flex; gap: 8px; color: #9ca3af; }
.market-view-switch .is-active { color: var(--tm-accent); }

.market-filter-row { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 10px 0; }
.market-filter-row + .market-filter-row { border-top: 1px solid #f3f4f6; }
.market-filter-row__label { font-weight: 700; color: #111827; }
.market-filter-row__content { display: flex; flex-wrap: wrap; gap: 10px; }
.market-chip { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 999px; background: #f8fafc; border: 1px solid #e5e7eb; color: #374151; font-size: 14px; }
.market-chip.is-active { background: #eff6ff; border-color: #bfdbfe; color: var(--tm-accent); }

.market-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #4b5563; }
.market-summary__left, .market-summary__right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.market-summary__divider { color: #d1d5db; }

.market-pagination-lite { color: #6b7280; font-weight: 600; }
.market-actions-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.market-check input { margin-right: 6px; }

.market-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin-top: 18px;
}

.market-grid--trademark { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.brand-card,
.trademark-card {
	background: rgba(255,255,255,.96);
	border: 1px solid var(--tm-border);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(15,23,42,.05);
}

.brand-card__link,
.trademark-card__link {
	display: block;
	color: inherit;
}

.brand-card__media img,
.brand-card__placeholder {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eff6ff, #f8fafc);
	color: var(--tm-accent);
	font-weight: 800;
	padding: 20px;
	text-align: center;
}

.brand-card__body {
	padding: 16px;
}

.brand-card__title {
	font-size: 1rem;
	font-weight: 800;
	margin-bottom: 8px;
}

.brand-card__meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--tm-muted);
	font-size: 13px;
	margin-bottom: 10px;
}

.brand-card__price {
	color: #dc2626;
	font-weight: 800;
}

.brand-card__desc {
	color: var(--tm-muted);
	font-size: 14px;
	line-height: 1.6;
}

.market-pagination {
	margin-top: 24px;
}

@media (max-width: 1100px) {
	.market-toolbar,
	.market-grid {
		grid-template-columns: 1fr 1fr;
	}
	.market-actions {
		justify-content: flex-start;
	}
}

@media (max-width: 768px) {
	.header-inner,
	.footer-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.primary-menu {
		flex-wrap: wrap;
	}

	.market-toolbar,
	.market-summary,
	.filter-row {
		grid-template-columns: 1fr;
		flex-direction: column;
	}

	.market-grid {
		grid-template-columns: 1fr;
	}
}
