/* 首页样式修复 */

#database-stats-container {
	width: 100%;
	min-width: 0;
}

#database-stats-container .stats-config,
#database-stats-container .stats-list,
#database-stats-container .stat-row {
	min-width: 0;
}

#database-stats-container .stats-list {
	overflow-x: hidden;
	overflow-y: auto;
	box-sizing: border-box;
	padding-right: 0.875rem;
	scrollbar-gutter: stable;
}

#database-stats-container .stat-row {
	gap: 0.75rem;
	align-items: flex-start;
}

#database-stats-container .stat-label {
	flex: 1;
	min-width: 0;
	padding-left: 0.375rem;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

#database-stats-container .stat-value {
	flex-shrink: 0;
}

#database-stats-container .stat-row.stat-row-hover {
	transform: none;
}

.main .main-container .analysis-card {
	min-height: auto;
}

.main .main-container .analysis-main,
.main .main-container .charts-vertical {
	min-height: 0;
}

.main .main-container .analysis-config {
	height: auto;
	max-height: min(56.25rem, calc(100dvh - 3rem));
	overflow: visible;
}

.main .main-container .analysis-config .form-sections-scroll {
	max-height: calc(min(56.25rem, 100dvh - 3rem) - 10rem);
}

.main .main-container .analysis-config .analyze-btn-secondary {
	background: linear-gradient(135deg, #2DC7C9 0%, #1d9294 100%);
	opacity: 0.85;
}

.main .industry-item-delay-1 {
	animation-delay: 0s;
}

.main .industry-item-delay-2 {
	animation-delay: 0.1s;
}

.main .industry-item-delay-3 {
	animation-delay: 0.2s;
}

.main .industry-item-delay-4 {
	animation-delay: 0.3s;
}

.main .industry-item-delay-5 {
	animation-delay: 0.4s;
}

.main .industry-item-delay-6 {
	animation-delay: 0.5s;
}

.main .industry-item-delay-7 {
	animation-delay: 0.6s;
}

.main .industry-item-delay-8 {
	animation-delay: 0.7s;
}

.main .industry-item-delay-9 {
	animation-delay: 0.8s;
}

.main .industry-item-delay-10 {
	animation-delay: 0.9s;
}

.main .industry-item-delay-11 {
	animation-delay: 1.0s;
}

.main .industry-item-delay-12 {
	animation-delay: 1.1s;
}

/* 12 个行业按钮的网格：每行 4 个，共 3 行 */
.main .main-container .industry-stats-section .industries-grid-compact {
	grid-template-rows: repeat(3, auto);
}

/* 行业按钮底色——让用户一眼看出是 12 个可点链接
   选择器特意写得这么长是为了匹配 index.css 的深嵌套选择器特异性 (0,7,0)：
   .main-container .industry-stats-section .container .industry-stats-grid
   .hot-industries .industries-grid-compact .industry-item
   原样式由 CSS Native Nesting 展开后特异性较高，短选择器会被压住。 */
.main-container .industry-stats-section .container .industry-stats-grid .hot-industries .industries-grid-compact .industry-item.industry-item-button {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.main-container .industry-stats-section .container .industry-stats-grid .hot-industries .industries-grid-compact .industry-item.industry-item-button .industry-icon {
    color: #2563eb;
}

.main-container .industry-stats-section .container .industry-stats-grid .hot-industries .industries-grid-compact .industry-item.industry-item-button .industry-name {
    color: #1e3a8a;
}

/* hover 时仍由原渐变盖住，无需额外覆写 */

/* 导航栏"数据库介绍"在移动端会过窄，给一点最小宽度 */
.main-header .nav-link.nav-link-database {
	white-space: nowrap;
}

/* 导航栏可点击区域统一等宽：
   5 个链接（首页 / 关于我们 / 数据库介绍 / 会员登录 / 繁体）按最长那个文案撑齐，
   短文案靠 text-align:center 居中。flex item 默认能拿到 min-width，无需改 display。
   选择器特异性 (0,5,0) 等于 index.css / layout/header.css 原 .nav-link 嵌套链，
   index-fixes.css 加载在后取胜。 */
.header .header-container .header-right .header-nav .nav-link,
.header .header-container .header-right .header-options .header-user-link {
	min-width: 7rem;
	text-align: center;
	box-sizing: border-box;
}

/* 登录后用户名显示是 .header-user-text（utils.js 动态注入），
   它本身不可点击、有自定义 max-width，需要从等宽规则里排除掉 */
.header .header-container .header-right .header-options .header-user-text {
	min-width: 0;
	text-align: left;
}

/* 移动端字号和 padding 都更小，min-width 同比缩到 5.5rem，避免撑爆窄屏 */
@media (max-width: 48rem) {
	.header .header-container .header-right .header-nav .nav-link,
	.header .header-container .header-right .header-options .header-user-link {
		min-width: 5.5rem;
	}
}

/* 页脚 - 客户服务弹层、底部公司信息样式 */
.main-footer .footer-link.footer-link-customer,
.results-footer .footer-link.footer-link-customer,
.article-footer .footer-link.footer-link-customer,
.analysis-footer .footer-link.footer-link-customer,
.about-footer .footer-link.footer-link-customer,
.database-footer .footer-link.footer-link-customer,
.service-footer .footer-link.footer-link-customer,
.professional-footer .footer-link.footer-link-customer,
footer .footer-link.footer-link-customer {
	position: relative;
}

.customer-service-popup {
	position: fixed;
	left: 50%;
	bottom: 6rem;
	transform: translateX(-50%) scale(0.95);
	background: white;
	border-radius: 1rem;
	box-shadow: 0 1.25rem 3.125rem #00000033;
	padding: 1.5rem 2rem;
	z-index: 10001;
	display: none;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	min-width: 18rem;
	text-align: center;
	border: 1px solid #e5e7eb;
}

.customer-service-popup.visible {
	display: block;
	opacity: 1;
	transform: translateX(-50%) scale(1);
}

.customer-service-popup .popup-close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	font-size: 1.25rem;
	line-height: 1;
}

.customer-service-popup .popup-close:hover {
	color: #374151;
}

.customer-service-popup .popup-title {
	font-size: 1rem;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 0.75rem;
}

.customer-service-popup .popup-qr {
	width: 8rem;
	height: 8rem;
	margin: 0 auto 0.75rem;
	display: block;
	border-radius: 0.5rem;
}

.customer-service-popup .popup-contact {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	color: #374151;
	line-height: 1.6;
}

.customer-service-popup .popup-contact .popup-phone {
	font-weight: 700;
	color: #1e40af;
}

.customer-service-mask {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 10000;
	display: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.customer-service-mask.visible {
	display: block;
	opacity: 1;
}

/* 页脚最下方公司信息块（页脚是浅色背景） */
footer .footer-corp-info {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e7eb;
	text-align: center;
	font-size: 0.8125rem;
	line-height: 1.8;
	color: #6b7280;
	max-width: 50rem;
	margin-left: auto;
	margin-right: auto;
}

footer .footer-corp-info a {
	color: #3b82f6;
	text-decoration: none;
	transition: color 0.2s ease;
}

footer .footer-corp-info a:hover {
	color: #1e40af;
	text-decoration: underline;
}

/* 数据加载占位 - 通用 */
.loading-placeholder-default {
	text-align: center;
	padding: 2rem;
	color: #6b7280;
	font-style: italic;
}

@media (max-width: 64rem) {
	.main .main-container .analysis-config {
		max-height: none;
	}

	.main .main-container .analysis-config .form-sections-scroll {
		max-height: none;
	}
}

@media (max-width: 48rem) {
	#database-stats-container .config-row {
		flex-wrap: wrap;
	}

	#database-stats-container .config-row label {
		min-width: auto;
	}

	#database-stats-container .stats-select {
		width: 100%;
		min-width: 0;
	}

	.main .main-banner .search-form .search-main {
		display: flex;
		flex-direction: column;
	}

	.main .main-banner .search-form .search-input,
	.main .main-banner .search-form .search-select,
	.main .main-banner .search-form .search-btn {
		width: 100%;
	}

	.main .main-banner .search-form .search-select {
		min-width: 0;
		border-left: none;
		border-top: 1px solid var(--color-border-soft);
	}

	.main .main-banner .search-form .search-btn {
		border-radius: 0;
	}
}
