/* ============================================================
   铝材自动报价系统 — 前端样式
   现代简洁风：渐变主视觉 + 卡片 + 细腻交互
   ============================================================ */

.aqs-app {
	--aqs-primary: #1d4ed8;
	--aqs-primary-600: #2563eb;
	--aqs-primary-500: #3b82f6;
	--aqs-primary-soft: rgba(37, 99, 235, 0.1);
	--aqs-primary-dark: #1e40af;
	--aqs-accent: #f59e0b;
	--aqs-green: #059669;
	--aqs-bg: #f4f6fb;
	--aqs-card: #ffffff;
	--aqs-border: #e5e9f2;
	--aqs-border-strong: #d3dae8;
	--aqs-text: #1f2937;
	--aqs-muted: #64748b;
	--aqs-radius: 16px;
	--aqs-radius-sm: 10px;
	--aqs-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
	--aqs-shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
	--aqs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	max-width: 1120px;
	margin: 0 auto;
	padding: 20px 16px 48px;
	font-family: var(--aqs-font);
	color: var(--aqs-text);
	box-sizing: border-box;
	font-size: 14px;
	line-height: 1.6;
}

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

/* hidden 属性必须优先于组件内的 display 规则，否则加载层会一直显示 */
.aqs-app [hidden] {
	display: none !important;
}

/* ---------------- 顶部主视觉 ---------------- */
.aqs-header {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #0f2a6b 0%, #1d4ed8 55%, #3b82f6 100%);
	color: #fff;
	border-radius: var(--aqs-radius);
	padding: 28px 28px 24px;
	margin-bottom: 20px;
	box-shadow: 0 12px 32px rgba(29, 78, 216, 0.28);
}

.aqs-header::before {
	content: "";
	position: absolute;
	right: -80px;
	top: -120px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
	pointer-events: none;
}

.aqs-header::after {
	content: "";
	position: absolute;
	left: 30%;
	bottom: -90px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
	pointer-events: none;
}

.aqs-header-top {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.aqs-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 1.45rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.aqs-title-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.25);
}

.aqs-version {
	font-size: 0.72rem;
	opacity: 0.85;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.22);
	padding: 3px 10px;
	border-radius: 999px;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.aqs-price-banner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.aqs-price-main {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 10px;
}

.aqs-price-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 500;
	opacity: 0.92;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.18);
	padding: 4px 12px;
	border-radius: 999px;
}

.aqs-price-number {
	font-size: 2.1rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1;
	background: linear-gradient(180deg, #fff 20%, #dbe6ff 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.aqs-price-unit {
	font-size: 0.9rem;
	opacity: 0.85;
}

.aqs-price-badge {
	font-size: 0.7rem;
	background: var(--aqs-accent);
	color: #422006;
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 700;
	box-shadow: 0 1px 4px rgba(245, 158, 11, 0.5);
}

.aqs-price-updated {
	font-size: 0.78rem;
	opacity: 0.75;
	width: 100%;
}

/* ---------------- 通用区块 ---------------- */
.aqs-section {
	background: var(--aqs-card);
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius);
	padding: 22px 24px;
	margin-bottom: 16px;
	box-shadow: var(--aqs-shadow);
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.aqs-section:hover {
	border-color: var(--aqs-border-strong);
	box-shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.08);
}

.aqs-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px dashed var(--aqs-border-strong);
}

.aqs-section-header h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--aqs-text);
}

.aqs-section-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--aqs-primary-soft);
	color: var(--aqs-primary-600);
	flex-shrink: 0;
}

.aqs-hint {
	color: var(--aqs-muted);
	font-size: 0.84rem;
	margin: 0 0 14px;
	line-height: 1.6;
}

.aqs-hint strong {
	color: var(--aqs-primary-600);
	font-weight: 600;
}

/* ---------------- 表单 ---------------- */
.aqs-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.aqs-form-grid label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--aqs-text);
}

.aqs-form-grid label.aqs-full {
	grid-column: 1 / -1;
}

.aqs-form-grid input,
.aqs-form-grid textarea,
.aqs-form-grid select,
.aqs-items-table input,
.aqs-items-table select,
#aqs-manual-text,
#aqs-customer-search {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius-sm);
	font-size: 0.9rem;
	background: #fff;
	color: var(--aqs-text);
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.aqs-form-grid input:focus,
.aqs-form-grid textarea:focus,
.aqs-form-grid select:focus,
.aqs-items-table input:focus,
.aqs-items-table select:focus,
#aqs-manual-text:focus,
#aqs-customer-search:focus {
	outline: none;
	border-color: var(--aqs-primary-500);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.aqs-form-grid input::placeholder,
.aqs-items-table input::placeholder,
#aqs-manual-text::placeholder,
#aqs-customer-search::placeholder {
	color: #9ca3af;
}

.aqs-form-grid select,
.aqs-items-table select {
	cursor: pointer;
}

/* ---------------- 上传区 ---------------- */
.aqs-upload-area {
	border: 2px dashed var(--aqs-border-strong);
	border-radius: var(--aqs-radius);
	padding: 28px 20px;
	text-align: center;
	cursor: pointer;
	margin-bottom: 14px;
	transition: border-color 0.2s, background 0.2s, transform 0.2s;
	min-height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(180deg, #fbfcff 0%, #f6f9ff 100%);
}

.aqs-upload-area:hover,
.aqs-upload-area.aqs-dragover {
	border-color: var(--aqs-primary-500);
	background: linear-gradient(180deg, #f0f6ff 0%, #eaf2ff 100%);
}

.aqs-upload-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	color: var(--aqs-muted);
	font-size: 0.9rem;
	font-weight: 500;
}

.aqs-upload-placeholder svg {
	width: 44px;
	height: 44px;
	color: var(--aqs-primary-500);
	transition: transform 0.25s ease;
}

.aqs-upload-area:hover .aqs-upload-placeholder svg {
	transform: translateY(-3px);
}

.aqs-upload-placeholder small {
	color: #9ca3af;
	font-weight: 400;
	font-size: 0.78rem;
}

.aqs-preview-image {
	max-width: 100%;
	max-height: 220px;
	border-radius: var(--aqs-radius-sm);
	box-shadow: var(--aqs-shadow);
}

.aqs-ocr-result {
	background: linear-gradient(135deg, #f0f6ff, #f8fbff);
	border: 1px solid #dbe7ff;
	border-radius: var(--aqs-radius-sm);
	padding: 12px 14px;
	margin-bottom: 12px;
	font-size: 0.88rem;
	color: var(--aqs-text);
}

/* ---------------- 标签页 ---------------- */
.aqs-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 18px;
	background: #f1f4fa;
	border-radius: 12px;
	padding: 5px;
}

.aqs-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	flex: 1;
	background: transparent;
	border: none;
	padding: 9px 14px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--aqs-muted);
	cursor: pointer;
	border-radius: 9px;
	transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.aqs-tab svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.aqs-tab:hover {
	color: var(--aqs-primary-600);
}

.aqs-tab.active {
	background: #fff;
	color: var(--aqs-primary);
	box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
}

.aqs-tab-panel {
	display: none;
}

.aqs-tab-panel.active {
	display: block;
	animation: aqs-fade-up 0.25s ease;
}

@keyframes aqs-fade-up {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------------- 明细表格 ---------------- */
.aqs-table-wrap {
	overflow-x: auto;
	margin-bottom: 14px;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius-sm);
	background: #fff;
}

.aqs-items-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 680px;
}

.aqs-items-table th,
.aqs-items-table td {
	padding: 9px 8px;
	text-align: left;
	border-bottom: 1px solid var(--aqs-border);
	vertical-align: middle;
}

.aqs-items-table tr:last-child td {
	border-bottom: none;
}

.aqs-items-table tbody tr {
	transition: background 0.15s ease;
}

.aqs-items-table tbody tr:hover {
	background: #f8faff;
}

.aqs-items-table th {
	font-size: 0.78rem;
	color: var(--aqs-muted);
	font-weight: 600;
	white-space: nowrap;
	background: #f8fafd;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.aqs-items-table input,
.aqs-items-table select {
	min-width: 70px;
	padding: 7px 9px;
	font-size: 0.86rem;
	background: #fafbfe;
}

.aqs-items-table input:focus,
.aqs-items-table select:focus {
	background: #fff;
}

.aqs-row-amount {
	font-weight: 700;
	color: var(--aqs-primary-600);
	white-space: nowrap;
	font-size: 0.85rem;
}

.aqs-row-weight,
.aqs-row-unit-price {
	color: var(--aqs-muted);
	font-size: 0.84rem;
	white-space: nowrap;
}

.aqs-items-table input.aqs-dim-adjusted {
	color: #dc2626 !important;
	font-weight: 700;
}

.aqs-width-cell .aqs-rod-na {
	display: none;
	color: #9ca3af;
	text-align: center;
	font-size: 1rem;
}

.aqs-row-rod .aqs-width-cell .aqs-width {
	display: none;
}

.aqs-row-rod .aqs-width-cell .aqs-rod-na {
	display: block;
}

.aqs-row-rod td {
	background: rgba(245, 158, 11, 0.03);
}

/* ---------------- 按钮 ---------------- */
.aqs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 18px;
	border-radius: var(--aqs-radius-sm);
	border: 1px solid transparent;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.18s ease;
	line-height: 1.4;
	text-decoration: none;
}

.aqs-btn:active {
	transform: scale(0.98);
}

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

.aqs-btn-primary {
	background: linear-gradient(135deg, var(--aqs-primary-600), var(--aqs-primary));
	color: #fff;
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.aqs-btn-primary:hover:not(:disabled) {
	background: linear-gradient(135deg, #1d4ed8, #1e40af);
	box-shadow: 0 6px 18px rgba(30, 64, 175, 0.35);
	transform: translateY(-1px);
}

.aqs-btn-secondary {
	background: #fff;
	color: var(--aqs-primary-600);
	border-color: #c7d7f5;
}

.aqs-btn-secondary:hover:not(:disabled) {
	background: var(--aqs-primary-soft);
	border-color: var(--aqs-primary-500);
}

.aqs-btn-ghost {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.35);
	backdrop-filter: blur(4px);
}

.aqs-btn-ghost:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.24);
}

.aqs-btn-lg {
	padding: 13px 34px;
	font-size: 1rem;
	border-radius: 12px;
}

.aqs-btn-sm {
	padding: 6px 13px;
	font-size: 0.8rem;
	border-radius: 8px;
}

.aqs-btn-icon {
	background: none;
	border: none;
	color: #f87171;
	font-size: 1.35rem;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	border-radius: 6px;
	transition: background 0.15s, color 0.15s;
}

.aqs-btn-icon:hover {
	background: #fef2f2;
	color: #dc2626;
}

.aqs-btn-wechat {
	background: #07c160 !important;
	color: #fff !important;
	border-color: #07c160 !important;
	box-shadow: 0 4px 14px rgba(7, 193, 96, 0.3) !important;
}

.aqs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 18px;
}

/* ---------------- 实时预览 ---------------- */
.aqs-preview-panel {
	background: linear-gradient(135deg, #f2f6ff 0%, #f9fbff 100%);
	border: 1px solid #dbe7ff;
	border-radius: var(--aqs-radius-sm);
	padding: 16px 18px;
	margin-top: 14px;
	animation: aqs-fade-up 0.25s ease;
}

.aqs-formula-hint {
	margin: 0 0 12px;
	font-size: 0.8rem;
	color: var(--aqs-muted);
	line-height: 1.6;
}

.aqs-preview-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 30px;
	font-size: 0.92rem;
	align-items: baseline;
}

.aqs-preview-summary strong {
	color: var(--aqs-primary-600);
}

.aqs-total-highlight {
	color: var(--aqs-primary) !important;
	font-size: 1.25rem;
	font-weight: 800;
}

/* ---------------- 报价单输出 ---------------- */
.aqs-quote-output {
	border: none;
	box-shadow: none;
	background: transparent;
	padding: 0;
}

.aqs-quote-output-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.aqs-quote-output-header h3 {
	margin: 0;
}

#aqs-quote-no-label {
	color: var(--aqs-primary-600);
	font-size: 0.88rem;
	font-weight: 600;
	background: var(--aqs-primary-soft);
	padding: 3px 10px;
	border-radius: 999px;
}

/* ===== 报价单文档（打印/PDF/图片共用） ===== */
.aqs-quote-document {
	--qd-primary: #1d4ed8;
	--qd-primary-light: #3b82f6;
	--qd-primary-soft: #eff6ff;
	--qd-accent: #f59e0b;
	--qd-text: #1e293b;
	--qd-muted: #64748b;
	--qd-border: #e2e8f0;
	--qd-radius: 12px;
	position: relative;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--qd-text);
	background: #fff;
	border-radius: var(--qd-radius);
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
	overflow: hidden;
	padding: 0 28px 28px;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

.aqs-quote-topbar {
	height: 5px;
	margin: 0 -28px 24px;
	background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 50%, #60a5fa 100%);
}

/* 页眉 */
.aqs-quote-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--qd-border);
}

.aqs-quote-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 240px;
	min-width: 0;
}

.aqs-quote-logo {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1d4ed8, #3b82f6);
	color: #fff;
	font-size: 1.5rem;
	font-weight: 800;
	border-radius: 14px;
	box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.aqs-quote-brand-text h2,
.aqs-quote-brand h2 {
	margin: 0 0 4px;
	color: var(--qd-primary);
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.aqs-quote-subtitle,
.aqs-quote-brand > p {
	margin: 0;
	color: var(--qd-muted);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* 元信息卡片 */
.aqs-quote-meta-card {
	flex: 0 1 320px;
	background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
	border: 1px solid #dbeafe;
	border-radius: var(--qd-radius);
	padding: 14px 16px;
}

.aqs-quote-meta-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 16px;
}

.aqs-quote-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.aqs-quote-meta-label {
	font-size: 0.72rem;
	color: var(--qd-muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.aqs-quote-meta-value {
	font-size: 0.88rem;
	color: var(--qd-text);
	font-weight: 700;
	line-height: 1.3;
}

.aqs-quote-meta-value small {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--qd-muted);
}

.aqs-quote-meta-highlight {
	grid-column: 1 / -1;
	padding-top: 8px;
	margin-top: 2px;
	border-top: 1px dashed #bfdbfe;
}

.aqs-quote-meta-highlight .aqs-quote-meta-value {
	color: var(--qd-primary);
	font-size: 1rem;
}

/* 兼容旧模板 meta */
.aqs-quote-meta p {
	margin: 4px 0;
	font-size: 0.85rem;
}

.aqs-quote-meta p strong {
	color: var(--qd-muted);
	font-weight: 500;
}

/* 区块标题 */
.aqs-quote-section-title {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--qd-primary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 10px;
	padding-left: 10px;
	border-left: 3px solid var(--qd-primary-light);
}

/* 客户信息 */
.aqs-quote-customer {
	background: linear-gradient(135deg, #f8fafc, #f1f5f9);
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	padding: 14px 16px;
	margin-bottom: 22px;
}

.aqs-quote-customer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px 20px;
}

.aqs-quote-customer-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.aqs-quote-customer-item span {
	font-size: 0.72rem;
	color: var(--qd-muted);
	font-weight: 500;
}

.aqs-quote-customer-item strong {
	font-size: 0.92rem;
	color: var(--qd-text);
	font-weight: 600;
}

.aqs-quote-customer-remark {
	grid-column: 1 / -1;
}

/* 兼容旧模板客户行 */
.aqs-quote-customer > p {
	margin: 0;
	font-size: 0.9rem;
}

/* 表格 */
.aqs-quote-table-wrap {
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	overflow: hidden;
	margin-bottom: 20px;
}

.aqs-quote-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8rem;
	margin: 0;
}

.aqs-quote-table th,
.aqs-quote-table td {
	border-bottom: 1px solid var(--qd-border);
	padding: 10px 6px;
	text-align: center;
	vertical-align: middle;
}

.aqs-quote-table th {
	background: linear-gradient(180deg, #1d4ed8, #2563eb);
	color: #fff;
	font-weight: 600;
	font-size: 0.76rem;
	letter-spacing: 0.02em;
	border-bottom: none;
	white-space: nowrap;
}

.aqs-quote-table th small {
	display: block;
	font-size: 0.68rem;
	font-weight: 400;
	opacity: 0.85;
	margin-top: 1px;
}

.aqs-quote-table tbody tr:last-child td {
	border-bottom: none;
}

.aqs-quote-table tbody tr:nth-child(even) {
	background: #f8fafc;
}

.aqs-quote-table tbody tr:hover {
	background: #eff6ff;
}

.aqs-quote-table .aqs-quote-row-rod td:nth-child(5) {
	color: #cbd5e1;
}

.aqs-quote-table td:last-child,
.aqs-quote-table th:last-child {
	font-weight: 600;
}

/* 旧模板 tfoot 兼容 */
.aqs-quote-table tfoot td {
	font-weight: 600;
	background: #f8fafc;
	border-top: 2px solid var(--qd-border);
}

.aqs-quote-table tfoot tr:last-child td {
	background: linear-gradient(135deg, #eff6ff, #dbeafe);
	color: var(--qd-primary);
	font-size: 0.95rem;
}

/* 合计摘要 */
.aqs-quote-summary {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 24px;
}

.aqs-quote-summary-box {
	min-width: 280px;
	max-width: 360px;
	width: 100%;
	background: #f8fafc;
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	overflow: hidden;
}

.aqs-quote-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 16px;
	border-bottom: 1px solid var(--qd-border);
	font-size: 0.85rem;
}

.aqs-quote-summary-row span {
	color: var(--qd-muted);
}

.aqs-quote-summary-row strong {
	color: var(--qd-text);
	font-weight: 600;
}

.aqs-quote-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: linear-gradient(135deg, #1d4ed8, #2563eb);
	color: #fff;
	font-size: 1rem;
}

.aqs-quote-summary-total span {
	font-weight: 500;
	opacity: 0.9;
}

.aqs-quote-summary-total strong {
	font-size: 1.25rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

/* 页脚 */
.aqs-quote-footer {
	padding-top: 18px;
	border-top: 1px dashed var(--qd-border);
}

.aqs-quote-footer-company {
	margin-bottom: 12px;
}

.aqs-quote-footer-address,
.aqs-quote-footer-phone,
.aqs-quote-footer > p {
	margin: 4px 0;
	font-size: 0.82rem;
	color: var(--qd-muted);
}

.aqs-quote-footer-phone strong {
	color: var(--qd-text);
	font-weight: 700;
}

.aqs-quote-note {
	font-size: 0.82rem;
	color: var(--qd-muted);
	margin: 8px 0;
}

.aqs-quote-disclaimer {
	font-size: 0.75rem;
	color: #94a3b8;
	font-style: normal;
	margin: 12px 0 0;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 8px;
	text-align: center;
	line-height: 1.5;
}

/* ---------------- 加载 / 提示 ---------------- */
.aqs-loading {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(3px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: #fff;
	z-index: 99999;
	font-size: 1rem;
	font-weight: 500;
}

.aqs-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: aqs-spin 0.8s linear infinite;
	box-shadow: 0 0 24px rgba(255, 255, 255, 0.2);
}

@keyframes aqs-spin {
	to { transform: rotate(360deg); }
}

.aqs-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e293b;
	color: #fff;
	padding: 12px 26px;
	border-radius: 12px;
	font-size: 0.9rem;
	font-weight: 500;
	z-index: 100000;
	box-shadow: 0 10px 32px rgba(15, 23, 42, 0.35);
	animation: aqs-toast-in 0.25s ease;
	max-width: 90vw;
	text-align: center;
}

.aqs-toast.aqs-toast-error {
	background: #dc2626;
}

@keyframes aqs-toast-in {
	from { opacity: 0; transform: translate(-50%, 12px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 客户搜索 ---------------- */
.aqs-customer-search-wrap {
	position: relative;
	margin-bottom: 14px;
}

#aqs-customer-search {
	padding: 10px 12px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 12px center;
	padding-left: 38px;
}

.aqs-customer-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius-sm);
	box-shadow: var(--aqs-shadow-lg);
	z-index: 100;
	max-height: 240px;
	overflow-y: auto;
	margin-top: 6px;
}

.aqs-customer-option {
	display: block;
	width: 100%;
	text-align: left;
	padding: 11px 14px;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 0.88rem;
	border-bottom: 1px solid var(--aqs-border);
	transition: background 0.15s;
}

.aqs-customer-option:hover {
	background: #f2f6ff;
}

.aqs-customer-option:last-child {
	border-bottom: none;
}

/* ---------------- 微信分享弹窗 ---------------- */
.aqs-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.aqs-modal[hidden] {
	display: none !important;
}

.aqs-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(3px);
	animation: aqs-fade-in 0.2s ease;
}

@keyframes aqs-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.aqs-modal-content {
	position: relative;
	background: #fff;
	border-radius: 18px;
	padding: 26px;
	max-width: 400px;
	width: 100%;
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
	animation: aqs-fade-up 0.25s ease;
}

.aqs-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #f1f4fa;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	color: var(--aqs-muted);
	line-height: 1;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	transition: background 0.15s, color 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aqs-modal-close:hover {
	background: #fee2e2;
	color: #dc2626;
}

.aqs-modal-content h3 {
	margin: 0 0 18px;
	text-align: center;
	font-size: 1.15rem;
}

.aqs-wechat-tip {
	background: #e8f8ef;
	color: #078a4e;
	padding: 11px 14px;
	border-radius: var(--aqs-radius-sm);
	font-size: 0.85rem;
	margin-bottom: 16px;
	text-align: center;
	border: 1px solid #c9f0da;
}

.aqs-share-qr-wrap {
	text-align: center;
	margin-bottom: 16px;
}

.aqs-share-qr-wrap img {
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius-sm);
	box-shadow: var(--aqs-shadow);
}

.aqs-share-link-label {
	font-size: 0.85rem;
	color: var(--aqs-muted);
	margin: 0 0 6px;
}

.aqs-share-link-row {
	display: flex;
	gap: 8px;
}

.aqs-share-link-row input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid var(--aqs-border);
	border-radius: var(--aqs-radius-sm);
	font-size: 0.8rem;
	background: #f8fafd;
}

/* 手机端图片预览（长按保存到相册） */
.aqs-image-preview-overlay {
	position: fixed;
	inset: 0;
	z-index: 100002;
	background: rgba(15, 23, 42, 0.82);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: aqs-fade-in 0.2s ease;
}

.aqs-image-preview-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 100%;
	max-height: 92vh;
	overflow: auto;
}

.aqs-image-preview-box img {
	max-width: 100%;
	max-height: 72vh;
	border-radius: 12px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
	background: #fff;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: default;
	pointer-events: auto;
}

.aqs-image-preview-hint {
	margin: 0;
	color: #fff;
	font-size: 0.9rem;
	text-align: center;
	background: rgba(255, 255, 255, 0.14);
	padding: 8px 16px;
	border-radius: 999px;
}

.aqs-image-preview-close {
	background: #fff;
	color: #1e293b;
	border: none;
	padding: 10px 28px;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.aqs-mobile-quote-close {
	display: none;
}

.aqs-mobile-hide-processing {
	display: none !important;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
	.aqs-app {
		padding: 8px 8px 40px;
	}

	.aqs-header {
		padding: 20px 18px;
	}

	.aqs-title {
		font-size: 1.15rem;
	}

	.aqs-price-number {
		font-size: 1.7rem;
	}

	.aqs-form-grid {
		grid-template-columns: 1fr;
	}

	.aqs-section {
		padding: 16px;
	}

	.aqs-actions .aqs-btn {
		flex: 1 1 auto;
	}

	.aqs-quote-table {
		font-size: 0.75rem;
	}

	.aqs-quote-table th,
	.aqs-quote-table td {
		padding: 4px 3px;
	}

	/* 手机端报价单：100% 宽度，无边框/无圆角/无阴影（电脑端不变） */
	.aqs-quote-output {
		margin-left: -8px;
		margin-right: -8px;
		width: calc(100% + 16px) !important;
		max-width: none !important;
	}

	#aqs-quote-html {
		width: 100% !important;
	}

	.aqs-quote-document {
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 0 16px !important;
		border: none !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		background: #fff;
	}

	.aqs-quote-topbar {
		margin: 0 0 16px !important;
		border-radius: 0;
	}

	.aqs-quote-header {
		flex-direction: column;
		gap: 14px;
		padding: 16px 12px 12px;
		margin-bottom: 0;
	}

	.aqs-quote-meta-card {
		flex: 1 1 auto;
		width: 100%;
	}

	.aqs-quote-logo {
		width: 44px;
		height: 44px;
		font-size: 1.25rem;
	}

	.aqs-quote-brand-text h2,
	.aqs-quote-brand h2 {
		font-size: 1.2rem;
	}

	.aqs-quote-table-wrap {
		border: none !important;
		border-radius: 0 !important;
		margin: 0 0 16px !important;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.aqs-quote-customer {
		margin: 12px 0 16px;
		border-left: none !important;
		border-right: none !important;
		border-radius: 0 !important;
	}

	.aqs-quote-summary {
		justify-content: stretch;
		padding: 0 12px;
	}

	.aqs-quote-summary-box {
		max-width: none;
	}

	.aqs-quote-footer {
		padding: 16px 12px 0;
	}

	.aqs-mobile-hide-processing {
		display: none !important;
	}

	/* 移动端生成后整屏沉浸式（在100%宽度基础上再固定全屏） */
	.aqs-mobile-quote-view {
		position: fixed;
		inset: 0;
		z-index: 100003;
		background: #fff;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 0;
		margin: 0 !important;
		width: 100% !important;
		animation: aqs-fade-in 0.2s ease;
	}

	.aqs-mobile-quote-view .aqs-quote-output-header {
		position: sticky;
		top: 0;
		z-index: 2;
		background: #fff;
		padding: 12px 12px;
		margin: 0;
		border-bottom: 1px solid var(--aqs-border);
	}

	.aqs-mobile-quote-view .aqs-quote-output-header h3 {
		font-size: 1rem;
	}

	.aqs-mobile-quote-view .aqs-mobile-quote-close {
		display: inline-flex;
	}

	.aqs-mobile-quote-view #aqs-quote-html {
		padding: 0;
		width: 100%;
	}

	.aqs-mobile-quote-view .aqs-quote-table {
		font-size: 0.70rem;
		width: 100%;
	}

	.aqs-mobile-quote-view .aqs-quote-table th,
	.aqs-mobile-quote-view .aqs-quote-table td {
		padding: 6px 3px;
	}
}


/* ---------------- 打印 ---------------- */
@media print {
	@page {
		size: A4;
		margin: 10mm;
	}

	body {
		margin: 0;
		padding: 0;
		background: #fff;
	}

	.aqs-app > *:not(.aqs-quote-output),
	.aqs-quote-output-header,
	.aqs-loading,
	.aqs-toast,
	.aqs-modal {
		display: none !important;
	}

	.aqs-quote-output {
		display: block !important;
		position: static;
		width: 100%;
		max-width: 100%;
		margin: 0;
		padding: 0;
		border: none;
		box-shadow: none;
	}

	.aqs-quote-document {
		width: 100%;
	}

	.aqs-quote-table tr {
		page-break-inside: avoid;
	}
}
