/* ========== 良库工舍招商服务中心 - 移动端优先全局样式 ========== */

:root {
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --primary-dark: #0F2A1E;
  --accent: #D4A853;
  --accent-light: #F0D78C;
  --accent-dark: #B8922E;
  --bg: #F7F5F0;
  --white: #FFFFFF;
  --text: #2D2D2D;
  --text-light: #5C5C5C;
  --text-muted: #999999;
  --border: #E8E4DC;
  --border-light: #F0EDE7;
  --success: #52C41A;
  --warning: #FAAD14;
  --danger: #FF4D4F;
  --info: #1890FF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

/* ========== 移动端安全区域 ========== */
.safe-area-top { padding-top: env(safe-area-inset-top, 0px); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ========== 首页 - 全屏引导页 ========== */
.home-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #0D2818 0%, #1B4332 30%, #2D6A4F 65%, #1B4332 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* 装饰光晕 */
.home-page::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -25%;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.home-page::after {
  content: '';
  position: absolute;
  bottom: 8%;
  left: -20%;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,83,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.home-header {
  text-align: center;
  padding: 55px 24px 24px;
  padding-top: calc(55px + env(safe-area-inset-top, 0px));
  position: relative;
  z-index: 1;
}

.home-logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  background: rgba(255,255,255,0.08);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.home-header h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff, #d4c8a0, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-header .subtitle {
  font-size: 14px;
  opacity: 0.65;
  letter-spacing: 3px;
  font-weight: 400;
}

/* 分隔装饰线 */
.home-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 24px 18px;
  position: relative;
  z-index: 1;
}

.home-divider::before,
.home-divider::after {
  content: '';
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.home-divider span {
  width: 6px;
  height: 6px;
  background: rgba(212,168,83,0.6);
  border-radius: 50%;
}

.home-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 20px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 20px));
  position: relative;
  z-index: 1;
}

.entry-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px);
  border-radius: 18px;
  padding: 26px 22px 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

.entry-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.entry-card-owner {
  background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,250,240,0.97) 100%);
}

.entry-card-tenant {
  background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(240,248,245,0.97) 100%);
}

.entry-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 80px;
  opacity: 0.06;
}

.entry-card-owner::after {
  background: #D4A853;
}

.entry-card-tenant::after {
  background: #2D6A4F;
}

.entry-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
}

.entry-card-owner .card-icon {
  background: linear-gradient(135deg, #f0d060, #d4a853);
  box-shadow: 0 4px 14px rgba(212,168,83,0.3);
}

.entry-card-tenant .card-icon {
  background: linear-gradient(135deg, #40916C, #2D6A4F);
  box-shadow: 0 4px 14px rgba(45,106,79,0.3);
}

.entry-card .card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: 0.5px;
}

.entry-card .card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 80%;
}

.entry-card .card-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
  opacity: 0.4;
}

/* 特色标签 */
.home-features {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 20px 10px;
  position: relative;
  z-index: 1;
}

.home-features .feature-item {
  text-align: center;
  font-size: 11px;
  opacity: 0.6;
  letter-spacing: 1px;
}

.home-features .feature-dot {
  display: block;
  width: 6px;
  height: 6px;
  background: rgba(212,168,83,0.5);
  border-radius: 50%;
  margin: 0 auto 6px;
}

/* 底部信息 */
.home-footer {
  text-align: center;
  padding: 12px 24px 26px;
  padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  opacity: 0.45;
  color: var(--white);
  position: relative;
  z-index: 1;
  letter-spacing: 3px;
  font-weight: 300;
}

/* ========== 通用头部导航 ========== */
.header {
  background: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-back {
  color: var(--white);
  text-decoration: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.8;
  padding: 4px 0;
}

.header-logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.header-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ========== 表单页面 ========== */
.form-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: 40px;
}

.form-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 28px 20px 40px;
  text-align: center;
}

.form-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.form-header p {
  font-size: 13px;
  opacity: 0.75;
}

.form-container {
  max-width: 600px;
  margin: -20px auto 0;
  padding: 0 16px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: var(--text);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #c0c0c0;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== 配套设施勾选 ========== */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.facility-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  color: var(--text-light);
}

.facility-item:has(input:checked) {
  border-color: var(--primary-light);
  background: rgba(45,106,79,0.05);
  color: var(--primary);
  font-weight: 600;
}

.facility-item input {
  display: none;
}

/* ========== 图片上传 ========== */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-box:active {
  border-color: var(--primary-light);
  background: rgba(45,106,79,0.03);
}

.upload-box .camera-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.upload-box p {
  font-size: 14px;
  color: var(--text-light);
}

.upload-box .upload-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ========== 提交按钮 ========== */
.submit-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(212,168,83,0.35);
  -webkit-tap-highlight-color: transparent;
}

.submit-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(212,168,83,0.3);
}

/* ========== 通用按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

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

.btn-primary:active {
  background: var(--accent-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:active {
  background: rgba(27,67,50,0.05);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }

/* ========== Toast提示 ========== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 24px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== 成功提示页 ========== */
.success-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  text-align: center;
  padding: 40px 24px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #73d13d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(82,196,26,0.3);
}

.success-page h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.success-page p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 30px;
  max-width: 280px;
}

/* ========== 管理后台 ========== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--primary-dark), #091a12);
  color: var(--white);
  padding: 20px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-sidebar h3 {
  text-align: center;
  font-size: 16px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255,255,255,0.06);
  color: var(--white);
  border-left-color: var(--accent);
}

.admin-main {
  flex: 1;
  padding: 24px;
  background: #f5f6f8;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 {
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 数据表格 */
.data-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

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

.data-table th {
  background: #fafafa;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

.data-table tr:hover td {
  background: #fafbfc;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending { background: #fff7e6; color: #d48806; }
.status-approved { background: #f6ffed; color: #389e0d; }
.status-rejected { background: #fff2f0; color: #cf1322; }
.status-following { background: #e6f7ff; color: #096dd9; }
.status-completed { background: #f6ffed; color: #389e0d; }

.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark), #091a12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-card h2 {
  text-align: center;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.login-card .login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* CMS */
.cms-list {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.cms-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cms-item:last-child { border-bottom: none; }

.cms-item .cms-key {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  width: 140px;
}

.cms-item .cms-value {
  flex: 1;
  margin: 0 16px;
  font-size: 13px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-item input {
  flex: 1;
  margin: 0 16px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.cms-item input:focus {
  border-color: var(--primary-light);
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px 20px;
  animation: slideUp 0.3s ease;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.modal-images {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.modal-images img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.modal-form {
  max-height: 70vh;
  overflow-y: auto;
}

/* Banner管理 */
.banner-preview {
  width: 200px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
}

/* 设置 */
.settings-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.pagination button:hover { border-color: var(--primary-light); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .facilities-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }

  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .admin-sidebar h3 { display: none; }
  .admin-sidebar a { white-space: nowrap; padding: 8px 12px; font-size: 13px; border-left: none; border-bottom: 3px solid transparent; }
  .admin-sidebar a.active { border-bottom-color: var(--accent); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
