:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-app: #f3f4f6;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-secondary: #4b5563;
  --border-color: #e5e7eb;
  --input-bg: #f9fafb;
  --input-border: #d1d5db;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-main);
  overflow: hidden; /* Prevent full page scroll */
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styles */
.sidebar {
  width: 50%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card Component */
.card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header-row .card-title {
  margin-bottom: 0;
}

/* Inputs */
.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Checkbox */
.checkbox-group {
  margin: 12px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label.disabled input[type="checkbox"] {
  cursor: not-allowed;
}

.checkbox-text {
  font-size: 14px;
  color: var(--text-main);
}

.tip-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: normal;
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--input-bg);
  transition: all 0.2s ease;
}

.radio-label:hover {
  background: #ffffff;
  border-color: var(--primary);
}

.radio-label input[type="radio"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.radio-label input[type="radio"]:checked + span {
  color: var(--primary);
  font-weight: 500;
}

.radio-label span {
  font-size: 14px;
  color: var(--text-main);
}

/* Button Group */
.button-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.button-group .btn {
  flex: 1;
}

/* Export List */
.export-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-time-row {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.export-row-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.export-input-group label {
  font-size: 11px;
  margin-bottom: 2px;
}

.export-input-group input {
  padding: 6px;
  font-size: 13px;
}

.export-total-row {
  margin-top: 12px;
  padding: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--primary);
}

/* Preview Charts */
.preview-charts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.chart-box {
  background: var(--input-bg);
  border-radius: 6px;
  padding: 8px;
  border: 1px solid var(--border-color);
}

.chart-header {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-align: center;
}

.chart-box canvas {
  width: 100% !important;
  height: 400px !important;
}

/* Verify Section */
.verify-card.collapsed .verify-body {
  display: none;
}

.toggle-verify {
  cursor: pointer;
  margin-bottom: 0;
}

.toggle-verify .icon {
  font-size: 12px;
  transition: transform 0.2s;
}

.verify-card:not(.collapsed) .toggle-verify .icon {
  transform: rotate(180deg);
}

.file-upload-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  flex: 1;
}

.file-input-button {
  background: #fff;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.file-input-wrapper:hover .file-input-button {
  background: var(--input-bg);
  border-color: #9ca3af;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input {
  flex: 1;
}

.verify-result {
  font-size: 13px;
  background: var(--input-bg);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  max-height: 200px;
  overflow-y: auto;
}

/* Footer & Actions */
.sidebar-footer {
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}

.distance-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  color: #15803d;
  font-size: 14px;
  font-weight: 600;
}

.status-message {
  min-height: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 12px;
}

.btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  border-color: var(--input-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--input-bg);
  border-color: #9ca3af;
  color: var(--text-main);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-outline:hover {
  background: #fef2f2;
}

/* Map */
.map-container {
  flex: 1;
  background: #e5e7eb;
  position: relative;
}

/* Map Search Box */
.map-search-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 320px;
}

.map-search-box {
  display: flex;
  gap: 8px;
  background: white;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.map-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.map-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.map-search-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.map-search-btn:hover {
  background: var(--primary-hover);
}

.map-search-results {
  margin-top: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.map-search-results.show {
  display: block;
}

.search-result-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--input-bg);
}

.search-result-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
}

.search-result-address {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  background: #fff;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Payment Modal */
.payment-dialog {
  max-width: 450px;
}

.payment-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.payment-info {
  text-align: center;
  width: 100%;
}

.payment-amount {
  margin-bottom: 8px;
}

.amount-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.amount-value {
  font-size: 32px;
  font-weight: 700;
  color: #ff6a00;
  margin-left: 8px;
}

.payment-product {
  font-size: 14px;
  color: var(--text-secondary);
}

.qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 8px;
}

#qrcodeImage {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e0e0e0;
}

#qrcodeImage img {
  max-width: 100%;
  max-height: 100%;
}

.qrcode-tip {
  font-size: 13px;
  color: var(--text-secondary);
}

.payment-status {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-checking,
.status-success,
.status-error {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.status-checking {
  color: var(--text-secondary);
}

.status-success {
  color: #52c41a;
}

.status-error {
  color: #ff4d4f;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f0f0f0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.success-icon,
.error-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.success-icon {
  background: #52c41a;
  color: white;
}

.error-icon {
  background: #ff4d4f;
  color: white;
}

.payment-timeout {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

#paymentTimeout {
  font-weight: 600;
  color: #ff6a00;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Inline Input */
.inline-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.inline-input label {
  margin-bottom: 0;
}

.inline-input input {
  width: 70px;
}

/* Tooltip Icon */
.tooltip-icon {
  display: inline-block;
  margin-left: 4px;
  color: var(--primary);
  font-size: 14px;
  cursor: help;
  font-weight: 600;
  position: relative;
}

.tooltip-icon:hover {
  color: var(--primary-hover);
}

/* Custom Tooltip */
.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: normal;
  white-space: normal;
  min-width: 200px;
  max-width: 200px;
  width: max-content;
  text-align: left;
  line-height: 1.4;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.tooltip-icon::before {
  content: "";
  position: absolute;
  bottom: 119%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}

.tooltip-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

.tooltip-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

/* 修改tooltip为向下显示，避免被上方内容遮挡 */
.tooltip-icon::after {
  top: 125%;
  bottom: auto;
}

.tooltip-icon::before {
  top: 119%;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: #333;
}

/* 用户信息显示样式 */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.header-title {
  flex: 1;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.user-avatar {
  font-size: 20px;
  line-height: 1;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-nickname {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.user-credits {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* 套餐选择弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.package-modal {
  max-width: 900px;
}

.payment-modal {
  max-width: 500px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f3f4f6;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* 套餐列表样式 */
.package-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.package-card {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  background: white;
}

.package-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
  transform: translateY(-4px);
}

.package-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.package-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
}

.package-credits {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.package-price {
  margin-bottom: 8px;
}

.current-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.original-price {
  font-size: 16px;
  color: #9ca3af;
  text-decoration: line-through;
  margin-left: 8px;
}

.package-unit {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.package-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  min-height: 40px;
}

.buy-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.buy-btn:hover {
  background: var(--primary-hover);
}

/* 支付信息样式 */
.payment-info {
  text-align: center;
  margin-bottom: 24px;
}

.payment-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.payment-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.qrcode-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.payment-status {
  text-align: center;
  margin-bottom: 20px;
}

.status-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.countdown {
  font-size: 13px;
  color: var(--warning);
}

.status-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
}

.success-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--success);
}

.success-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.payment-tips {
  background: #f3f4f6;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.payment-tips p {
  margin: 0 0 8px 0;
}

.payment-tips p:last-child {
  margin-bottom: 0;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.error {
  text-align: center;
  padding: 40px;
  color: var(--danger);
}

/* ============================================================
   路线模板 & 生成历史弹窗 — 简洁现代风格
   ============================================================ */

.tpl-modal .modal-dialog {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-radius: 10px;
}

.tpl-modal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 10px 10px 0 0;
  background: #fff;
}

.tpl-modal .modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.tpl-modal .modal-close {
  color: #999;
  font-size: 20px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
  background: transparent;
  border: none;
}

.tpl-modal .modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.tpl-modal .modal-body {
  padding: 16px 20px 20px;
}

/* 输入框 */
.tpl-name-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
  box-sizing: border-box;
}

.tpl-name-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}

.tpl-name-input::placeholder { color: #bbb; }

/* 配置摘要 */
.tpl-config-summary {
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.tpl-config-tag {
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
}

.tpl-config-tag .tag-icon { display: none; }

/* 按钮 */
.tpl-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tpl-btn {
  flex: 1;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.tpl-btn-primary {
  background: #3b82f6;
  color: #fff;
}

.tpl-btn-primary:hover { background: #2563eb; }

.tpl-btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
}

.tpl-btn-secondary:hover { background: #eee; }

.tpl-btn-success {
  background: #10b981;
  color: #fff;
}

.tpl-btn-success:hover { background: #059669; }

.tpl-btn-danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #e0e0e0;
}

.tpl-btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.tpl-btn-sm {
  flex: none;
  padding: 6px 12px;
  font-size: 12px;
}

/* 消息提示 */
.tpl-msg {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: none;
}

.tpl-msg.show { display: block; }

.tpl-msg.success {
  background: #f0fdf4;
  color: #166534;
}

.tpl-msg.error {
  background: #fef2f2;
  color: #991b1b;
}

/* 列表卡片 */
.tpl-card {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: border-color 0.15s;
  gap: 10px;
}

.tpl-card:hover { border-color: #ccc; }

.tpl-card-info { flex: 1; min-width: 0; }

.tpl-card-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

.tpl-card-meta span {
  display: inline;
}

.tpl-card-meta .sep::before { content: '·'; margin: 0 2px; }

.tpl-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 历史卡片 — 复用 tpl-card 结构 */
.history-card {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: border-color 0.15s;
  gap: 10px;
}

.history-card:hover { border-color: #ccc; }

.history-card-info { flex: 1; min-width: 0; }

.history-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}

.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

.history-card-meta span { display: inline; }
.history-card-meta .sep::before { content: '·'; margin: 0 2px; }

/* 空状态 */
.tpl-empty {
  text-align: center;
  padding: 36px 20px;
  color: #aaa;
}

.tpl-empty-text {
  font-size: 14px;
  margin-bottom: 4px;
  color: #999;
}

.tpl-empty-hint {
  font-size: 12px;
  color: #ccc;
}

/* 分页 */
.tpl-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

.tpl-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.tpl-page-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.tpl-page-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

/* 加载状态 */
.tpl-loading {
  text-align: center;
  padding: 36px 20px;
  color: #aaa;
  font-size: 13px;
}

.tpl-loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: tpl-spin 0.6s linear infinite;
  margin-bottom: 10px;
}

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

/* 试用期提示条 */
.tpl-trial-tip {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #92400e;
  text-align: center;
}

/* Toast 通知 */
.tpl-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tpl-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tpl-toast.success {
  background: #fff;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.tpl-toast.error {
  background: #fff;
  color: #991b1b;
  border: 1px solid #fecaca;
}
