/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f7fb;
  color: #333;
  line-height: 1.6;
}

.hidden { display: none !important; }

.page {
  min-height: 100vh;
}

/* 登录页 */
.login-box {
  max-width: 360px;
  margin: 80px auto;
  padding: 40px 30px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-box p {
  color: #64748b;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.login-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

.error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
}

/* 顶部栏 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #e5e7eb;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-icon.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.btn-icon:hover {
  box-shadow: 0 6px 14px rgba(148, 163, 184, 0.3);
  transform: translateY(-1px);
}

/* 主布局 */
.main-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

.sidebar {
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 14px 12px;
}

.sidebar-section {
  background: #fff;
  border-radius: 16px;
  padding: 14px 10px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 10px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 8px;
  border-radius: 10px;
  background: #f3f4ff;
  margin-bottom: 10px;
}

.crumb {
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
}

.crumb.active {
  color: #4f46e5;
  font-weight: 600;
}

.crumb-sep {
  font-size: 12px;
  color: #9ca3af;
}

.group-tree {
  margin-top: 6px;
  overflow-y: auto;
}

.tree-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: #4b5563;
  transition: background 0.15s, color 0.15s;
}

.tree-item:hover {
  background: #eef2ff;
}

.tree-item.active {
  background: #e0e7ff;
  color: #4338ca;
}

.tree-icon {
  margin-right: 6px;
}

.tree-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧内容 */
.content {
  padding: 16px 18px 24px;
}

.content-section {
  background: #fff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
}

.filter-inline {
  display: flex;
  gap: 8px;
}

.filter-inline select,
.filter-inline input {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  outline: none;
  background: #f9fafb;
}

.filter-inline input {
  min-width: 160px;
}

/* 分组概览卡片 */
.group-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.group-card {
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.current-group-card {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.group-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
}

.group-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(148, 163, 184, 0.5);
}

.group-card:hover::after {
  opacity: 1;
}

.group-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.group-card-icon {
  margin-right: 6px;
}

.group-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-card-body {
  font-size: 12px;
  color: #374151;
  position: relative;
  z-index: 1;
}

.group-card-row {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.group-card-row .label {
  color: #6b7280;
}

.group-card-row .value {
  font-weight: 500;
}

.group-card-row .value.amount {
  color: #ea580c;
}

.group-overview-empty {
  padding: 18px 10px;
  font-size: 13px;
  color: #9ca3af;
}

.group-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  position: relative;
  z-index: 2;
}

.group-card-actions button {
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  white-space: nowrap;
}

.btn-stats {
  background: #eef2ff;
  color: #4f46e5;
}

.btn-stats:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

.btn-export {
  background: #dcfce7;
  color: #166534;
}

.btn-export:hover {
  background: #bbf7d0;
  transform: translateY(-1px);
}

.btn-share {
  background: #fef3c7;
  color: #92400e;
}

.btn-share:hover {
  background: #fde68a;
  transform: translateY(-1px);
}

.btn-edit {
  background: #e5e7eb;
  color: #374151;
}

.btn-edit:hover {
  background: #d1d5db;
  transform: translateY(-1px);
}

.group-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* 报价列表 */
.quote-list {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.quote-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.quote-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.quote-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  flex: 1;
  margin-right: 8px;
  line-height: 1.4;
}

.status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.status-pending { background: #fef9c3; color: #854d0e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-paid { background: #e0f2fe; color: #075985; }
.status-rejected { background: #fee2e2; color: #b91c1c; }

.quote-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-info p {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.quote-info p strong {
  color: #111827;
  font-weight: 600;
}

.quote-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

.quote-actions button,
.quote-actions select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.15s;
}

.quote-actions select {
  flex: 1;
  min-width: 80px;
}

.quote-actions button {
  cursor: pointer;
}

.quote-actions button:first-child {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
}

.btn-delete {
  color: #b91c1c;
  border-color: #fecaca !important;
  background: #fef2f2 !important;
}

.empty {
  padding: 30px 10px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

/* 弹窗通用 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 65px rgba(15,23,42,0.45);
  display: flex;
  flex-direction: column;
}

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

.modal-content h2 {
  font-size: 16px;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #9ca3af;
}

.group-form {
  padding: 14px 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-form input,
.group-form select {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
}

.group-form button {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

/* 表单 */
#quote-form {
  padding: 14px 18px 18px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.item-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.6fr 32px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.item-row input {
  font-size: 12px;
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
}

.btn-add {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  font-size: 13px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.form-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.btn-cancel {
  background: #f3f4f6;
  color: #4b5563;
}

.btn-submit {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

/* 分享弹窗 */
.share-content {
  padding: 20px 18px 18px;
  text-align: center;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin: 14px 0 18px;
}

.share-link-box input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  background: #f9fafb;
}

.share-link-box button {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.btn-close {
  padding: 8px 24px;
  border-radius: 999px;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
}

/* 响应式 */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .quote-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .quote-list {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (min-width: 1600px) {
  .quote-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}



