/* リンクページのデザイン。色やサイズはここを編集してください。 */
* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
	color: var(--text);
	background: var(--bg);
	min-height: 100vh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* テーマ */
body.theme-cream { --bg: linear-gradient(160deg, #faf6ef 0%, #f1e9db 100%); --card: #ffffff; --border: rgba(44, 44, 43, 0.08); --text: #2c2c2b; --muted: #7d7a75; --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04); }
body.theme-white { --bg: #ffffff; --card: #ffffff; --border: #e6e5e3; --text: #2c2c2b; --muted: #7d7a75; --shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
body.theme-sky { --bg: linear-gradient(160deg, #eaf4fd 0%, #d5e8f9 100%); --card: #ffffff; --border: rgba(39, 131, 222, 0.12); --text: #2c2c2b; --muted: #6b7683; --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(39, 131, 222, 0.06); }
body.theme-mint { --bg: linear-gradient(160deg, #eaf5ee 0%, #d6ecdf 100%); --card: #ffffff; --border: rgba(70, 161, 113, 0.14); --text: #2c2c2b; --muted: #6d7a72; --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(70, 161, 113, 0.06); }
body.theme-sunset { --bg: linear-gradient(160deg, #fdefe6 0%, #f9ddd6 100%); --card: #ffffff; --border: rgba(213, 128, 59, 0.14); --text: #2c2c2b; --muted: #82756d; --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(213, 128, 59, 0.06); }
body.theme-rose      { --bg: linear-gradient(160deg, #fef0f3 0%, #fddde6 100%); --card: #ffffff; --border: rgba(220, 80, 120, 0.12); --text: #2c2c2b; --muted: #82707a; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(220,80,120,.06); }
body.theme-lavender  { --bg: linear-gradient(160deg, #f3f0fd 0%, #e4ddf9 100%); --card: #ffffff; --border: rgba(120, 90, 210, 0.13); --text: #2c2c2b; --muted: #74708a; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(120,90,210,.07); }
body.theme-forest    { --bg: linear-gradient(160deg, #eef4ee 0%, #d8e9d8 100%); --card: #f8fdf8; --border: rgba(50, 120, 70, 0.15); --text: #1e2e20; --muted: #607060; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(50,120,70,.07); }
body.theme-ocean     { --bg: linear-gradient(160deg, #e8f4f8 0%, #c8e2f0 100%); --card: #ffffff; --border: rgba(20, 100, 160, 0.13); --text: #0e2030; --muted: #5a7a90; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(20,100,160,.07); }
body.theme-sand      { --bg: linear-gradient(160deg, #f8f4ed 0%, #ede5d6 100%); --card: #fdfaf6; --border: rgba(160, 130, 80, 0.14); --text: #2e2820; --muted: #807060; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 12px rgba(160,130,80,.06); }
body.theme-charcoal  { --bg: #2a2a2a; --card: #333333; --border: rgba(255,255,255,.14); --text: #f0f0f0; --muted: rgba(255,255,255,.55); --shadow: none; }
body.theme-dark { --bg: #191919; --card: #202020; --border: rgba(255, 255, 255, 0.16); --text: #ffffff; --muted: rgba(255, 255, 255, 0.65); --shadow: none; }

.page {
	max-width: 480px;
	margin: 0 auto;
	padding: 48px 24px 48px;
}

/* プロフィール */
.profile {
	text-align: center;
}

.avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	margin: 0 auto 16px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	font-weight: 600;
	background: var(--card);
	color: var(--muted);
}

.name {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	letter-spacing: 0.01em;
}

.bio {
	font-size: 14px;
	line-height: 1.7;
	color: var(--muted);
	margin: 0;
}

/* SNSアイコン */
.sns {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 24px 0 0;
}

.sns-btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--card);
	border: 1px solid var(--border);
	color: var(--text);
	box-shadow: var(--shadow);
	transition: transform 0.15s ease;
}

.sns-btn svg {
	width: 20px;
	height: 20px;
}

.sns-btn:hover {
	transform: translateY(-2px);
}

/* リンクボタン */
.links {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 32px;
}

.link-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 8px;
	text-decoration: none;
	color: var(--text);
	box-shadow: var(--shadow);
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover {
	background: var(--card-hover, var(--card));
	box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

.link-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.link-title {
	font-size: 15px;
	font-weight: 600;
}

.link-desc {
	font-size: 13px;
	color: var(--muted);
}

.chevron {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--muted);
}

.footer {
	margin-top: 48px;
	text-align: center;
	font-size: 12px;
	color: var(--muted);
}

a:focus-visible {
	outline: 2px solid #2783de;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.sns-btn,
	.link-card {
		transition: none;
	}
}

@media (max-width: 420px) {
	.page {
		padding: 40px 16px 40px;
	}
}

/* 作品ギャラリー */
.gallery {
	margin-top: 32px;
}

.gallery-toggle {
	width: 100%;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
}

.gallery-toggle .chevron-down {
	transition: transform 0.2s ease;
}

.gallery-toggle[aria-expanded="true"] .chevron-down {
	transform: rotate(180deg);
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-top: 12px;
	animation: gallery-in 0.25s ease;
}

.gallery-grid[hidden] {
	display: none;
}

@keyframes gallery-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	text-align: left;
	color: var(--text);
	font-family: inherit;
	text-decoration: none;
}

.tile-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--card);
	box-shadow: var(--shadow);
	display: block;
	transition: transform 0.15s ease;
}

.tile:hover .tile-img {
	transform: translateY(-2px);
}

.tile:focus-visible {
	outline: 2px solid #2783de;
	outline-offset: 2px;
}

.tile-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.5;
	padding: 8px;
	text-align: center;
}

.tile-title {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.4;
}

@media (max-width: 420px) {
	.gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gallery-grid {
		animation: none;
	}
	.tile-img {
		transition: none;
	}
}

/* ライトボックス（作品の拡大表示） */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.lightbox[hidden] {
	display: none;
}

.lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.lightbox-panel {
	position: relative;
	background: var(--card);
	color: var(--text);
	border-radius: 16px;
	max-width: 560px;
	width: 100%;
	max-height: 88vh;
	overflow: auto;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.lightbox-media {
	position: relative;
	background: #17171a;
	border-radius: 16px 16px 0 0;
	overflow: hidden;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox-media.no-image {
	background: linear-gradient(160deg, #2b2b30, #17171a);
}

.lightbox-img {
	width: 100%;
	max-height: 62vh;
	object-fit: contain;
	display: block;
}

.lightbox-img[hidden] {
	display: none;
}

.lightbox-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 48px 20px 18px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.68) 75%);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lightbox-overlay h2 {
	margin: 0;
	font-size: 17px;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.channel-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.channel-links[hidden] {
	display: none;
}

.channel-btn {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 6px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: #1c1c1c;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: transform 0.15s ease;
}

.channel-btn:hover {
	background: #fff;
	transform: translateY(-1px);
}

.lightbox-body {
	padding: 20px 24px 24px;
}

.lightbox-body h2 {
	font-size: 17px;
	margin: 0 0 8px;
}

.lightbox-body p {
	font-size: 14px;
	color: var(--muted);
	margin: 0;
	line-height: 1.7;
}

.lightbox-body p[hidden] {
	display: none;
}

.lightbox-body[hidden] {
	display: none;
}

.lightbox-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	cursor: pointer;
	font-size: 14px;
}

/* 壁紙 */
/* 画像カード型リンク */
.link-banner {
	display: block;
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	text-decoration: none;
	box-shadow: var(--shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.link-banner:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(0,0,0,.14);
}
.link-banner-img {
	width: 100%;
	aspect-ratio: 16 / 7;
	object-fit: cover;
	display: block;
}
.link-banner-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px 18px 14px;
	background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 100%);
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.link-banner-title {
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}
.link-banner-desc {
	color: rgba(255,255,255,.82);
	font-size: 13px;
	line-height: 1.4;
}

/* 投稿フィード */
.post-feed {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}
.post-card {
	background: var(--card);
	border-radius: 16px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.post-img {
	width: 100%;
	display: block;
	object-fit: cover;
	max-height: 360px;
}
.post-text {
	padding: 14px 16px 4px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--text);
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}
.post-card:not(:has(.post-text)) .post-date,
.post-date {
	display: block;
	padding: 6px 16px 12px;
	font-size: 11px;
	color: var(--muted);
}

#wallpaper-layer {
	position: fixed;
	inset: 0;
	z-index: -1;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
body.has-wallpaper { background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; }
body.has-wallpaper .name, body.has-wallpaper .bio, body.has-wallpaper .footer { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18); }

/* シェアボタン */
.share { position: fixed; top: 16px; right: 16px; z-index: 50; }
.share-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.08); background: rgba(255, 255, 255, 0.92); color: #333; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); transition: transform 0.15s ease; }
.share-btn svg { width: 20px; height: 20px; }
.share-btn:hover { transform: translateY(-1px); }
.share-menu { position: absolute; top: 52px; right: 0; min-width: 190px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16); padding: 6px; display: flex; flex-direction: column; }
.share-menu[hidden] { display: none; }
.share-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-size: 14px; font-family: inherit; color: #2c2c2b; cursor: pointer; text-decoration: none; }
.share-item:hover { background: #f0efed; }
body.theme-dark .share-btn { background: rgba(32, 32, 32, 0.92); color: #eee; border-color: rgba(255, 255, 255, 0.12); }
body.theme-dark .share-menu { background: #202020; border-color: rgba(255, 255, 255, 0.12); }
body.theme-dark .share-item { color: #eee; }
body.theme-dark .share-item:hover { background: #2b2b2b; }

/* リンクボタンの画像 */
.link-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }

/* 表示形式選択 */
.display-type-group { display: flex; gap: 16px; margin-bottom: 4px; }
.display-type-opt { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.display-type-opt input { accent-color: #2783DE; width: 16px; height: 16px; }

/* いいねボタン */
.post-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 16px 10px;
}
.like-btn {
	display: flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 20px;
	transition: background 0.15s ease, transform 0.12s ease;
	font-size: 14px;
	color: var(--muted);
	font-family: inherit;
}
.like-btn:hover {
	background: rgba(255, 80, 80, 0.08);
}
.like-btn.liked {
	color: #e03;
	font-weight: 600;
}
.like-btn.liked .like-heart {
	animation: like-pop 0.35s ease;
}
.like-btn.pop {
	transform: scale(1.18);
}
.like-count {
	min-width: 1ch;
}
@keyframes like-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.45); }
	70%  { transform: scale(0.9); }
	100% { transform: scale(1); }
}
