/* 郭标财务平台 - UI打磨升级 v1400 */
/* 在原有v212基础上叠加增强，不替换原文件 */

/* ===== 1. 全局字体与间距优化 ===== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 2. 统计卡片升级 ===== */
.stat-card {
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}
.stat-card:nth-child(2)::before { background: var(--info); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: var(--danger); }
.stat-card:nth-child(5)::before { background: #722ed1; }
.stat-card:nth-child(6)::before { background: #13c2c2; }
.stat-card .value {
  font-size: 22px;
  letter-spacing: -0.5px;
}

/* ===== 3. 表格升级 ===== */
.table-wrap {
  border-radius: 8px;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
table.data-table th {
  background: #fafbfc;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  padding: 11px 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid #f0f0f0;
}
table.data-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
}
table.data-table tr:last-child td {
  border-bottom: none;
}
table.data-table tr:hover td {
  background: #f0fff0;
}

/* ===== 4. 按钮升级 ===== */
.btn {
  border-radius: 6px;
  font-weight: 500;
  padding: 6px 16px;
  transition: all 0.2s;
}
.btn-primary {
  box-shadow: 0 2px 0 rgba(82,196,26,0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 8px rgba(82,196,26,0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(82,196,26,0.3);
}
.btn-danger {
  box-shadow: 0 2px 0 rgba(255,77,79,0.2);
}
.btn-danger:hover {
  box-shadow: 0 4px 8px rgba(255,77,79,0.2);
}

/* ===== 5. 表单升级 ===== */
.form-input, .form-select {
  border-radius: 6px;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(82,196,26,0.08);
}

/* ===== 6. 弹窗升级 ===== */
.modal {
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.modal-header {
  padding: 16px 24px;
}
.modal-header h3 {
  font-size: 16px;
}
.modal-body {
  padding: 20px 24px;
}
.modal-footer {
  padding: 14px 24px;
}

/* ===== 7. Tab升级 ===== */
.invoice-tabs, .tax-tabs, .ar-tabs {
  border-bottom: 2px solid #f0f0f0;
}
.invoice-tab, .tax-tab, .ar-tab {
  padding: 10px 22px;
  font-size: 13px;
  position: relative;
  transition: all 0.2s;
}
.invoice-tab.active, .tax-tab.active, .ar-tab.active {
  font-weight: 600;
}

/* ===== 8. 徽章升级 ===== */
.badge {
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== 9. 页面标题升级 ===== */
.page-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== 10. 侧边栏升级 ===== */
.sidebar {
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}
.nav-item {
  border-radius: 0 6px 6px 0;
  margin: 1px 8px 1px 0;
  padding: 8px 14px 8px 18px;
  border-left: none;
  position: relative;
}
.nav-item.active {
  background: rgba(82,196,26,0.15);
  color: #73d13d;
}
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
}

/* ===== 11. 空状态升级 ===== */
.empty-state {
  padding: 60px 20px;
}
.empty-state::before {
  content: '📋';
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
}

/* ===== 12. 加载骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 80px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.skeleton-row {
  height: 40px;
  margin-bottom: 8px;
}

/* ===== 13. 行业模板选择卡片 ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.template-card {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(82,196,26,0.15);
  transform: translateY(-2px);
}
.template-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.template-card .template-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.template-card .template-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.template-card .template-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.template-card .template-tags {
  margin-top: 8px;
}
.template-card .template-tag {
  display: inline-block;
  padding: 1px 8px;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  margin: 2px;
}

/* ===== 14. 数据同步状态 ===== */
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}
.sync-status .sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
}
.sync-status .sync-dot.error { background: var(--danger); }
.sync-status .sync-dot.idle { background: var(--text-muted); animation: none; }
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}
.sync-status .sync-info {
  flex: 1;
}
.sync-status .sync-info .sync-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.sync-status .sync-info .sync-detail {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== 15. 快捷操作按钮组 ===== */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.quick-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.quick-action-btn .action-icon {
  font-size: 16px;
}

/* ===== 16. 响应式增强 ===== */
@media (max-width: 768px) {
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 12px; }
  .page-title { font-size: 16px; }
}
@media (max-width: 480px) {
  .template-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
}
