/* ===== 律师行业原型组件样式 ===== *
 * Kanban 看板 + 计时器组件 + 演示页
 * 使用项目现有 CSS 变量体系
 */

/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-wrap {
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  font-size: 0.875rem;
  min-height: 400px;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kanban-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0;
}
.kanban-title i {
  color: var(--primary, #166534);
  margin-right: 0.375rem;
}

.kanban-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kanban-total {
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
}

.kanban-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: var(--primary, #166534);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.kanban-btn-add:hover { opacity: 0.85; }

/* -- Columns Layout -- */
.kanban-columns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .kanban-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .kanban-columns {
    grid-template-columns: 1fr;
  }
}

/* Scrollable container for many columns */
.kanban-columns-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.kanban-columns-scroll .kanban-columns {
  min-width: max-content;
}

.kanban-col {
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 0.5rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, background 0.2s;
  border: 2px solid transparent;
}

.kanban-col-over {
  border-color: var(--primary, #166534);
  background: var(--bg-active, #e5e7eb);
}

.kanban-col-empty {
  background: var(--bg-tertiary, #f9fafb);
}

/* -- Column Header -- */
.kanban-col-header {
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--col-accent, #6b7280);
  border-radius: 0.5rem 0.5rem 0 0;
  background: #fff;
}

.kanban-col-header-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-col-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  background: var(--col-accent, #6b7280);
  color: #fff;
  font-size: 0.75rem;
}

.kanban-col-label {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
  color: var(--text-primary, #111827);
}

.kanban-col-count {
  background: var(--col-accent, #6b7280);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  min-width: 1.25rem;
  text-align: center;
}

.kanban-col-toggle {
  background: none;
  border: none;
  color: var(--text-secondary, #9ca3af);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem;
}
.kanban-col-toggle:hover { color: var(--text-primary, #111827); }

/* -- Column Body -- */
.kanban-col-body {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

.kanban-col-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.8125rem;
  gap: 0.5rem;
  border: 2px dashed var(--border-color, #d1d5db);
  border-radius: 0.375rem;
}
.kanban-col-placeholder i {
  font-size: 1.5rem;
  opacity: 0.4;
}

/* -- Card -- */
.kanban-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: grab;
  position: relative;
  border: 1px solid var(--border-color, #e5e7eb);
  transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  user-select: none;
}
.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card-dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

/* -- Priority Badge -- */
.kanban-card-priority {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  padding: 0.0625rem 0.4375rem;
  border-radius: 0.25rem;
  margin-bottom: 0.375rem;
}

/* -- Card Content -- */
.kanban-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 0.375rem;
  line-height: 1.4;
}

.kanban-card-client {
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.25rem;
}
.kanban-card-client i {
  font-size: 0.75rem;
  width: 1rem;
  color: var(--primary, #166534);
}

.kanban-card-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary, #9ca3af);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #9ca3af);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color, #f3f4f6);
}

.kanban-card-assignee i,
.kanban-card-date i {
  margin-right: 0.125rem;
}

.kanban-card-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary, #d1d5db);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.kanban-card:hover .kanban-card-del { opacity: 1; }
.kanban-card-del:hover { color: #dc2626; }

/* -- Add Card Button -- */
.kanban-add-card {
  width: 100%;
  padding: 0.5rem;
  background: none;
  border: 1px dashed var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.kanban-add-card:hover {
  border-color: var(--primary, #166534);
  color: var(--primary, #166534);
}

/* ===== Kanban Editor Modal ===== */
.kanban-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.kanban-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kanban-field-row {
  display: flex;
  gap: 0.75rem;
}
.kanban-field-half {
  flex: 1;
}
.kanban-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary, #374151);
}
.kanban-label .required {
  color: #dc2626;
}
.kanban-input,
.kanban-select,
.kanban-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary, #111827);
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.kanban-input:focus,
.kanban-select:focus,
.kanban-textarea:focus {
  outline: none;
  border-color: var(--primary, #166534);
  box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.1);
}
.kanban-textarea {
  resize: vertical;
  min-height: 4rem;
}

/* ============================================
   TIMER WIDGET
   ============================================ */
.timer-wrap {
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  font-size: 0.875rem;
  max-width: 400px;
}

.timer-wrap.compact {
  max-width: 100%;
}

/* -- Timer Face -- */
.timer-display-area {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, var(--primary, #166534), #14532d);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.timer-face {
  display: inline-block;
}

.timer-digits {
  font-size: 3rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  letter-spacing: 0.1em;
  transition: color 0.3s;
}

.timer-face.running .timer-digits {
  color: #4ade80;
}

.timer-face.paused .timer-digits {
  color: #fbbf24;
  animation: timer-pulse 1.5s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-info-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
}

.timer-rate {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.timer-rate:hover { opacity: 1; }

.timer-amount {
  font-weight: 600;
}

/* -- Inputs -- */
.timer-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timer-field {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 0.375rem;
  padding: 0 0.75rem;
}

.timer-field-icon {
  color: var(--text-secondary, #9ca3af);
  font-size: 0.8125rem;
  width: 1rem;
}

.timer-input {
  flex: 1;
  padding: 0.625rem 0;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary, #111827);
  outline: none;
}
.timer-input::placeholder { color: var(--text-secondary, #9ca3af); }
.timer-input:disabled { opacity: 0.5; }

/* -- Actions -- */
.timer-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timer-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.timer-btn:active { transform: scale(0.97); }

.timer-btn-start {
  background: var(--primary, #166534);
  color: #fff;
}
.timer-btn-pause {
  background: #f59e0b;
  color: #fff;
}
.timer-btn-resume {
  background: #2563eb;
  color: #fff;
}
.timer-btn-stop {
  background: #dc2626;
  color: #fff;
}

/* -- Logs -- */
.timer-logs-section {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.5rem;
  overflow: hidden;
}

.timer-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: var(--bg-secondary, #f9fafb);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary, #374151);
  user-select: none;
}
.timer-logs-header:hover {
  background: var(--bg-active, #f3f4f6);
}

.timer-logs-toggle {
  color: var(--text-secondary, #9ca3af);
  font-size: 0.75rem;
}

.timer-logs-body {
  padding: 0.5rem 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.timer-logs-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.8125rem;
}
.timer-logs-empty i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.timer-log-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #f3f4f6);
}
.timer-log-item:last-child { border-bottom: none; }

.tl-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.tl-time {
  color: var(--text-secondary, #6b7280);
  min-width: 4rem;
}
.tl-duration {
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.tl-amount {
  color: var(--primary, #166534);
  font-weight: 600;
  margin-left: auto;
}
.tl-del {
  background: none;
  border: none;
  color: var(--text-secondary, #d1d5db);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.timer-log-item:hover .tl-del { opacity: 1; }
.tl-del:hover { color: #dc2626; }

.tl-body {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #9ca3af);
}
.tl-case i {
  margin-right: 0.125rem;
}

.timer-logs-clear {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: none;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.25rem;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.timer-logs-clear:hover {
  border-color: #dc2626;
  color: #dc2626;
}

/* -- Rate Edit Modal -- */
.timer-rate-edit {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.timer-rate-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #374151);
}

/* ============================================
   PROTOTYPE DEMO PAGE
   ============================================ */
.lawyer-demo-wrap {
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  padding: 1.5rem;
}

.lawyer-demo-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.lawyer-demo-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 0.375rem;
}

.lawyer-demo-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.lawyer-demo-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary, #f3f4f6);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.lawyer-demo-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}
.lawyer-demo-tab:hover {
  color: var(--text-primary, #111827);
}
.lawyer-demo-tab.active {
  background: #fff;
  color: var(--primary, #166534);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lawyer-demo-panel {
  background: #fff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.75rem;
  padding: 1.5rem;
  min-height: 400px;
}

.lawyer-demo-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lawyer-demo-panel-title i {
  color: var(--primary, #166534);
}

.lawyer-demo-desc {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 0.375rem;
  line-height: 1.5;
}

/* -- Permission Demo -- */
.perm-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.perm-demo-item {
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.perm-demo-item.granted {
  border-color: var(--success, #15803d);
  background: rgba(21, 128, 61, 0.05);
}
.perm-demo-item.denied {
  border-color: var(--border-color, #e5e7eb);
  opacity: 0.5;
}

.perm-demo-icon {
  width: 1.5rem;
  text-align: center;
  color: var(--text-secondary, #6b7280);
}
.perm-demo-item.granted .perm-demo-icon { color: var(--success, #15803d); }

.perm-demo-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary, #111827);
  flex: 1;
}

.perm-demo-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 600;
}
.perm-demo-badge.yes {
  background: var(--success, #15803d);
  color: #fff;
}
.perm-demo-badge.no {
  background: var(--border-color, #e5e7eb);
  color: var(--text-secondary, #9ca3af);
}

/* -- Timer demo inline -- */
.timer-demo-inline {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.timer-demo-main {
  flex: 1;
  min-width: 300px;
}
.timer-demo-side {
  width: 250px;
  padding: 1rem;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 0.5rem;
}
.timer-demo-side h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

/* Responsive */
@media (max-width: 768px) {
  .lawyer-demo-panel {
    padding: 1rem;
  }
  .timer-demo-inline {
    flex-direction: column;
  }
  .timer-demo-side {
    width: 100%;
  }
}
