* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; }

/* 全局背景纹理 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(240,90,40,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139,111,71,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(226,183,20,0.03) 0%, transparent 50%),
    linear-gradient(135deg, #fafbfd 0%, #f0f2f5 50%, #f8f9fb 100%);
  background-size: 100% 100%;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; opacity: 0.03;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(139,111,71,0.4) 40px, rgba(139,111,71,0.4) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(139,111,71,0.4) 40px, rgba(139,111,71,0.4) 41px);
}

#app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); color: #fff; padding: 24px 0; flex-shrink: 0; box-shadow: 2px 0 20px rgba(0,0,0,0.15); }
.logo { text-align: center; font-size: 21px; font-weight: bold; margin-bottom: 40px; letter-spacing: 1px; }
.nav-item { display: block; padding: 14px 24px; color: rgba(255,255,255,0.7); text-decoration: none; transition: 0.25s; border-left: 3px solid transparent; font-size: 14px; margin: 2px 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; border-left-color: rgba(255,255,255,0.3); }
.nav-item.active { background: rgba(240,90,40,0.15); color: #fff; border-left-color: #f05a28; font-weight: 500; }
.main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.topbar { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 10; }
.panel { padding: 20px 28px; }
.panel.hidden { display: none; }
h2 { margin-top: 0; font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; margin: 0 0 12px; }
h4 { font-size: 16px; margin: 16px 0 10px; }
.form { background: #fff; padding: 24px; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); max-width: 700px; }
.form label { display: block; margin-bottom: 16px; font-size: 14px; color: #666; }
.form input, .form select, .form textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.form input:focus, .form select:focus { border-color: #f05a28; outline: none; box-shadow: 0 0 0 3px rgba(240,90,40,0.1); }
.btn { background: #fff; border: 1px solid #ddd; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: 0.2s; }
.btn:hover { background: #f5f5f5; }
.btn-primary { background: #f05a28; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: 0.2s; }
.btn-primary:hover { background: #d94a20; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(240,90,40,0.3); }
.btn-cancel { background: #ddd; color: #666; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-cancel:hover { background: #ccc; }
.btn-danger-sm { background: none; border: 1px solid #e85d3a; color: #e85d3a; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-danger-sm:hover { background: #e85d3a; color: #fff; }
.btn-edit-sm { background: none; border: 1px solid #4a90d9; color: #4a90d9; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-edit-sm:hover { background: #4a90d9; color: #fff; }
.btn-group { display: flex; gap: 12px; margin-top: 8px; }
.two-col { display: flex; gap: 24px; }
.two-col .sub-panel { flex: 1; min-width: 0; }
.sub-panel { background: #fff; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.inline-form { display: flex; gap: 12px; margin-top: 12px; align-items: center; }
.inline-form input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.inline-form select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; }
ul { list-style: none; padding: 0; margin: 0; }
li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
li:last-child { border-bottom: none; }
#decoEditor .hidden { display: none; }
#decoEditor h4 { margin: 20px 0 10px; font-size: 15px; color: #666; }
.toggle-advanced { color: #999; cursor: pointer; margin: 16px 0; font-size: 13px; user-select: none; }
.toggle-advanced:hover { color: #333; }
#decoAdvanced { margin-top: 12px; }
#decoAdvanced.hidden { display: none; }

/* 商品管理 */
.empty-hint { color: #bbb; font-size: 14px; text-align: center; padding: 40px 0; }
.product-list-admin { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.product-card-admin { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.product-card-admin:last-child { border-bottom: none; }
.prod-info { display: flex; flex-direction: column; gap: 4px; }
.prod-name { font-size: 15px; font-weight: 500; }
.prod-cat { font-size: 12px; color: #999; background: #f5f5f5; padding: 2px 8px; border-radius: 4px; display: inline-block; width: fit-content; }
.prod-price { font-size: 14px; color: #e85d3a; font-weight: 600; }
.prod-desc { font-size: 12px; color: #aaa; }
.prod-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hidden { display: none !important; }
.cat-list li span:first-child { font-size: 15px; }

/* 规格管理 */
.spec-item { background: #f9f9f9; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.spec-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.spec-header strong { font-size: 15px; }
.spec-badge { font-size: 12px; background: #8b6f47; color: #fff; padding: 2px 8px; border-radius: 10px; }
.spec-options-list { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-opt-tag { background: #e8e0d5; color: #5c3d2e; padding: 4px 10px; border-radius: 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.del-opt { color: #999; cursor: pointer; font-weight: bold; margin-left: 2px; }
.del-opt:hover { color: #e85d3a; }
.edit-opt { color: #4a90d9; cursor: pointer; font-size: 12px; margin-left: 2px; }
.edit-opt:hover { color: #357abd; }
.spec-view, .spec-edit { display: flex; align-items: center; gap: 8px; }
.spec-edit input { width: 140px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.spec-edit select { padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.opt-view, .opt-edit { display: flex; align-items: center; gap: 6px; }
.opt-edit input { width: 90px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.opt-edit input[type="number"] { width: 70px; }
.sold-check { font-size: 12px; color: #666; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sold-out-badge { font-size: 11px; background: #bbb; color: #fff; padding: 1px 5px; border-radius: 6px; }
.default-badge { font-size: 11px; background: #07c160; color: #fff; padding: 1px 6px; border-radius: 6px; }
.default-check { font-size: 12px; color: #666; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* 登录页 */
.login-overlay { position: fixed; inset: 0; background:
  radial-gradient(circle at 30% 40%, rgba(240,90,40,0.08) 0%, transparent 60%),
  radial-gradient(circle at 70% 60%, rgba(139,111,71,0.08) 0%, transparent 60%),
  linear-gradient(135deg, #f5f6fa 0%, #e8ecf1 100%);
  display: flex; justify-content: center; align-items: center; z-index: 9999; }
.login-overlay.hidden { display: none; }
.login-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(139,111,71,0.03) 35px, rgba(139,111,71,0.03) 36px),
    repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(139,111,71,0.03) 35px, rgba(139,111,71,0.03) 36px);
}
.login-card { background: #fff; padding: 48px 40px; border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.1); width: 380px; text-align: center; position: relative; z-index: 1; }
.login-logo { font-size: 32px; font-weight: bold; color: #1a1a2e; margin-bottom: 8px; }
.login-title { font-size: 18px; color: #888; margin-bottom: 32px; font-weight: normal; }
.login-form input { display: block; width: 100%; margin-bottom: 16px; padding: 13px 16px; border: 2px solid #e8e8e8; border-radius: 10px; font-size: 15px; transition: 0.2s; }
.login-form input:focus { border-color: #f05a28; outline: none; box-shadow: 0 0 0 4px rgba(240,90,40,0.08); }
.login-form .btn-primary { width: 100%; padding: 13px; font-size: 16px; margin-top: 8px; border-radius: 10px; font-weight: 500; }
.login-error { color: #e85d3a; font-size: 13px; margin-top: 12px; min-height: 18px; }


/* 登录后顶栏 */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
#adminName { color: #666; font-size: 14px; }
.btn-logout { background: none; border: 1px solid #ddd; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; color: #666; }
.btn-logout:hover { background: #fef0f0; border-color: #e85d3a; color: #e85d3a; }
#app.hidden { display: none; }

/* 图片上传 */
.image-upload-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.upload-box {
  width: 140px; height: 140px;
  border: 2px dashed #ddd;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  background: #fafafa; transition: border-color 0.2s;
}
.upload-box:hover { border-color: #f05a28; }
.upload-placeholder { text-align: center; color: #bbb; font-size: 14px; line-height: 1.6; }
.upload-preview { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.upload-status { font-size: 13px; color: #999; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* 广告图管理 */
.banner-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 10px;
  background: #fafafa; border: 1px solid #eee; border-radius: 10px;
}
.banner-preview-box {
  width: 100px; height: 68px;
  border: 1px dashed #ddd; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  background: #fff; flex-shrink: 0; transition: border-color 0.2s;
}
.banner-preview-box:hover { border-color: #f05a28; }
.banner-placeholder { text-align: center; color: #bbb; font-size: 12px; line-height: 1.5; }
.banner-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.banner-input-group { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.banner-url { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.banner-url:focus { border-color: #f05a28; outline: none; }
.banner-status { font-size: 12px; }

/* 装修配置-服务图标和子页面背景 */
.deco-icon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.deco-icon-grid label {
  font-size: 13px;
  color: #555;
  margin-bottom: 0;
}
.img-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.img-url-row input {
  flex: 1;
}

/* ========== 订单管理 - 全新设计 ========== */

#orders.panel { padding: 0; position: relative; min-height: calc(100vh - 60px); }

/* 订单页背景 */
.order-page-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 30%, rgba(240,90,40,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 70%, rgba(139,111,71,0.05) 0%, transparent 55%),
    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='%23d4a574' fill-opacity='0.04'%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");
}

/* 订单内容区 */
.order-content { position: relative; z-index: 1; padding: 28px; }

/* 工具栏 */
.order-toolbar {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  flex-wrap: wrap; justify-content: space-between;
}
.toolbar-left { display: flex; align-items: center; gap: 16px; }
.toolbar-left h2 { margin: 0; font-size: 24px; font-weight: 700; color: #1a1a2e; letter-spacing: 0.5px; }
.order-summary { display: flex; align-items: baseline; gap: 4px; }
.summary-num { font-size: 28px; font-weight: 700; color: #f05a28; font-family: 'Courier New', monospace; }
.summary-label { font-size: 14px; color: #999; }
.toolbar-center { flex: 1; display: flex; justify-content: center; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

/* 筛选按钮 */
.order-filters { display: flex; gap: 6px; background: #fff; padding: 5px; border-radius: 28px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.filter-btn { padding: 8px 20px; border: none; border-radius: 24px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; transition: 0.25s; color: #666; white-space: nowrap; }
.filter-btn:hover { color: #f05a28; background: rgba(240,90,40,0.06); }
.filter-btn.active { background: #f05a28; color: #fff; box-shadow: 0 3px 10px rgba(240,90,40,0.3); }

/* 搜索框 */
.order-search { position: relative; display: flex; align-items: center; }
.order-search input {
  width: 240px; padding: 10px 36px 10px 14px;
  border: 2px solid #e8e8e8; border-radius: 24px;
  font-size: 14px; outline: none; transition: 0.25s;
  background: #fff;
}
.order-search input:focus { border-color: #f05a28; box-shadow: 0 0 0 4px rgba(240,90,40,0.06); width: 280px; }
.order-search input::placeholder { color: #c0c0c0; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: #ddd; color: #666; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: 0.2s;
}
.search-clear:hover { background: #f05a28; color: #fff; }

/* 刷新按钮 */
.btn-refresh {
  padding: 10px 18px; border: 2px solid #e8e8e8; border-radius: 24px;
  background: #fff; cursor: pointer; font-size: 14px; color: #666;
  transition: 0.25s; white-space: nowrap;
}
.btn-refresh:hover { border-color: #f05a28; color: #f05a28; background: #fff5f2; }

/* 表格容器 */
.order-table-wrap {
  background: #fff; border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden; border: 1px solid #f0f0f0;
}
.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table thead { background: linear-gradient(180deg, #fafbfc, #f5f6f8); }
.order-table th {
  padding: 16px 18px; text-align: left; font-weight: 600; color: #888;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 2px solid #e8eaed; white-space: nowrap;
  position: sticky; top: 0;
}
.order-table th:last-child { text-align: center; }
.order-table td { padding: 16px 18px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.order-table tr:last-child td { border-bottom: none; }
.order-row { transition: all 0.2s; }
.order-row:hover { background: #fafbfe; transform: scale(1.001); }

/* 行状态左边框 */
.status-bg-0 { border-left: 4px solid #ffc107; }
.status-bg-1 { border-left: 4px solid #007bff; }
.status-bg-3 { border-left: 4px solid #6c757d; }
.status-bg-4 { border-left: 4px solid #dc3545; }

/* 状态标签 */
.status-badge { display: inline-block; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.status-0 { background: #fff8e1; color: #f57f17; }
.status-1 { background: #e3f2fd; color: #1565c0; }
.status-3 { background: #e8eaf0; color: #546e7a; }
.status-4 { background: #fce4ec; color: #c62828; }

/* 订单编号 */
.cell-orderno { font-family: 'SF Mono', 'Consolas', 'Courier New', monospace; font-size: 13px; color: #555; background: #f5f6f8; padding: 4px 10px; border-radius: 6px; letter-spacing: 0.3px; }

/* 取餐号 */
.pickup-badge { font-weight: 800; font-size: 17px; color: #f05a28; font-family: 'Courier New', monospace; background: #fff5f2; padding: 4px 10px; border-radius: 8px; }

/* 单元格内容 */
.cell-user { display: flex; flex-direction: column; gap: 3px; }
.cell-username { font-weight: 600; color: #1a1a2e; font-size: 14px; }
.cell-phone { font-size: 12px; color: #888; }
.cell-tag { display: inline-block; background: #f0f2f5; padding: 3px 10px; border-radius: 8px; font-size: 11px; color: #666; margin-top: 1px; align-self: flex-start; }
.cell-items { color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; line-height: 1.5; }
.cell-remark { font-size: 12px; color: #e85d3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; vertical-align: middle; background: #fff5f2; padding: 1px 8px; border-radius: 6px; }
.cell-price { font-weight: 700; color: #e85d3a; font-size: 15px; white-space: nowrap; }
.cell-time { color: #888; font-size: 13px; white-space: nowrap; }
.cell-actions { white-space: nowrap; text-align: center; }
.no-action { color: #ccc; font-size: 13px; letter-spacing: 0.5px; }

/* 表格内按钮 */
.btn-table { padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 500; border: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 3px; }
.btn-icon { font-size: 10px; }
.btn-done { background: #28a745; color: #fff; }
.btn-done:hover { background: #218838; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(40,167,69,0.3); }
.btn-cancel-order { background: none; border: 1.5px solid #dc3545; color: #dc3545; }
.btn-cancel-order:hover { background: #dc3545; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(220,53,69,0.25); }
.cell-actions button { margin: 0 4px; }

/* 分页 */
.order-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.order-pagination button {
  padding: 10px 18px; border: 2px solid #e8e8e8; border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 14px; color: #555;
  font-weight: 500; transition: all 0.2s;
}
.order-pagination button:hover { border-color: #f05a28; color: #f05a28; background: #fff5f2; }
.order-pagination button.active { background: #f05a28; color: #fff; border-color: #f05a28; font-weight: 600; box-shadow: 0 3px 10px rgba(240,90,40,0.3); }
.order-pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.order-pagination span { padding: 10px 4px; color: #ccc; }

/* 加载中 */
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 0; }
.spinner { width: 40px; height: 40px; border: 3px solid #e8e8e8; border-top-color: #f05a28; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner span { color: #999; font-size: 14px; }

/* 空状态 */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-text { font-size: 18px; font-weight: 600; color: #444; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: #aaa; }
