/* 若依风格 · 智慧班牌管理后台原型 */
: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-sub: #1f2d3d;
  --ry-sidebar-text: #bfcbd9;
  --ry-sidebar-active: #409eff;
  --ry-header-h: 50px;
  --ry-tags-h: 34px;
  --ry-bg: #f0f2f5;
  --ry-border: #dcdfe6;
  --ry-text: #303133;
  --ry-text-secondary: #606266;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: var(--ry-text);
  background: var(--ry-bg);
}

a {
  color: var(--ry-primary);
  text-decoration: none;
}

/* —— 登录 —— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a8ee6 0%, #304156 100%);
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 6px;
  padding: 28px 32px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.login-card__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: #303133;
  text-align: center;
}

.login-card__sub {
  margin: 0 0 24px;
  text-align: center;
  color: #909399;
  font-size: 13px;
}

.login-form__item {
  margin-bottom: 18px;
}

.login-form__item label {
  display: block;
  margin-bottom: 6px;
  color: #606266;
  font-size: 13px;
}

.login-form__item input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  font-size: 14px;
}

.login-form__item input:focus {
  outline: none;
  border-color: var(--ry-primary);
}

.login-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
  color: #606266;
}

.login-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 4px;
  background: var(--ry-primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.login-btn:hover {
  background: var(--ry-primary-dark);
}

.login-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: #909399;
}

/* —— 布局 —— */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-layout[hidden],
.login-page[hidden] {
  display: none !important;
}

.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--ry-sidebar);
  color: var(--ry-sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
}

.sidebar.is-collapsed {
  width: 64px;
}

.sidebar__logo {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  background: var(--ry-sidebar-sub);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar__logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--ry-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__logo-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.sidebar__menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}

.menu-group__title {
  padding: 12px 20px 6px;
  font-size: 12px;
  color: #7d8ea3;
}

.sidebar.is-collapsed .menu-group__title,
.sidebar.is-collapsed .menu-item__label,
.sidebar.is-collapsed .sidebar__logo-text {
  display: none;
}

.sidebar.is-collapsed .menu-item {
  justify-content: center;
  padding: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: 44px;
  cursor: pointer;
  color: var(--ry-sidebar-text);
  border-left: 3px solid transparent;
  font-size: 14px;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.15);
}

.menu-item.is-active {
  background: var(--ry-sidebar-sub);
  color: #fff;
  border-left-color: var(--ry-sidebar-active);
}

.menu-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
  color: inherit;
}

.menu-item__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-item.is-active .menu-item__icon {
  opacity: 1;
  color: #fff;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.navbar {
  height: var(--ry-header-h);
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.navbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar__toggle {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #606266;
  padding: 4px 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #97a8be;
}

.breadcrumb strong {
  color: #303133;
  font-weight: 500;
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #606266;
}

.navbar__link {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ry-primary);
  font-size: 13px;
}

.tags-view {
  height: var(--ry-tags-h);
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-shrink: 0;
  overflow-x: auto;
}

.tags-view__item {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  height: 26px;
  border: 1px solid #d8dce5;
  border-radius: 3px;
  font-size: 12px;
  color: #495060;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.tags-view__item.is-active {
  background: var(--ry-primary);
  border-color: var(--ry-primary);
  color: #fff;
}

.app-main {
  flex: 1;
  padding: 16px;
  overflow: auto;
}

.page-panel {
  background: #fff;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  min-height: calc(100vh - var(--ry-header-h) - var(--ry-tags-h) - 48px);
}

.page-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebeef5;
}

/* —— 查询栏 —— */
.query-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.query-form__item label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #606266;
}

.query-form__item input,
.query-form__item select {
  height: 32px;
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* —— 按钮 —— */
.ry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid var(--ry-border);
  background: #fff;
  color: #606266;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.ry-btn--primary {
  background: var(--ry-primary);
  border-color: var(--ry-primary);
  color: #fff;
}

.ry-btn--primary:hover {
  background: var(--ry-primary-dark);
}

.ry-btn--success {
  background: var(--ry-success);
  border-color: var(--ry-success);
  color: #fff;
}

.ry-btn--danger {
  background: var(--ry-danger);
  border-color: var(--ry-danger);
  color: #fff;
}

.ry-btn--text {
  border: none;
  background: none;
  color: var(--ry-primary);
  padding: 0 6px;
  height: auto;
}

.ry-btn--text.danger {
  color: var(--ry-danger);
}

.ry-btn + .ry-btn {
  margin-left: 0;
}

/* —— 表格 —— */
.ry-table-wrap {
  overflow-x: auto;
}

.ry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ry-table th,
.ry-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ebeef5;
  text-align: left;
}

.ry-table th {
  background: #f5f7fa;
  color: #909399;
  font-weight: 600;
}

.ry-table tbody tr:hover {
  background: #f5f7fa;
}

.ry-table__desc {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #606266;
}

.ry-tag {
  display: inline-block;
  padding: 0 8px;
  height: 24px;
  line-height: 22px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid;
}

.ry-tag--success {
  color: var(--ry-success);
  background: #f0f9eb;
  border-color: #c2e7b0;
}

.ry-tag--warning {
  color: var(--ry-warning);
  background: #fdf6ec;
  border-color: #f5dab1;
}

.ry-tag--danger {
  color: var(--ry-danger);
  background: #fef0f0;
  border-color: #fbc4c4;
}

.ry-tag--info {
  color: var(--ry-info);
  background: #f4f4f5;
  border-color: #d3d4d6;
}

.ry-tag--primary {
  color: var(--ry-primary);
  background: #ecf5ff;
  border-color: #b3d8ff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: #606266;
}

.pagination__btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--ry-border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.pagination__btn.is-active {
  background: var(--ry-primary);
  border-color: var(--ry-primary);
  color: #fff;
}

.pagination__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* —— 统计卡片 —— */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1100px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: #fff;
  border-radius: 4px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--ry-primary);
}

.stat-card--success {
  border-left-color: var(--ry-success);
}

.stat-card--warning {
  border-left-color: var(--ry-warning);
}

.stat-card--danger {
  border-left-color: var(--ry-danger);
}

.stat-card__label {
  font-size: 13px;
  color: #909399;
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 600;
  color: #303133;
}

.stat-card__extra {
  margin-top: 6px;
  font-size: 12px;
  color: #909399;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* —— 表单弹窗 —— */
.ry-dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ry-dialog-mask[hidden] {
  display: none !important;
}

.ry-dialog {
  width: min(100%, 520px);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.ry-dialog__head {
  padding: 14px 16px;
  border-bottom: 1px solid #ebeef5;
  font-size: 16px;
  font-weight: 600;
}

.ry-dialog__body {
  padding: 16px;
}

.ry-dialog__foot {
  padding: 12px 16px;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-grid .form-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.form-grid .form-row label {
  text-align: right;
  color: #606266;
  font-size: 13px;
}

.form-grid .form-row input,
.form-grid .form-row select,
.form-grid .form-row textarea {
  width: 100%;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

.form-grid .form-row textarea {
  min-height: 80px;
  resize: vertical;
}

.empty-tip {
  padding: 40px;
  text-align: center;
  color: #909399;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  padding: 10px 20px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  border-left: 4px solid var(--ry-success);
}

.toast[hidden] {
  display: none !important;
}

.form-page__back {
  margin-bottom: 12px;
}

.form-page__actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.form-row--full {
  grid-column: 1 / -1;
}

.page-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #303133;
  margin: 16px 0 8px;
}

.info-panel-inline {
  padding: 12px 16px;
  background: #f5f7fa;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #606266;
}

.stat-row--compact {
  margin-bottom: 16px;
}

.stat-card__value--sm {
  font-size: 18px !important;
}

.ry-inline-input {
  width: 100%;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}

.ry-table--schedule td {
  vertical-align: middle;
}

.schedule-editor__period {
  min-width: 120px;
}

.schedule-editor__period .ry-inline-input--time {
  margin-top: 6px;
  font-size: 12px;
}

.schedule-editor__del {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.muted-cell {
  font-size: 11px;
  color: #909399;
  font-weight: normal;
}

.album-list-thumb {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
}

.ry-table__actions {
  white-space: nowrap;
}

.ry-table__actions .ry-btn--text {
  margin-right: 4px;
}

.album-upload-box {
  border: 1px dashed var(--ry-border);
  border-radius: 6px;
  padding: 12px;
  background: #fafafa;
}

.album-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.album-photo-card {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.album-photo-card img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.album-photo-card__caption {
  border: none;
  border-top: 1px solid #ebeef5;
  padding: 6px 8px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.album-photo-card__remove {
  font-size: 12px;
  padding: 4px 8px 8px;
  align-self: flex-start;
}

.album-upload-picker {
  display: block;
  cursor: pointer;
}

.album-upload-picker__inner {
  display: block;
  text-align: center;
  padding: 20px;
  border: 1px dashed #c0c4cc;
  border-radius: 4px;
  color: #606266;
  font-size: 14px;
  background: #fff;
}

.album-upload-picker__inner:hover {
  border-color: var(--ry-primary);
  color: var(--ry-primary);
}

.album-upload-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #909399;
}

.list-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 8px;
}

.ry-btn--compact {
  min-width: 88px;
  padding: 0 20px;
}

.page-panel > .toolbar {
  margin-bottom: 12px;
}

.ry-combobox {
  position: relative;
  width: 100%;
}

.ry-combobox input {
  width: 100%;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
}

.ry-combobox__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 160px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--ry-border);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ry-combobox__list[hidden] {
  display: none !important;
}

.ry-combobox__option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.ry-combobox__option:hover {
  background: #ecf5ff;
  color: var(--ry-primary);
}

.ry-combobox__empty {
  padding: 8px 12px;
  color: #909399;
  font-size: 12px;
}
