/* 云小店模板样式 */
:root {
	--ys-primary: #2b8cff;
	--ys-primary-dark: #1677ff;
	--ys-cyan: #00d4ff;
	--ys-bg-start: #dceefb;
	--ys-bg-end: #eef7ff;
	--ys-card: #ffffff;
	--ys-text: #333333;
	--ys-muted: #888888;
	--ys-border: #e8eef5;
	--ys-radius: 16px;
	--ys-shadow: 0 8px 32px rgba(43, 140, 255, 0.08);
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	color: var(--ys-text);
	background: linear-gradient(160deg, var(--ys-bg-start) 0%, var(--ys-bg-end) 45%, #f5fbff 100%);
	min-height: 100vh;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background:
		radial-gradient(circle at 10% 20%, rgba(43, 140, 255, 0.12) 0%, transparent 40%),
		radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 35%);
	pointer-events: none;
	z-index: 0;
}

.ys-wrap {
	position: relative;
	z-index: 1;
	max-width: 960px;
	margin: 0 auto;
	padding: 20px 16px 80px;
}

/* Header */
.ys-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.ys-brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--ys-text);
}

.ys-brand img {
	display: block;
	max-height: 48px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

.ys-btn-query {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	background: linear-gradient(135deg, var(--ys-primary) 0%, var(--ys-cyan) 100%);
	color: #fff;
	text-decoration: none;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 4px 14px rgba(43, 140, 255, 0.35);
	transition: transform .15s, box-shadow .15s;
}

.ys-btn-query:hover {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(43, 140, 255, 0.45);
}

.ys-btn-query svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Card */
.ys-card {
	background: var(--ys-card);
	border-radius: var(--ys-radius);
	box-shadow: var(--ys-shadow);
	padding: 20px 22px;
	margin-bottom: 16px;
	border: 1px solid rgba(255, 255, 255, 0.8);
}

.ys-card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 14px;
	color: var(--ys-text);
}

.ys-card-title svg {
	width: 18px;
	height: 18px;
	fill: var(--ys-primary);
	flex-shrink: 0;
}

/* Notice */
.ys-notice {
	font-size: 14px;
	line-height: 1.8;
	color: #555;
}

.ys-notice ol {
	margin: 0;
	padding-left: 20px;
}

.ys-notice strong,
.ys-notice b {
	color: #e53935;
	font-weight: 600;
}

/* Category tabs */
.ys-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.ys-cat-tab {
	min-width: 120px;
	padding: 12px 18px;
	border: none;
	border-radius: 12px;
	background: #f0f4f8;
	color: #666;
	cursor: pointer;
	text-align: center;
	transition: all .2s;
	font-size: 14px;
	line-height: 1.4;
}

.ys-cat-tab:hover {
	background: #e3edf7;
}

.ys-cat-tab.active {
	background: linear-gradient(135deg, var(--ys-primary) 0%, #4dabff 100%);
	color: #fff;
	box-shadow: 0 4px 12px rgba(43, 140, 255, 0.35);
}

.ys-cat-tab .ys-cat-count {
	display: block;
	font-size: 12px;
	opacity: .85;
	margin-top: 2px;
}

/* Product grid */
.ys-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px;
}

.ys-product {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--ys-border);
	border-radius: 14px;
	cursor: pointer;
	transition: all .2s;
	background: #fafcff;
	text-decoration: none;
	color: inherit;
}

.ys-product:hover {
	border-color: var(--ys-primary);
	box-shadow: 0 4px 16px rgba(43, 140, 255, 0.12);
	transform: translateY(-2px);
}

.ys-product-img {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: cover;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid var(--ys-border);
}

.ys-product-body {
	flex: 1;
	min-width: 0;
}

.ys-product-name {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ys-product-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--ys-primary-dark);
	margin-bottom: 6px;
}

.ys-product-price small {
	font-size: 13px;
	font-weight: 500;
}

.ys-stock-bar {
	height: 4px;
	background: #e8eef5;
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 4px;
}

.ys-stock-bar span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, #52c41a, #73d13d);
	border-radius: 2px;
	transition: width .3s;
}

.ys-stock-text {
	font-size: 12px;
	color: var(--ys-muted);
}

.ys-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--ys-muted);
	font-size: 14px;
}

/* Product detail */
.ys-detail-grid {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 24px;
}

.ys-detail-img {
	width: 100%;
	border-radius: 14px;
	border: 1px solid var(--ys-border);
	background: #fff;
}

.ys-detail-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 10px;
}

.ys-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.ys-tag {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
}

.ys-tag-green {
	background: #e8f8e8;
	color: #389e0d;
}

.ys-tag-blue {
	background: #e6f4ff;
	color: var(--ys-primary-dark);
}

.ys-detail-price {
	font-size: 28px;
	font-weight: 700;
	color: #e53935;
	margin-bottom: 18px;
}

.ys-detail-price del {
	font-size: 14px;
	color: #bbb;
	font-weight: 400;
	margin-left: 8px;
}

.ys-form-row {
	display: flex;
	align-items: center;
	margin-bottom: 14px;
}

.ys-form-label {
	width: 80px;
	flex-shrink: 0;
	font-size: 14px;
	color: #666;
	text-align: right;
	padding-right: 12px;
}

.ys-form-control {
	flex: 1;
}

.ys-input {
	width: 100%;
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--ys-border);
	border-radius: 10px;
	font-size: 14px;
	outline: none;
	transition: border-color .2s;
}

.ys-input:focus {
	border-color: var(--ys-primary);
}

.ys-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ys-border);
	border-radius: 10px;
	overflow: hidden;
}

.ys-stepper button {
	width: 36px;
	height: 36px;
	border: none;
	background: #f5f8fc;
	cursor: pointer;
	font-size: 18px;
	color: #666;
	line-height: 1;
}

.ys-stepper button:hover {
	background: #e8eef5;
}

.ys-stepper input {
	width: 50px;
	height: 36px;
	border: none;
	border-left: 1px solid var(--ys-border);
	border-right: 1px solid var(--ys-border);
	text-align: center;
	font-size: 14px;
	outline: none;
}

/* Payment */
.ys-pay-methods {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ys-pay-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 2px solid var(--ys-border);
	border-radius: 12px;
	cursor: pointer;
	transition: all .2s;
	font-size: 14px;
	background: #fff;
}

.ys-pay-item:hover {
	border-color: #b3d4ff;
}

.ys-pay-item.active {
	border-color: var(--ys-primary);
	background: #f0f7ff;
}

.ys-pay-item input {
	display: none;
}

.ys-pay-item img {
	width: 22px;
	height: 22px;
}

.ys-btn-submit {
	width: 100%;
	height: 46px;
	margin-top: 8px;
	border: none;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--ys-primary) 0%, var(--ys-cyan) 100%);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(43, 140, 255, 0.35);
	transition: transform .15s;
}

.ys-btn-submit:hover {
	transform: translateY(-1px);
}

.ys-btn-submit:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

/* Description */
.ys-desc {
	font-size: 14px;
	line-height: 1.8;
	color: #555;
}

.ys-desc img {
	max-width: 100%;
	height: auto;
}

/* Query page */
.ys-query-tabs {
	display: flex;
	gap: 24px;
	border-bottom: 1px solid var(--ys-border);
	margin-bottom: 20px;
	padding-bottom: 0;
}

.ys-query-tab {
	padding: 8px 4px 12px;
	border: none;
	background: none;
	font-size: 14px;
	color: #666;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: all .2s;
}

.ys-query-tab.active {
	color: var(--ys-primary-dark);
	border-bottom-color: var(--ys-primary);
	font-weight: 600;
}

.ys-query-tip {
	text-align: center;
	color: var(--ys-primary);
	font-size: 14px;
	margin-bottom: 20px;
}

.ys-query-panel {
	display: none;
}

.ys-query-panel.active {
	display: block;
}

.ys-result-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin-top: 16px;
}

.ys-result-table th,
.ys-result-table td {
	padding: 10px 12px;
	border: 1px solid var(--ys-border);
	text-align: left;
}

.ys-result-table th {
	background: #f5f8fc;
	font-weight: 600;
}

.ys-km-cell {
	word-break: break-all;
	color: #e53935;
	font-weight: 500;
}

/* Footer */
.ys-footer {
	text-align: center;
	padding: 24px 16px;
	color: #aaa;
	font-size: 13px;
}

/* FAB */
.ys-fab {
	position: fixed;
	right: 24px;
	bottom: 80px;
	z-index: 99;
}

.ys-fab a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ys-primary) 0%, var(--ys-cyan) 100%);
	color: #fff;
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(43, 140, 255, 0.4);
	font-size: 11px;
	gap: 2px;
	transition: transform .15s;
}

.ys-fab a:hover {
	color: #fff;
	transform: scale(1.05);
}

.ys-fab svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* Mobile */
@media (max-width: 768px) {
	.ys-wrap {
		padding: 12px 12px 70px;
	}

	.ys-detail-grid {
		grid-template-columns: 1fr;
	}

	.ys-products {
		grid-template-columns: 1fr;
	}

	.ys-form-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ys-form-label {
		width: auto;
		text-align: left;
		padding-right: 0;
		margin-bottom: 6px;
	}

	.ys-query-tabs {
		gap: 12px;
		overflow-x: auto;
		white-space: nowrap;
	}

	.ys-fab {
		right: 16px;
		bottom: 60px;
	}
}
