/* 若依 RuoYi 风格 — SaaS 总平台原型 */
:root {
  --ry-primary: #409eff;
  --ry-primary-dark: #337ecc;
  --ry-success: #67c23a;
  --ry-warning: #e6a23c;
  --ry-danger: #f56c6c;
  --ry-info: #909399;
  --ry-sidebar: #304156;
  --ry-sidebar-dark: #1f2d3d;
  --ry-sidebar-text: #bfcbd9;
  --ry-sidebar-active: #263445;
  --ry-header-h: 50px;
  --ry-border: #e6e6e6;
  --ry-bg: #f0f2f5;
  --ry-text: #303133;
  --ry-text-secondary: #606266;
  --ry-font: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--ry-font); font-size: 14px; color: var(--ry-text); background: var(--ry-bg); }

/* Login */
.ry-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
  position: relative; overflow: hidden;
}
.ry-login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.ry-login-box {
  width: 400px; background: #fff; border-radius: 6px; padding: 36px 36px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); position: relative; z-index: 1;
}
.ry-login-title { text-align: center; font-size: 22px; font-weight: 600; color: #303133; margin-bottom: 6px; }
.ry-login-sub { text-align: center; font-size: 13px; color: #909399; margin-bottom: 28px; }
.ry-form-item { margin-bottom: 18px; }
.ry-form-item label { display: block; font-size: 13px; color: #606266; margin-bottom: 6px; }
.ry-input {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid #dcdfe6; border-radius: 4px;
  font-size: 14px; outline: none; transition: border-color .2s;
}
.ry-input:focus { border-color: var(--ry-primary); }
.ry-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px;
  border-radius: 4px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: all .2s;
}
.ry-btn-primary { background: var(--ry-primary); color: #fff; border-color: var(--ry-primary); }
.ry-btn-primary:hover { background: var(--ry-primary-dark); }
.ry-btn-default { background: #fff; color: #606266; border-color: #dcdfe6; }
.ry-btn-default:hover { color: var(--ry-primary); border-color: #c6e2ff; background: #ecf5ff; }
.ry-btn-success { background: var(--ry-success); color: #fff; }
.ry-btn-danger { background: var(--ry-danger); color: #fff; }
.ry-btn-text { background: transparent; color: var(--ry-primary); border: none; padding: 0 8px; height: auto; }
.ry-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.ry-btn-block { width: 100%; }

/* App shell */
.ry-app { display: flex; min-height: 100vh; }
.ry-sidebar {
  width: 210px; flex-shrink: 0; background: var(--ry-sidebar); color: var(--ry-sidebar-text);
  display: flex; flex-direction: column; transition: width .2s;
}
.ry-sidebar-logo {
  height: 50px; display: flex; align-items: center; padding: 0 16px; gap: 10px;
  background: var(--ry-sidebar-dark); color: #fff; font-weight: 700; font-size: 15px;
}
.ry-sidebar-logo .logo-icon {
  width: 32px; height: 32px; background: var(--ry-primary); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ry-menu { flex: 1; padding: 8px 0; overflow-y: auto; }
.ry-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 48px;
  color: var(--ry-sidebar-text); cursor: pointer; font-size: 14px; text-decoration: none;
  border-left: 3px solid transparent; transition: all .15s;
}
.ry-menu-item:hover { background: var(--ry-sidebar-active); color: #fff; }
.ry-menu-item.active { background: var(--ry-sidebar-active); color: var(--ry-primary); border-left-color: var(--ry-primary); }
.ry-menu-group-title {
  padding: 12px 20px 6px; font-size: 12px; color: #7a8a9a; text-transform: uppercase; letter-spacing: .5px;
}

.ry-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ry-navbar {
  height: var(--ry-header-h); background: #fff; border-bottom: 1px solid var(--ry-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0;
}
.ry-breadcrumb { font-size: 13px; color: #97a8be; }
.ry-breadcrumb b { color: var(--ry-text); font-weight: 500; }
.ry-navbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #606266; }
.ry-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ry-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}

.ry-content { flex: 1; padding: 16px; overflow: auto; }
.ry-page { display: none; }
.ry-page.active { display: block; }

/* Cards & panels */
.ry-card {
  background: #fff; border-radius: 4px; border: 1px solid #ebeef5;
  box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 16px;
}
.ry-card-header {
  padding: 14px 16px; border-bottom: 1px solid #ebeef5; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
}
.ry-card-body { padding: 16px; }

/* Stat cards */
.ry-stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 16px; }
.ry-stat-card {
  background: #fff; border-radius: 4px; padding: 20px; border: 1px solid #ebeef5;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ry-stat-card .label { font-size: 13px; color: #909399; margin-bottom: 8px; }
.ry-stat-card .value { font-size: 28px; font-weight: 700; color: var(--ry-text); }
.ry-stat-card .value.primary { color: var(--ry-primary); }
.ry-stat-card .value.success { color: var(--ry-success); }
.ry-stat-card .value.danger { color: var(--ry-danger); }
.ry-stat-card .value.warning { color: var(--ry-warning); }

/* Search form */
.ry-search-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 0; }
.ry-search-form .ry-form-item { margin-bottom: 0; }
.ry-search-form .ry-input { width: 180px; }
.ry-search-form select.ry-input { cursor: pointer; }

/* Table */
.ry-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ry-table th, .ry-table td { padding: 12px 10px; border-bottom: 1px solid #ebeef5; text-align: left; }
.ry-table th { background: #fafafa; color: #909399; font-weight: 600; }
.ry-table tr:hover td { background: #f5f7fa; }
.ry-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tags */
.ry-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 18px;
}
.ry-tag-success { background: #f0f9eb; color: var(--ry-success); border: 1px solid #e1f3d8; }
.ry-tag-danger { background: #fef0f0; color: var(--ry-danger); border: 1px solid #fde2e2; }
.ry-tag-warning { background: #fdf6ec; color: var(--ry-warning); border: 1px solid #faecd8; }
.ry-tag-info { background: #f4f4f5; color: var(--ry-info); border: 1px solid #e9e9eb; }

/* Pagination */
.ry-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 0 0; font-size: 13px; color: #606266; }
.ry-pagination .page-btn {
  min-width: 28px; height: 28px; border: 1px solid #dcdfe6; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; background: #fff;
}
.ry-pagination .page-btn.active { background: var(--ry-primary); color: #fff; border-color: var(--ry-primary); }

/* Form layout */
.ry-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.ry-form-grid .full { grid-column: 1 / -1; }
.ry-form-hint { font-size: 12px; color: #909399; margin-top: 4px; }

/* Modal */
.ry-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: none; align-items: center; justify-content: center;
}
.ry-modal-mask.open { display: flex; }
.ry-modal {
  background: #fff; border-radius: 6px; width: 640px; max-width: 95vw; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.ry-modal-header { padding: 16px 20px; border-bottom: 1px solid #ebeef5; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.ry-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.ry-modal-footer { padding: 12px 20px; border-top: 1px solid #ebeef5; text-align: right; display: flex; gap: 8px; justify-content: flex-end; }

/* Chart placeholder */
.ry-chart-placeholder {
  height: 280px; background: linear-gradient(180deg, #fafbfc, #fff); border: 1px dashed #dcdfe6;
  border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #c0c4cc; font-size: 14px;
}

/* Tabs */
.ry-tabs { display: flex; border-bottom: 1px solid #e4e7ed; margin-bottom: 16px; }
.ry-tab {
  padding: 10px 20px; cursor: pointer; color: #606266; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ry-tab.active { color: var(--ry-primary); border-bottom-color: var(--ry-primary); }

@media (max-width: 1200px) {
  .ry-stat-row { grid-template-columns: repeat(3, 1fr); }
  .ry-form-grid { grid-template-columns: 1fr; }
}
