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

:root {
  --primary-color: #ff6b35;
  --primary-dark: #e55a2b;
  --text-color: #333;
  --text-light: #999;
  --bg-color: #f5f5f5;
  --white: #fff;
  --border-color: #eee;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  padding-bottom: 60px;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  padding: 15px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

/* 公告栏 */
.notice-bar {
  display: flex;
  align-items: center;
  background: #fffbea;
  border-bottom: 1px solid #ffe58f;
  padding: 10px 15px;
  overflow: hidden;
}

.notice-icon {
  font-size: 16px;
  margin-right: 10px;
  flex-shrink: 0;
}

.notice-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.notice-text {
  font-size: 14px;
  color: #d46b08;
  white-space: nowrap;
  animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* 主体容器 */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧分类 */
.category-sidebar {
  width: 90px;
  background: var(--white);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.category-list {
  padding: 10px 0;
}

.category-item {
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s;
}

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

.category-item.active {
  background: var(--bg-color);
  color: var(--primary-color);
  font-weight: 600;
  position: relative;
}

.category-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary-color);
}

.category-name {
  font-size: 14px;
}

/* 右侧菜品 */
.dish-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}

.dish-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish-item {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  height: 120px;
}

.dish-cover {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: center;
  background: var(--bg-color);
  flex-shrink: 0;
}

.dish-info {
  padding: 6px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.dish-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.dish-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 14px;
}

.dish-price .original {
  font-size: 10px;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 3px;
  font-weight: 400;
}

.add-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 售罄标签 */
.sold-out-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.dish-item.sold-out {
  opacity: 0.6;
}

/* 底部购物车条 */
.cart-bar {
  position: fixed;
  bottom: 50px;
  left: 10px;
  right: 10px;
  background: var(--primary-color);
  border-radius: 30px;
  display: flex;
  align-items: center;
  padding: 5px 15px;
  box-shadow: 0 4px 15px rgba(255,107,53,0.4);
  z-index: 99;
}

.cart-icon {
  display: flex;
  align-items: center;
  color: var(--white);
  font-size: 18px;
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  left: -8px;
  background: #ff4757;
  color: var(--white);
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.cart-total {
  margin-left: 35px;
  font-weight: 600;
}

.cart-submit {
  margin-left: auto;
  background: var(--white);
  color: var(--primary-color);
  padding: 8px 25px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
}

/* 购物车弹窗 */
.cart-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
}

.cart-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.cart-content {
  position: relative;
  background: var(--white);
  width: 100%;
  border-radius: 20px 20px 0 0;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
  font-size: 16px;
}

.cart-clear {
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.cart-item-name {
  flex: 1;
  font-size: 14px;
}

.cart-item-options {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-price {
  margin-left: 15px;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 60px;
  text-align: right;
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
}

.cart-footer .cart-total {
  font-size: 18px;
}

.checkout-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 10px 25px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* 菜品详情弹窗 */
.dish-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
}

.dish-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.dish-detail {
  position: relative;
  background: var(--white);
  width: 100%;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: var(--white);
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}

.dish-images {
  width: 100%;
  overflow: hidden;
  padding: 0;
}

.dish-images img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* 菜品详情里的封面大图 */
.dish-cover-large {
  width: 100%;
  height: auto;
  object-fit: cover;
}


#dishModalName {
  font-size: 20px;
  margin-bottom: 10px;
}

.dish-desc {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.dish-price {
  font-size: 24px;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 20px;
}

/* 可选项 */
.dish-options {
  margin-bottom: 20px;
}

.option-group {
  margin-bottom: 20px;
}

.option-group-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.option-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-item {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item.selected {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.option-item.selected input {
  accent-color: var(--white);
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  margin-right: 5px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.option-item input[type="checkbox"]:checked,
.option-item input[type="radio"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.option-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: var(--white);
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.option-item.selected input[type="checkbox"],
.option-item.selected input[type="radio"] {
  accent-color: var(--white);
}

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

/* 制作步骤 */
.dish-steps {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.dish-steps h4 {
  font-size: 16px;
  margin-bottom: 15px;
}

.step-item {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.step-number {
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
}

.step-content img {
  width: 100%;
  max-width: calc(100% - 20px);
  height: auto;
  margin: 10px 0;
  border-radius: 8px;
  display: block;
}

/* 底部操作栏 */
.dish-action {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background: var(--white);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quantity-control button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--white);
  font-size: 20px;
  cursor: pointer;
}

.quantity-control span {
  font-size: 16px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.add-to-cart-btn {
  flex: 1;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* 结算弹窗 */
.checkout-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.checkout-content {
  position: relative;
  background: var(--white);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  border-radius: 15px;
  padding: 20px;
  overflow-y: auto;
}

.checkout-content h3 {
  text-align: center;
  margin-bottom: 20px;
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
}

.checkout-items {
  margin: 20px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  max-height: 150px;
  overflow-y: auto;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  align-items: flex-start;
}

.checkout-item > div {
  flex: 1;
}

.checkout-total {
  text-align: right;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.submit-btn {
  width: 100%;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 15px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* 底部 Tab 栏 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--white);
  display: flex;
  border-top: 1px solid var(--border-color);
  z-index: 98;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 10px;
}

.tab-item.active {
  color: var(--primary-color);
}

.tab-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: var(--white);
  padding: 12px 25px;
  border-radius: 8px;
  z-index: 1000;
  font-size: 14px;
}
