/* 
 * OpenClaw Design System
 * Unified Visual Style & Interaction Specifications
 */

:root {
  /* Brand Colors */
  --primary: #ff5722;
  --primary-hover: #f4511e;
  --primary-light: rgba(255, 87, 34, 0.1);

  /* Functional Colors */
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --info: #1890ff;

  /* Neutral Colors */
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f9fafb;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #1f1f1f;

  /* Text Colors */
  --text-main: #1f1f1f;
  --text-secondary: #757575;
  --text-tertiary: #bdbdbd;
  --text-white: #ffffff;

  /* Layout */
  --header-height: 64px;
  --footer-height: 90px;
  --container-width: 1400px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* Shadows */
  --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);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 16px 32px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Layui Pagination Theme Override */
.layui-laypage .layui-laypage-curr .layui-laypage-em {
  background-color: var(--primary) !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: #fcfbf9;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

/* Typography Hierarchy */
.t-display {
  font-size: 48px; /* 48px */
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.32px;
  margin-bottom: 15px; /* 24px */
}

.t-h1 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.16px;
  margin-bottom: 15px;
} /* 36px, 16px */
.t-h2 {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.16px;
  margin-bottom: 15px;
} /* 30px -> 30px approx, 16px */
.t-h3 {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 12px;
} /* 24px, 12px */
.t-h4 {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 8px;
} /* 20px, 8px */
.t-body-lg {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 15px;
} /* 18px */
.t-body {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
} /* 16px */
.t-sm {
  font-size: 14px;
  line-height: 1.5;
} /* 14px */
.t-xs {
  font-size: 12px;
  line-height: 1.5;
} /* 12px */

.font-medium {
  font-weight: 500;
}
.font-bold {
  font-weight: 700;
}
.font-black {
  font-weight: 900;
}

.text-primary {
  color: var(--primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.text-danger {
  color: var(--danger);
}
.text-success {
  color: var(--success);
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

/* Layout Components */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 15px; /* 24px */
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* 20px */
  height: 40px; /* 40px */
  border-radius: var(--radius-md);
  font-size: 14px; /* 14px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: 1px solid transparent;
  user-select: none;
}

.btn-sm {
  height: 32px; /* 32px */
  padding: 0 12px; /* 12px */
  font-size: 12px; /* 12px */
}

.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 48px; /* 48px */
  padding: 0 15px; /* 32px */
  font-size: 16px; /* 16px */
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: transparent;
}

.btn-primary:hover,
a.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2);
  color: var(--white);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: transparent;
}

.btn-danger:hover,
a.btn-danger:hover {
  background: #ff7875;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.2);
  color: var(--white);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: transparent;
}

.btn-success:hover,
a.btn-success:hover {
  background: #73d13d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.2);
  color: var(--white);
}

.btn-success:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--text-main);
}

.btn-outline:hover,
a.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover,
a.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Utilities */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-1 {
  flex: 1;
}
.flex-none {
  flex: none;
}
.gap-1 {
  gap: 4px;
} /* 4px */
.gap-2 {
  gap: 8px;
} /* 8px */
.gap-3 {
  gap: 12px;
} /* 12px */
.gap-4 {
  gap: 15px;
} /* 16px */
.gap-5 {
  gap: 15px;
} /* 24px */
.gap-6 {
  gap: 15px;
} /* 32px */
.gap-8 {
  gap: 15px;
} /* 48px */

.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.max-w-md {
  max-width: 448px;
}
.max-w-lg {
  max-width: 512px;
}
.max-w-xl {
  max-width: 576px;
}

.p-0 {
  padding: 0;
}
.p-2 {
  padding: 8px;
} /* 8px */
.p-4 {
  padding: 15px;
} /* 16px */
.p-5 {
  padding: 15px;
} /* 20px */
.p-6 {
  padding: 15px;
} /* 24px */
.p-8 {
  padding: 15px;
} /* 32px */
.p-10 {
  padding: 15px;
} /* 40px */
.px-4 {
  padding-left: 15px;
  padding-right: 15px;
}
.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.py-4 {
  padding-top: 15px;
  padding-bottom: 15px;
}

.m-0 {
  margin: 0;
}
.m-auto {
  margin: auto;
}
.mt-2 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 15px;
}
.mt-6 {
  margin-top: 15px;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 15px;
}
.mb-5 {
  margin-bottom: 15px;
}
.mb-6 {
  margin-bottom: 15px;
}
.mb-8 {
  margin-bottom: 15px;
} /* Reduced from 48px (48px) to 32px (32px) as requested to compress */
.mb-10 {
  margin-bottom: 15px;
} /* Reduced from 60px to 48px */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mx-2 {
  margin-left: 8px;
  margin-right: 8px;
}

.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

.bg-white {
  background-color: var(--white);
}
.bg-gray-50 {
  background-color: var(--gray-50);
}
.bg-gray-100 {
  background-color: var(--gray-100);
}

.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}
.rounded-full {
  border-radius: var(--radius-full);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
.shadow-xl {
  box-shadow: var(--shadow-xl);
}

.hidden {
  display: none !important;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}

.overflow-hidden {
  overflow: hidden;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}

/* Table Styles */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--white);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px; /* 14px */
  white-space: nowrap;
}

.table th {
  text-align: left;
  padding: 12px 15px; /* 12px 16px */
  background: var(--gray-50);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--gray-200);
}

.table td {
  padding: 12px 15px; /* 12px 16px */
  color: var(--text-main);
  border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 15px;
  flex-wrap: wrap;
  gap: 15px;
}

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

.pagination-controls {
  display: flex;
  gap: 8px;
}

/* Form Elements */
.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-main);
  background: var(--white);
  transition: all 0.2s;
}

.form-input:disabled {
  background: var(--gray-50);
  cursor: not-allowed;
}

textarea.form-input {
  height: auto;
  padding: 8px 12px;
  resize: vertical;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 15px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.badge-success {
  background: rgba(82, 196, 26, 0.1);
  color: var(--success);
}
.badge-warning {
  background: rgba(250, 173, 20, 0.1);
  color: var(--warning);
}
.badge-danger {
  background: rgba(255, 77, 79, 0.1);
  color: var(--danger);
}
.badge-info {
  background: rgba(24, 144, 255, 0.1);
  color: var(--info);
}

/* -------------------------------------
 * Laydate 样式覆盖 (日期范围选择选中颜色等)
 * ------------------------------------- */
.layui-laydate .layui-this,
.layui-laydate .layui-this > div {
  background-color: var(--primary) !important;
  color: var(--white) !important;
}
/* 范围选择 - 选中的日期之间背景色 */
.layui-laydate .laydate-selected,
.layui-laydate .laydate-selected:hover {
  background-color: var(--primary-light) !important;
}
/* 底部确认按钮 */
.layui-laydate-footer span[lay-type="confirm"] {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
}
.layui-laydate-footer span[lay-type="confirm"]:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}
