:root {
	--bg: #f6f6f6;
	--surface: #ffffff;
	--text: #222222;
	--muted: #888888;
	--border: #ececec;
	--accent: #e8465a;
	--accent-hover: #d13a4d;
	--accent-soft: #fde8eb;
	--star: #e8a317;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.08);
	--radius: 10px;
	--radius-sm: 8px;
	--font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
	--content-width: 1120px;
	--motion: 160ms ease;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	color-scheme: light;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
}

main {
	flex: 1;
}

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

a:hover {
	text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
	outline: 2px solid var(--accent-soft);
	outline-offset: 2px;
}

.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow);
	position: sticky;
	top: 0;
	z-index: 10;
}

.site-header__inner {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text);
	letter-spacing: -0.02em;
}

.brand span {
	color: var(--accent);
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.site-nav a {
	color: var(--muted);
	font-size: 0.9rem;
}

.site-nav a[aria-current="page"] {
	color: var(--text);
	font-weight: 600;
	text-decoration: none;
}

.auth-area {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
}

.auth-name {
	color: var(--muted);
	max-width: 10rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

main {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
}

.page-title {
	margin: 0 0 1rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.page-lead {
	margin: -0.35rem 0 1.25rem;
	max-width: 40rem;
	font-size: 0.95rem;
	color: var(--muted);
	line-height: 1.65;
}

.page-lead a {
	font-weight: 600;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	box-shadow: var(--shadow);
}

.search-form {
	display: grid;
	gap: 0.75rem;
}

.search-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: end;
}

label {
	display: grid;
	gap: 0.35rem;
	font-size: 0.85rem;
	color: var(--muted);
}

input[type="search"],
input[type="text"],
select,
textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font: inherit;
	background: #fff;
}

input[type="search"]:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--accent-soft);
	border-color: var(--accent);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 1rem;
	border: none;
	border-radius: var(--radius);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	background: var(--accent);
	color: #fff;
	transition: background var(--motion);
}

.btn:hover {
	background: var(--accent-hover);
}

.btn--ghost {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
}

.btn--ghost:hover {
	background: var(--bg);
}

.btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.product-grid {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}

.product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform var(--motion), box-shadow var(--motion);
}

.product-card__thumb {
	display: block;
	aspect-ratio: 1;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	overflow: hidden;
}

.product-card__thumb:focus-visible,
.comment-card__thumb:focus-visible {
	outline: 2px solid var(--accent-soft);
	outline-offset: -2px;
}

.product-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-card__body {
	padding: 0.75rem 0.85rem 0.9rem;
	min-width: 0;
}

.product-card__title {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

.product-card__title a {
	color: inherit;
	text-decoration: none;
}

.product-card__title a:hover {
	color: var(--accent);
}

.product-card__shop {
	margin: 0.4rem 0 0.2rem;
	font-size: 0.78rem;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.product-card__price {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--accent);
}

.product-card__meta {
	margin: 0.2rem 0 0;
	font-size: 0.75rem;
	color: var(--muted);
}

@media (max-width: 900px) {
	.product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

.rank-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	color: #fff;
	background: #555555;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rank-badge--top {
	background: var(--accent);
}

.keyword-chip-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.keyword-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg);
	font-size: 0.85rem;
	color: var(--text);
}

.keyword-chip__rank {
	font-weight: 700;
	color: var(--accent);
}

.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.comment-card {
	display: flex;
	gap: 0.85rem;
	align-items: flex-start;
	padding: 0.85rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: transform var(--motion), box-shadow var(--motion);
}

.comment-card__thumb {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--bg);
}

.comment-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.comment-card__body {
	min-width: 0;
	flex: 1;
}

.comment-card__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	font-size: 0.8rem;
	margin-bottom: 0.25rem;
	color: var(--muted);
}

.comment-card__title {
	margin: 0 0 0.25rem;
	font-size: 0.9rem;
	font-weight: 600;
}

.comment-card__title a {
	color: var(--text);
	text-decoration: none;
}

.comment-card__title a:hover {
	color: var(--accent);
}

.comment-card__text {
	margin: 0;
	font-size: 0.9rem;
	color: var(--text);
}

.empty-state,
.error-state {
	text-align: center;
	padding: 2rem 1rem;
	color: var(--muted);
}

.product-header {
	margin-bottom: 1.25rem;
}

.product-header__layout {
	display: grid;
	grid-template-columns: minmax(200px, 280px) 1fr;
	gap: 1.25rem;
	align-items: flex-start;
}

.product-thumb {
	width: 100%;
	max-width: 280px;
	aspect-ratio: 1;
	height: auto;
	object-fit: cover;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--bg);
}

.product-header__body {
	min-width: 0;
	display: grid;
	gap: 0.5rem;
}

.product-header h1 {
	margin: 0;
	font-size: 1.35rem;
}

@media (max-width: 600px) {
	.product-header__layout {
		grid-template-columns: 1fr;
	}

	.product-thumb {
		max-width: none;
	}
}

.product-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.product-shop {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.product-price {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--accent);
}

.product-actions {
	margin: 0.75rem 0 0;
}

.product-reviews {
	margin-top: 1rem;
}

.section-title {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
	font-weight: 700;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.5rem;
}

.tag {
	font-size: 0.8rem;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--muted);
}

.review-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.review-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	border-top: 1px solid var(--border);
	padding-top: 0.75rem;
}

.review-item:first-child {
	border-top: none;
	padding-top: 0;
}

.review-head {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.85rem;
	margin-bottom: 0.25rem;
}

.stars {
	color: var(--star);
	letter-spacing: 0.05em;
}

.star-input {
	display: flex;
	gap: 0.25rem;
}

.star-input button {
	border: none;
	background: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: #ccc;
	padding: 0;
	line-height: 1;
}

.star-input button.active,
.star-input button:hover {
	color: var(--star);
}

.review-note {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.review-login {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	display: grid;
	gap: 0.75rem;
	justify-items: start;
}

.review-login p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--muted);
}

.review-form {
	display: grid;
	gap: 0.75rem;
	margin-top: 1rem;
}

.ranking-section {
	margin-bottom: 2rem;
}

.ranking-section h2 {
	font-size: 1.1rem;
	margin: 0 0 0.75rem;
}

.loading {
	color: var(--muted);
	font-size: 0.9rem;
}

.site-footer {
	margin-top: auto;
	border-top: 1px solid var(--border);
	background: var(--surface);
}

.site-footer__inner {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 1.25rem 1rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	text-align: center;
}

.site-footer__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1.25rem;
	font-size: 0.875rem;
}

.site-footer__nav a {
	color: var(--muted);
}

.site-footer__nav a:hover {
	color: var(--accent);
}

.site-footer__copy {
	margin: 0;
	font-size: 0.8rem;
	color: var(--muted);
}

.legal {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 1.5rem 1rem 2rem;
}

.legal-updated {
	margin: -0.5rem 0 1.25rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.legal-section h2 {
	font-size: 1.05rem;
	margin: 1.5rem 0 0.5rem;
}

.legal-section h2:first-child {
	margin-top: 0;
}

.legal-section p,
.legal-section ul {
	margin: 0 0 0.75rem;
}

.legal-section ul {
	padding-left: 1.25rem;
}

.legal-section li + li {
	margin-top: 0.35rem;
}

@media (max-width: 600px) {
	.site-header__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.search-form__row {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (hover: hover) {
	.product-card:hover {
		transform: translateY(-2px);
		box-shadow: var(--shadow-hover);
		text-decoration: none;
	}

	.comment-card:hover {
		transform: translateY(-2px);
		box-shadow: var(--shadow-hover);
	}
}

@media (prefers-reduced-motion: reduce) {
	.btn,
	.product-card,
	.comment-card {
		transition: none;
	}
	.product-card:hover,
	.comment-card:hover {
		transform: none;
	}
}
