/* 引入現代 Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

/* 全域設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 50% 50%, #f9f9fb 0%, #f0f2f6 100%);
  background-attachment: fixed;
  color: #2c3e50;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 頁首與導覽列 */
header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 15px 5%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  letter-spacing: 1px;
}

nav {
  margin-top: 0;
}

nav a {
  margin: 0 12px;
  text-decoration: none;
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 5px 0;
}

nav a:hover {
  color: #990000; /* 日式和風深紅 */
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #990000;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* 首頁主視覺 */
.hero {
  background: linear-gradient(135deg, rgba(6, 24, 42, 0.48), rgba(16, 88, 132, 0.18)), url('../images/hero-cooling-iceberg.png') no-repeat center center;
  background-size: cover;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  margin-bottom: 30px;
}

.hero h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
}

/* 商品展示區 */
.products {
  padding: 20px 12px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.products h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
  color: #111;
}

.products h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: #990000;
  margin: 8px auto 0;
  border-radius: 2px;
}

/* CasaOS 類似應用的 Grid 效果 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 22px;
  justify-content: center;
  align-items: start;
  margin-top: 20px;
}

/* CasaOS 卡片面板樣式 */
.product {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, box-shadow;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(153, 0, 0, 0.15);
}

/* App 圖示風格的圖片 */
.product-img-wrapper {
  width: min(100%, 400px);
  height: 400px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: visible;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
}

.product img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.product:hover img {
  transform: scale(1.06);
}

.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.product h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 4px;
}

/* CasaOS 標籤 */
.category-badge {
  display: inline-block;
  align-self: center;
  background: rgba(153, 0, 0, 0.06);
  color: #990000;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.description {
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 12px;
  min-height: 70px;
}

/* 控制區域 */
.purchase-controls {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #4a5568;
}

/* 下拉選單美化 */
.spec-select {
  font-family: inherit;
  font-size: 0.8rem;
  color: #2d3748;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
  max-width: 170px;
  outline: none;
  transition: border-color 0.2s ease;
}

.spec-select:focus {
  border-color: #990000;
}

/* 數量加減器 */
.quantity-selector {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  overflow: hidden;
  height: 26px;
  width: 80px;
}

.qty-btn {
  background: transparent;
  border: none;
  width: 25px;
  height: 100%;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  color: #718096;
  transition: background-color 0.2s ease;
}

.qty-btn:hover {
  background-color: #f7fafc;
  color: #111;
}

.quantity-input {
  border: none;
  width: 30px;
  height: 100%;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2d3748;
  outline: none;
  pointer-events: none; /* 禁用直接點擊，只用按鈕加減 */
  -appearance: textfield;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 卡片底部 (價格與按鈕) */
.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.section {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 5%;
}

.story-layout,
.contact-layout {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.story-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-layout {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.story-block,
.contact-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.04);
  padding: 24px;
}

.section h2 {
  color: #111;
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.section h3 {
  color: #1a202c;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.section p,
.section li {
  color: #4a5568;
}

.story-block ul {
  padding-left: 20px;
}

.contact-card {
  text-align: center;
}

.qr-link {
  display: inline-block;
  margin: 14px 0 18px;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qr-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.line-qr {
  display: block;
  width: 210px;
  height: 210px;
  margin: 14px auto 0;
  object-fit: contain;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.contact-button img,
.site-image-button img {
  display: block;
}

.line-button {
  background: #06c755;
}

.telegram-card {
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.12), rgba(255, 255, 255, 0.78));
  border-color: rgba(34, 158, 217, 0.22);
}

.telegram-button {
  background: #229ed9;
}

.site-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.site-image-button {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-image-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.site-image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.product p.price {
  font-size: 1.15rem;
  color: #990000;
  font-weight: 700;
  margin: 0;
}

/* CasaOS 安裝按鈕風格 */
.buy-btn {
  background: #1a202c;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border: none;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.buy-btn:hover {
  background: #990000;
  transform: scale(1.05);
}

/* 購物車頁面樣式 */
.cart-section {
  max-width: 1000px;
  margin: 40px auto;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.03);
}

.empty-cart {
  padding: 50px 20px;
  text-align: center;
}

.empty-cart p {
  color: #718096;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.btn-back {
  display: inline-block;
  background: #1a202c;
  color: #fff;
  padding: 10px 25px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.btn-back:hover {
  background: #990000;
}

/* 購物車表格設計 */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  text-align: left;
}

.cart-table th {
  background: rgba(0, 0, 0, 0.04);
  padding: 12px 15px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #4a5568;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.cart-table td {
  padding: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  color: #2d3748;
}

.product-name-cell {
  font-weight: 600;
  color: #1a202c;
}

.subtotal-cell {
  font-weight: 700;
  color: #990000;
}

.btn-delete {
  background: transparent;
  color: #e53e3e;
  border: 1px solid #fed7d7;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: #fff5f5;
  color: #c53030;
  border-color: #feb2b2;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-summary p {
  font-size: 1.1rem;
  font-weight: 600;
}

#totalPrice {
  color: #990000;
  font-size: 1.5rem;
  font-weight: 800;
  margin-left: 10px;
}

.btn-checkout {
  background: #990000;
  color: #fff;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(153, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.btn-checkout:hover {
  background: #b30000;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(153, 0, 0, 0.3);
}

/* 結帳頁面與表單設計 */
.checkout-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
}

.checkout-section h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  text-align: center;
  color: #111;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #990000;
  box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.08);
}

.carrier-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.carrier-option {
  min-height: 46px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #2d3748;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carrier-option:hover,
.carrier-option.active {
  border-color: #990000;
  background: #fff5f5;
  color: #990000;
  box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.08);
}

.carrier-hint {
  min-height: 22px;
  margin-bottom: 14px;
  color: #4a5568;
  font-size: 0.86rem;
  line-height: 1.5;
}

.store-choice-modal[hidden] {
  display: none;
}

.store-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
}

.store-choice-dialog {
  width: min(560px, 100%);
  max-height: min(720px, 88vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  text-align: left;
}

.store-choice-dialog h3 {
  margin-bottom: 8px;
  color: #1a202c;
  font-size: 1.1rem;
}

.store-choice-dialog p {
  margin-bottom: 12px;
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.5;
}

.store-choice-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.store-choice-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  color: #2d3748;
  text-align: left;
  cursor: pointer;
}

.store-choice-option:hover {
  border-color: #990000;
  background: #fff5f5;
}

.store-choice-option strong {
  font-size: 0.95rem;
  color: #111;
}

.store-choice-option span {
  color: #4a5568;
  font-size: 0.86rem;
  line-height: 1.4;
}

.field-error {
  color: #c53030;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 6px;
  min-height: 20px;
}

.order-query-form {
  margin-bottom: 18px;
}

.order-query-form .btn-checkout {
  margin-top: 4px;
  width: 100%;
}

/* 訂單明細展示 */
.order-summary-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.order-summary-box h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #2d3748;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 8px;
}

.order-summary-list {
  list-style: none;
}

.order-summary-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #4a5568;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  padding-top: 12px;
  margin-top: 12px;
}

/* 後台管理面板樣式 */
.admin-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px dashed rgba(0,0,0,0.1);
  text-align: left;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-admin-clear {
  background: transparent;
  color: #718096;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-admin-clear:hover {
  background: #f7fafc;
  color: #e53e3e;
  border-color: #feb2b2;
}

.btn-admin-clear.danger {
  color: #e53e3e;
  border-color: rgba(229, 62, 62, 0.25);
}

.btn-admin-clear.primary-action {
  color: #fff;
  background: #1a202c;
  border-color: #1a202c;
}

.btn-admin-clear.primary-action:hover {
  color: #fff;
  background: #990000;
  border-color: #990000;
}

.admin-toolbar,
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.myship-settings {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.blacklist-panel {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  margin-bottom: 18px;
  padding: 18px;
}

.batch-panel,
.archive-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 18px;
  padding: 18px;
}

.batch-panel h3,
.archive-panel h3 {
  margin-bottom: 14px;
}

.batch-actions {
  align-content: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.archive-row {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #2d3748;
  display: grid;
  font-size: 0.82rem;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 10px 12px;
}

.blacklist-panel h3 {
  color: #9b2c2c;
  margin-bottom: 14px;
}

.blacklist-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.blacklist-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.blacklist-entry,
.blacklist-empty {
  align-items: center;
  background: #fff;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #742a2a;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 10px 16px;
  justify-content: space-between;
  padding: 10px 12px;
}

.blacklist-entry-info {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.blacklist-remove-btn {
  flex: 0 0 auto;
}

.myship-settings h3 {
  margin-bottom: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}

.settings-save {
  margin-top: 8px;
}

.import-note {
  background: #fff;
  border: 1px solid rgba(153, 0, 0, 0.12);
  border-left: 4px solid #990000;
  border-radius: 8px;
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.export-status {
  color: #4a5568;
  font-size: 0.9rem;
  min-height: 22px;
  margin: -6px 0 16px;
}

.export-status.success {
  color: #1f7a3f;
  font-weight: 700;
}

.export-status.error {
  color: #c53030;
  font-weight: 700;
}

.shipment-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 12px;
  padding: 10px 12px;
}

.myship-send-status {
  display: grid;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  color: #4a5568;
  font-size: 0.85rem;
  margin-top: 12px;
  padding: 10px 12px;
}

.myship-send-status span {
  color: #2d3748;
  font-weight: 700;
}

.shipment-qr-box {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #2d3748;
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
}

.shipment-qr-box img {
  height: 96px;
  width: 96px;
}

.qr-missing {
  align-items: center;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #c53030;
  display: flex;
  font-size: 0.85rem;
  font-weight: 800;
  height: 96px;
  justify-content: center;
  padding: 10px;
  text-align: center;
  width: 96px;
}

.shipment-qr-box span {
  font-weight: 800;
}

.customer-shipment-box {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  border-radius: 8px;
  color: #22543d;
  margin-top: 16px;
  padding: 12px;
}

.customer-shipment-box.pending {
  background: #fffaf0;
  border-color: #fbd38d;
  color: #744210;
}

.customer-shipment-box h4 {
  margin-bottom: 8px;
}

.customer-shipment-box img {
  display: block;
  height: 128px;
  margin-top: 10px;
  width: 128px;
}

.shipment-row label {
  color: #2d3748;
  font-size: 0.85rem;
  font-weight: 700;
}

.shipment-input {
  min-height: 36px;
}

.order-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.order-card.high-risk-order {
  border-color: #e53e3e;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.12), 0 8px 18px rgba(155, 44, 44, 0.08);
}

.risk-banner {
  align-items: center;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #9b2c2c;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.risk-banner strong {
  background: #c53030;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  padding: 4px 10px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.order-id {
  font-weight: 700;
  font-size: 0.9rem;
  color: #2b6cb0;
}

.order-date {
  font-size: 0.8rem;
  color: #a0aec0;
}

.order-customer-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 15px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.info-item {
  color: #4a5568;
}

.info-item span {
  font-weight: 600;
  color: #2d3748;
}

.admin-order-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.admin-order-items th {
  text-align: left;
  padding: 6px 8px;
  font-weight: 600;
  color: #718096;
  border-bottom: 1px solid #e2e8f0;
}

.admin-order-items td {
  padding: 8px;
  border-bottom: 1px solid #edf2f7;
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.order-card-total {
  font-weight: 700;
  color: #990000;
  font-size: 1.05rem;
}

/* 頁尾 */
footer {
  background: #111;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 24px;
  margin-top: 60px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 手機與平板跨瀏覽器響應式排版 (Media Queries) --- */
@media (max-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.order-select-row {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.order-select-checkbox {
  height: 16px;
  width: 16px;
}

.product-summary-lines {
  display: inline-grid;
  gap: 2px;
  vertical-align: top;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }
  
  nav a {
    margin: 0 8px;
    font-size: 0.85rem;
  }

  .hero h2 {
    font-size: 1.6rem;
  }

  .hero {
    height: 180px;
  }

  .products {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* 行動端卡片改為縱向排版 */
  .product {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
  }

  .product-img-wrapper {
    width: min(100%, 400px);
    height: 400px;
  }

  .product-info {
    width: 100%;
  }

  .category-badge {
    align-self: center;
  }

  .spec-select {
    max-width: 100%;
  }

  .product-footer .buy-btn {
    width: 100%;
  }

  /* 購物車表格於手機端轉為 Card 佈局，完美防破版與防溢出 */
  .cart-table, 
  .cart-table thead, 
  .cart-table tbody, 
  .cart-table th, 
  .cart-table td, 
  .cart-table tr {
    display: block;
  }

  .cart-table thead {
    display: none; /* 隱藏表頭 */
  }

  .cart-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
  }

  .cart-table td {
    border-bottom: 1px solid #edf2f7;
    position: relative;
    padding-left: 45%;
    text-align: right;
  }

  .cart-table td:last-child {
    border-bottom: none;
  }

  /* 手機端表格欄位標記對應內容 */
  .cart-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    width: 40%;
    text-align: left;
    font-weight: 700;
    color: #4a5568;
  }
  
  .cart-summary {
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .shipment-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .story-layout {
    grid-template-columns: 1fr;
  }

  .products h2 {
    font-size: 1.4rem;
  }

  .products {
    padding: 15px 10px;
  }
}

