/* ==========================================================
   多功能计算器 —— 样式（独立于主题，前缀 xzt-c-）
   ========================================================== */

.xzt-calc {
	max-width: 560px;
	margin: 24px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
	color: #1f2937;
	line-height: 1.6;
}
.xzt-calc * { box-sizing: border-box; }

.xzt-c-head { margin-bottom: 14px; }
.xzt-c-title { margin: 0 0 10px; font-size: 20px; color: #111827; }

/* 主 Tab */
.xzt-c-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.xzt-c-tab {
	padding: 7px 14px;
	border: 1px solid #e5e7eb;
	background: #ffffff;
	border-radius: 999px;
	cursor: pointer;
	font-size: 13px;
	color: #4b5563;
	transition: all .12s ease;
}
.xzt-c-tab:hover { border-color: #93c5fd; color: #1d4ed8; }
.xzt-c-tab.active { background: #2563eb; color: #ffffff; border-color: #2563eb; }

.xzt-c-panel { display: none; }
.xzt-c-panel.active { display: block; }

/* ---------- 科学计算器 ---------- */
.xzt-c-calc { }
.xzt-c-modebar {
	display: flex; align-items: center; gap: 8px;
	margin-bottom: 8px; font-size: 13px; color: #6b7280;
}
.xzt-c-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.xzt-c-switch input { opacity: 0; width: 0; height: 0; }
.xzt-c-slider {
	position: absolute; cursor: pointer; inset: 0;
	background: #d1d5db; border-radius: 999px; transition: .2s;
}
.xzt-c-slider::before {
	content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
	background: #ffffff; border-radius: 50%; transition: .2s;
}
.xzt-c-switch input:checked + .xzt-c-slider { background: #2563eb; }
.xzt-c-switch input:checked + .xzt-c-slider::before { transform: translateX(18px); }

.xzt-c-screen {
	background: #0f172a; color: #f8fafc;
	border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.xzt-c-expr {
	width: 100%; background: transparent; border: none; outline: none;
	color: #cbd5e1; font-size: 15px; text-align: right;
	font-family: Consolas, Monaco, monospace;
}
.xzt-c-result {
	font-size: 30px; font-weight: 700; text-align: right;
	margin-top: 6px; min-height: 40px; word-break: break-all;
}
.xzt-c-hist {
	max-height: 90px; overflow: auto; text-align: right;
	color: #64748b; font-size: 12px; margin-bottom: 4px;
}
.xzt-c-hist .h-item { cursor: pointer; padding: 1px 4px; border-radius: 4px; }
.xzt-c-hist .h-item:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.xzt-c-hist .h-empty { color: #475569; }

.xzt-c-fns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.xzt-c-fns button {
	padding: 7px 11px; font-size: 13px;
	border: 1px solid #e5e7eb; background: #f8fafc; border-radius: 8px;
	cursor: pointer; color: #1f2937; transition: background .12s ease;
}
.xzt-c-fns button:hover { background: #e0e7ff; border-color: #a5b4fc; }

.xzt-c-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xzt-c-keys button {
	padding: 14px 0; font-size: 18px;
	border: 1px solid #e5e7eb; background: #ffffff; border-radius: 10px;
	cursor: pointer; color: #1f2937; transition: background .12s ease, transform .05s;
}
.xzt-c-keys button:active { transform: scale(.96); }
.xzt-c-keys button:hover { background: #f3f4f6; }
.xzt-c-keys button.op { background: #eff6ff; color: #1d4ed8; }
.xzt-c-keys button.op:hover { background: #dbeafe; }
.xzt-c-keys button.eq { background: #2563eb; color: #fff; border-color: #2563eb; }
.xzt-c-keys button.eq:hover { background: #1d4ed8; }
.xzt-c-keys button.danger { background: #fef2f2; color: #b91c1c; }
.xzt-c-keys button.danger:hover { background: #fee2e2; }

.xzt-c-tip { font-size: 12px; color: #9ca3af; margin: 10px 0 0; }

/* ---------- 表单通用 ---------- */
.xzt-c-field { margin-bottom: 10px; }
.xzt-c-field label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.xzt-c-field input[type=number],
.xzt-c-field input[type=text],
.xzt-c-field input[type=date],
.xzt-c-field select,
.xzt-c-field textarea {
	width: 100%; padding: 9px 10px;
	border: 1px solid #d1d5db; border-radius: 8px;
	font-size: 14px; background: #ffffff; color: #111827;
}
.xzt-c-field input:focus, .xzt-c-field select:focus {
	outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.xzt-c-row { display: flex; gap: 10px; }
.xzt-c-grow { flex: 1; }

.xzt-c-btn {
	padding: 9px 22px; font-size: 14px;
	background: #2563eb; color: #ffffff; border: none; border-radius: 8px;
	cursor: pointer; transition: background .12s ease;
}
.xzt-c-btn:hover { background: #1d4ed8; }

.xzt-c-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.xzt-c-table th, .xzt-c-table td {
	border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left;
}
.xzt-c-table th { background: #f8fafc; color: #374151; }
.xzt-c-table td:last-child { font-family: Consolas, Monaco, monospace; color: #1d4ed8; word-break: break-all; }

.xzt-c-out {
	margin-top: 10px; padding: 12px 14px;
	background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
	font-size: 15px; color: #14532d; line-height: 1.9;
}
.xzt-c-out .big { font-size: 24px; font-weight: 700; color: #15803d; }
.xzt-c-out .warn { color: #b45309; }
.xzt-c-out.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---------- 日期子 Tab ---------- */
.xzt-c-tabs2 { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.xzt-c-tabs2 button {
	padding: 6px 12px; font-size: 13px;
	border: 1px solid #e5e7eb; background: #ffffff; border-radius: 8px;
	cursor: pointer; color: #4b5563;
}
.xzt-c-tabs2 button.active { background: #e0e7ff; border-color: #818cf8; color: #3730a3; font-weight: 600; }
.xzt-c-dpanel { display: none; }
.xzt-c-dpanel.active { display: block; }

/* ---------- 生活计算卡片 ---------- */
.xzt-c-subcard {
	border: 1px solid #e5e7eb; border-radius: 12px;
	padding: 14px 16px; margin-bottom: 12px; background: #ffffff;
}
.xzt-c-subcard h4 { margin: 0 0 10px; font-size: 15px; color: #111827; }

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
	.xzt-calc { margin: 12px auto; }
	.xzt-c-keys button { padding: 12px 0; font-size: 16px; }
	.xzt-c-result { font-size: 24px; }
	.xzt-c-row { flex-direction: column; gap: 0; }
	.xzt-c-tabs { gap: 4px; }
	.xzt-c-tab { padding: 6px 10px; font-size: 12px; }
}
