:root{
  --bg:#ffffff;
  --panel:#f8f9fa;
  --border:#e0e0e0;
  --text:#1a1a1a;
  --muted:#666666;
  --primary:#22c55e;
  --primary-light:#dcfce7;
  --primary-dark:#16a34a;
  --danger:#ef4444;
  --warning:#f59e0b;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  min-height:100vh;
}
.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.header-left{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand img{
  width: 32px;
  height: 32px;
}
.brand-title{
  font-size: 20px;
  font-weight: 700;
}
.page-title{
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover{
  background: var(--primary-dark);
}
.btn-secondary{
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover{
  background: #e9ecef;
}
.btn-sm{
  padding: 6px 12px;
  font-size: 12px;
}
.btn-danger{
  background: var(--danger);
}
.btn-danger:hover{
  background: #dc2626;
}
.toolbar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.search-box{
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-input{
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus{
  border-color: var(--primary);
}
.filter-select{
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.workflow-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.workflow-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.workflow-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.workflow-cover{
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
}
.workflow-cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.workflow-content{
  padding: 16px;
}
.workflow-name{
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-desc{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.workflow-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.workflow-status{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.status-enabled{
  background: var(--primary-light);
  color: var(--primary-dark);
}
.status-disabled{
  background: #fee2e2;
  color: var(--danger);
}
.status-draft{
  background: #fef3c7;
  color: var(--warning);
}
.workflow-actions{
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.workflow-actions .btn{
  flex: 1;
  justify-content: center;
}
.pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}
.pagination-btn{
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.pagination-btn:hover:not(:disabled){
  background: var(--panel);
}
.pagination-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination-info{
  font-size: 14px;
  color: var(--muted);
  margin: 0 16px;
}
.empty-state{
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state-icon{
  font-size: 64px;
  margin-bottom: 16px;
}
.empty-state-title{
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.empty-state-desc{
  font-size: 14px;
  margin-bottom: 24px;
}
.loading{
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.loading-spinner{
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
.modal-overlay{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.active{
  opacity: 1;
  visibility: visible;
}
.modal{
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 720px;
  padding: 24px;
  transform: scale(0.9);
  transition: transform 0.2s;
}
.modal-two-column{
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
}
.modal-left-column{
  display: flex;
  flex-direction: column;
}
.modal-right-column{
  display: flex;
  flex-direction: column;
}
.modal-overlay.active .modal{
  transform: scale(1);
}
.modal-title{
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}
.form-group{
  margin-bottom: 16px;
}
.form-label{
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input{
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus{
  border-color: var(--primary);
}
.form-textarea{
  min-height: 100px;
  resize: vertical;
}
/* 比例选择器样式 */
.ratio-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: #fff;
  min-height: 120px;
  cursor: pointer;
  gap: 8px;
}
.ratio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.ratio-option input[type="radio"]:checked {
  accent-color: #3b82f6;
}
.ratio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border: 2px solid #a5b4fc;
  border-radius: 4px;
}
.ratio-icon-landscape {
  width: 64px;
  height: 36px;
}
.ratio-icon-portrait {
  width: 36px;
  height: 64px;
}
.ratio-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ratio-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ratio-label {
  font-size: 12px;
  color: var(--muted);
}
/* 支持 :has() 选择器的浏览器显示选中状态 */
.ratio-option:has(input[type="radio"]:checked) {
  border-color: #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
/* 针对不支持 :has() 的浏览器，使用 JavaScript 处理选中状态 */
.ratio-option.checked {
  border-color: #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.toast{
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}
.toast.show{
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.error{
  background: var(--danger);
}
.toast.success{
  background: var(--primary);
}
.agent-btn{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.agent-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.agent-btn svg{
  width: 20px;
  height: 20px;
}
.agent-btn-title{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}
.agent-btn-desc{
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  line-height: 1.4;
}
.breadcrumb{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 8px;
}
.breadcrumb a{
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover{
  color: var(--primary-dark);
  text-decoration: underline;
}
.breadcrumb-separator{
  color: var(--border);
}
.breadcrumb-current{
  color: var(--text);
  font-weight: 500;
}
.feedback-btn{
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #16a34a 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
}
.feedback-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.5);
}
.feedback-modal-content{
  text-align: center;
  padding: 20px;
}
.feedback-qr-code{
  max-width: 280px;
  width: 100%;
  margin: 20px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.feedback-tip{
  font-size: 14px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.6;
}
.i18n-switcher-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}
