@media (max-width:1024px) {
  .cyber-nav {
    left:50%;
    top:auto;
    bottom:calc(16px + env(safe-area-inset-bottom,0px));
    transform:translateX(-50%);
    flex-direction:row;
    padding:12px 16px;
    border-radius:var(--radius-full);
    width:auto;
    max-width:calc(100% - 32px)
  }
  .nav-logo {
    display:none
  }
  .nav-menu {
    flex-direction:row;
    gap:8px
  }
  .main-content {
    padding:24px 24px calc(90px + env(safe-area-inset-bottom,0px))
  }
  .theme-toggle {
    transform:scale(0.85);
    transform-origin:top right
  }
  .charts-row {
    grid-template-columns:1fr;
    gap:20px
  }
  .home-top-row {
    grid-template-columns:1fr;
    gap:16px
  }
  .charts-row.three-cols {
    grid-template-columns:repeat(2,1fr)
  }
  .products-grid {
    grid-template-columns:repeat(3,1fr)
  }
  .customers-grid {
    grid-template-columns:repeat(2,1fr)
  }
  .payment-card-value {
    font-size:18px
  }
}
@media (max-width:768px) {
  .nav-item,.nav-create-btn {
    width:44px;
    height:44px
  }
  .main-content {
    padding:16px 12px calc(90px + env(safe-area-inset-bottom,0px));
    overflow-x:hidden
  }
  .home-top-row {
    gap:12px;
    margin-bottom:0
  }
  .charts-row {
    gap:12px
  }
  .top3-grid {
    gap:8px
  }
  .theme-toggle {
    transform:scale(0.8)
  }
  .top-stats {
    grid-template-columns:1fr;
    gap:16px
  }
  .charts-row.three-cols {
    grid-template-columns:1fr;
    gap:16px
  }
  .stat-card-lg {
    padding:14px
  }
  .stat-card-value {
    font-size:24px;
    margin-bottom:12px
  }
  .stat-card-value {
    font-size:26px
  }
  .stat-card-icon {
    width:24px;
    height:24px;
    font-size:12px
  }
  .stat-sub-value {
    font-size:13px
  }
  .pipeline-card {
    padding:16px
  }
  .pipeline-node {
    min-width:44px;
    padding:6px 2px
  }
  .pipeline-count {
    font-size:14px
  }
  .pipeline-label {
    font-size:9px
  }
  .pipeline-dot {
    width:8px;
    height:8px
  }
  .podium-wrapper {
    gap:10px;
    padding-bottom:8px;
    min-height:180px
  }
  .ranking-list {
    gap:6px
  }
  .podium-item {
    width:90px
  }
  .podium-avatar {
    width:44px;
    height:44px;
    font-size:16px
  }
  .podium-rank-badge {
    width:24px;
    height:24px;
    font-size:11px
  }
  .rank-1 .podium-step {
    height:85px
  }
  .rank-2 .podium-step {
    height:60px
  }
  .rank-3 .podium-step {
    height:40px
  }
  .podium-name {
    max-width:86px;
    font-size:12px
  }
  .podium-stats {
    font-size:11px
  }
  .size-chart-container {
    height:200px
  }
  .chart-container {
    height:240px
  }
  .radar-container {
    min-height:240px
  }
  .chart-section,.radar-section {
    padding:14px
  }
  .top3-img,.top3-placeholder {
    width:72px;
    min-height:72px
  }
  .top3-placeholder {
    font-size:26px
  }
  .top3-name {
    font-size:13px
  }
  .top3-qty {
    font-size:13px
  }
  .top3-total {
    font-size:13px
  }
  .chart-controls {
    flex-direction:column;
    align-items:flex-start;
    gap:8px
  }
  .metric-buttons {
    flex-wrap:wrap;
    gap:4px
  }
  .metric-btn {
    padding:4px 8px;
    font-size:10px
  }
  .time-filter {
    display:flex;
    flex-wrap:wrap;
    gap:4px
  }
  .time-btn {
    padding:4px 8px;
    font-size:10px
  }
  .status-filter-btn {
    flex-shrink:0;
    white-space:nowrap
  }
  .cyber-table-container {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border:none
  }
  .cyber-table {
    width:100%
  }
  .cyber-table thead {
    display:none
  }
  .cyber-table tbody {
    display:block
  }
  .cyber-table tr {
    display:block;
    margin-bottom:10px;
    padding:14px;
    border-radius:14px;
    background:var(--bg-card-flat);
    border:1px solid var(--border-subtle);
    cursor:pointer;
    -webkit-tap-highlight-color:rgba(6,182,212,0.15)
  }
  .cyber-table tr:active {
    background:var(--bg-card-hover);
    transform:scale(0.98);
    transition:transform 0.1s
  }
  .cyber-table td {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:5px 0;
    border-bottom:1px solid rgba(128,128,128,0.06);
    font-size:13px
  }
  .cyber-table td:last-child {
    border-bottom:none
  }
  .cyber-table td::before {
    content:attr(data-label);
    font-weight:600;
    font-size:12px;
    color:var(--text-secondary);
    margin-right:12px;
    flex-shrink:0
  }
  .cyber-table td:first-child {
    font-size:14px;
    font-weight:700;
    color:var(--cyan-primary);
    padding-bottom:8px;
    margin-bottom:6px;
    border-bottom:2px solid var(--border-subtle)
  }
  .cyber-table td:first-child::before {
    display:none
  }
  .orders-pagination {
    gap:4px
  }
  .orders-pagination button {
    min-width:36px;
    min-height:36px
  }
  .orders-page-size {
    display:none
  }
  .products-toolbar {
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px
  }
  .products-toolbar .cyber-search {
    flex:1;
    min-width:0;
    width:auto
  }
  .products-toolbar .cyber-search input {
    font-size:16px
  }
  .products-toolbar .view-toggle {
    display:none
  }
  .products-toolbar .cyber-btn {
    padding:6px 10px;
    font-size:11px;
    white-space:nowrap
  }
  .products-toolbar .brand-filter-scroll {
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px
  }
  .brand-filter-btn {
    flex-shrink:0;
    white-space:nowrap;
    padding:6px 12px;
    font-size:11px
  }
  .products-grid {
    grid-template-columns:repeat(2,1fr);
    gap:12px
  }
  .product-card {
    padding:10px
  }
  .product-card-img {
    height:120px
  }
  .product-card-img img {
    object-fit:cover
  }
  .product-card-info {
    padding:10px
  }
  .product-card-no {
    font-size:12px
  }
  .product-card-price {
    font-size:13px
  }
  .product-card-brand {
    font-size:10px
  }
  .customers-grid {
    grid-template-columns:1fr
  }
  .cyber-card:hover,.ranking-item:hover,.stat-card:hover,.product-card:hover,.customer-card:hover {
    transform:none
  }
  .detail-grid-2col {
    grid-template-columns:1fr;
    gap:16px
  }
  .detail-topbar {
    flex-direction:row;
    align-items:center;
    gap:8px;
    flex-wrap:nowrap;
    margin-bottom:12px
  }
  .detail-topbar > .cyber-btn {
    padding:0;
    min-width:36px;
    min-height:36px;
    flex-shrink:0;
    visibility:hidden
  }
  .detail-topbar > .cyber-btn::after {
    content:'←';
    font-size:20px;
    font-weight:700;
    line-height:1;
    color:var(--cyan-primary);
    visibility:visible
  }
  .detail-topbar-title {
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:0;
    flex:1;
    min-width:0;
    overflow:hidden
  }
  .detail-order-no {
    font-size:15px;
    font-weight:700;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis
  }
  .detail-topbar .detail-customer-name,#detailCustomerName {
    display:none
  }
  .status-timeline {
    padding:24px 6px 20px 6px
  }
  .timeline-label {
    font-size:8px;
    max-width:48px
  }
  .timeline-dot {
    width:8px;
    height:8px
  }
  .timeline-line {
    top:4px
  }
  .status-actions {
    display:flex;
    flex-direction:row;
    flex-wrap:nowrap;
    gap:6px
  }
  .status-actions .cyber-btn {
    padding:6px 10px;
    font-size:11px;
    min-height:36px;
    white-space:nowrap
  }
  .cyber-card > .card-header {
    flex-wrap:wrap;
    gap:8px
  }
  .cyber-card > .card-header > div:first-child {
    flex:1;
    min-width:0
  }
  .order-info-row {
    padding:6px 10px
  }
  .order-info-row .order-info-label {
    font-size:11px
  }
  .order-info-row .order-info-value {
    font-size:13px
  }
  .order-info-row:nth-child(1) .order-info-value {
    font-size:16px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis
  }
  .order-info-row:nth-child(3) .order-info-value {
    font-size:20px
  }
  .payment-hero {
    padding:4px 0
  }
  .payment-cards {
    display:flex;
    flex-direction:column;
    gap:0;
    margin-bottom:12px;
    background:rgba(128,128,128,0.04);
    border-radius:10px;
    overflow:hidden;
    border:1px solid rgba(128,128,128,0.08)
  }
  .payment-card {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 14px;
    border-radius:0;
    border:none;
    border-bottom:1px solid rgba(128,128,128,0.08);
    background:transparent;
    margin:0
  }
  .payment-card:last-child {
    border-bottom:none
  }
  .payment-card-label {
    font-size:12px;
    margin-bottom:0;
    text-transform:none;
    letter-spacing:0
  }
  .payment-card-value {
    font-size:17px;
    font-weight:700
  }
  .payment-detail {
    gap:8px;
    padding-top:8px
  }
  .payment-row-label {
    font-size:12px
  }
  .payment-row-value {
    font-size:13px
  }
  .payment-progress-bar {
    height:6px;
    border-radius:3px
  }
  .payment-progress-fill {
    border-radius:3px
  }
  .profit-section {
    margin-top:6px
  }
  #profitToggle {
    font-size:11px;
    padding:6px 0
  }
  #detailItemsBody tr {
    display:block;
    margin-bottom:12px;
    padding:14px;
    background:var(--bg-card-flat);
    border-radius:14px;
    border:1px solid var(--border-subtle)
  }
  #detailItemsBody td {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:6px 0;
    border-bottom:1px solid rgba(128,128,128,0.06);
    font-size:13px
  }
  #detailItemsBody td:last-child {
    border-bottom:none
  }
  #detailItemsBody td::before {
    content:attr(data-label);
    font-weight:600;
    font-size:12px;
    color:var(--text-secondary);
    margin-right:12px;
    flex-shrink:0;
    min-width:40px
  }
  #detailItemsBody td:first-child {
    display:flex;
    border-bottom:2px solid var(--border-subtle);
    padding-bottom:10px;
    margin-bottom:6px
  }
  #detailItemsBody td:first-child::before {
    display:none
  }
  #detailItemsBody td[data-label="小计"] {
    background:rgba(128,128,128,0.04);
    margin:0 -14px;
    padding:8px 14px;
    border-radius:0 0 12px 12px;
    font-weight:700
  }
  #detailItemsBody td:first-child img,#detailItemsBody td:first-child .item-avatar {
    width:56px;
    height:56px
  }
  .row-delete-btn {
    width:36px;
    height:36px;
    border-radius:8px;
    font-size:16px
  }
  .detail-field {
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
    padding:8px 0
  }
  .detail-field-label {
    font-size:11px;
    color:var(--text-muted)
  }
  .detail-field-value {
    font-size:13px;
    text-align:left;
    word-break:break-all
  }
  .photo-grid {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px
  }
  .photo-item {
    position:relative;
    display:block;
    aspect-ratio:1;
    border-radius:10px;
    overflow:hidden
  }
  .photo-item img {
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:10px
  }
  .photo-thumb {
    width:100%;
    height:100%;
    border-radius:10px
  }
  .photo-delete-btn {
    opacity:1;
    width:24px;
    height:24px;
    top:4px;
    right:4px;
    font-size:16px
  }
  #photoUploadLabel {
    display:none
  }
  .mobile-photo-upload-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    width:100%;
    padding:12px;
    margin-top:10px;
    border:2px dashed var(--border-subtle);
    border-radius:12px;
    background:rgba(128,128,128,0.04);
    color:var(--text-secondary);
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    min-height:44px;
    transition:all 0.2s
  }
  .mobile-photo-upload-btn:active {
    border-color:var(--cyan-primary);
    background:rgba(6,182,212,0.08);
    color:var(--cyan-primary)
  }
  .notes-list,.log-list {
    max-height:200px;
    overflow-y:auto
  }
  .note-item {
    padding:8px 0
  }
  .note-meta {
    font-size:10px
  }
  .note-content {
    font-size:13px
  }
  .log-item {
    font-size:11px
  }
  .notes-input-bar {
    gap:8px;
    padding-top:8px
  }
  #noteInput {
    font-size:16px;
    padding:10px 12px
  }
  #noteSubmitBtn {
    padding:10px 14px;
    min-height:44px
  }
  .items-footer {
    margin-top:8px
  }
  .items-footer .cyber-btn {
    padding:12px;
    font-size:14px;
    min-height:44px
  }
  .customer-hover-card {
    max-width:calc(100vw - 32px);
    left:16px;
    right:16px
  }
  .cyber-card:active {
    transform:scale(0.995);
    transition:transform 0.1s
  }
  .detail-field-value:active,.item-price:active,.item-sizes:active {
    opacity:0.7
  }
}
@media (max-width:480px) {
  .products-grid {
    grid-template-columns:1fr
  }
  .stat-card-value {
    font-size:22px
  }
  .nav-item,.nav-create-btn {
    width:38px;
    height:38px
  }
  .nav-item svg,.nav-create-btn svg {
    width:16px;
    height:16px
  }
  .payment-card-value {
    font-size:15px
  }
  .order-info-row:nth-child(1) .order-info-value {
    font-size:16px
  }
  .order-info-row:nth-child(3) .order-info-value {
    font-size:18px
  }
  .timeline-label {
    font-size:7px
  }
  .timeline-dot {
    width:6px;
    height:6px
  }
  .timeline-line {
    top:3px
  }
  .photo-grid {
    grid-template-columns:repeat(2,1fr)
  }
  #detailItemsBody td {
    font-size:12px
  }
  #detailItemsBody td:first-child img,#detailItemsBody td:first-child .item-avatar {
    width:48px;
    height:48px
  }
  .cyber-modal #addProductImg {
    width:60px;
    height:60px
  }
  .cyber-modal [style*="grid-template-columns:repeat(3"] {
    grid-template-columns:repeat(2,1fr)
  }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration:0.01ms;
    animation-iteration-count:1;
    transition-duration:0.01ms;
    scroll-behavior:auto
  }
}
@media (max-width:768px) {
  .cyber-modal {
    max-width:calc(100vw - 24px);
    max-height:90vh;
    overflow-y:auto
  }
  .cyber-modal > div[style*="display:flex"] {
    flex-direction:column
  }
  .cyber-modal #addProductImg {
    width:100%;
    height:120px;
    margin:0 auto
  }
  #editPopupOverlay .cyber-modal {
    max-width:calc(100vw - 24px)
  }
  #editPopupOverlay .cyber-input {
    font-size:16px
  }
  .color-tag-btn {
    padding:6px 14px;
    font-size:13px;
    min-height:36px
  }
  .cyber-modal input[type="text"],.cyber-modal input[type="number"],.cyber-modal input[type="search"],.cyber-modal textarea {
    font-size:16px
  }
  .products-new-grid {
    grid-template-columns:1fr;
    gap:16px
  }
  .left-column,.right-column {
    order:unset
  }
  .left-combined-card .left-card-section {
    padding:0 12px 12px 12px
  }
  .left-combined-card .left-card-section:first-child {
    margin-bottom:16px
  }
  .upload-area {
    min-height:180px;
    padding:32px 16px
  }
  .color-item {
    grid-template-columns:1fr;
    padding:12px
  }
  .color-content {
    gap:10px
  }
  .color-item-header {
    flex-wrap:wrap;
    gap:8px
  }
  .color-item-title {
    width:100%;
    font-size:14px
  }
  .color-inputs-row {
    width:100%;
    flex-wrap:wrap;
    gap:8px
  }
  .color-name-input {
    width:100%;
    height:40px
  }
  .sell-price-input,.cost-price-input {
    width:calc(50% - 4px);
    height:40px
  }
  .color-remove-btn {
    position:static;
    width:100%;
    margin-top:8px
  }
  .size-selector {
    justify-content:flex-start;
    flex-wrap:wrap
  }
  .size-label {
    padding:6px 10px;
    font-size:12px;
    min-width:36px;
    text-align:center
  }
  .color-image-upload {
    grid-column:1;
    grid-row:auto;
    min-height:120px;
    margin-top:8px
  }
  .add-color-btn {
    padding:12px;
    font-size:14px
  }
  .form-actions {
    padding:12px;
    gap:8px
  }
  .form-actions .cyber-btn {
    flex:1;
    justify-content:center
  }
}
@media (min-width:769px) {
  .detail-grid-2col {
    grid-template-columns:1fr 2fr;
    gap:20px
  }
  .detail-grid-2col[style] {
    grid-template-columns:1fr 2fr
  }
}
@media (min-width:769px) {
  html {
    overflow-y:scroll
  }
}
@media (min-width:769px) {
  .cyber-table thead {
    display:table-header-group !important
  }
  .cyber-table tbody {
    display:table-row-group
  }
  .cyber-table tr {
    display:table-row
  }
  .cyber-table td {
    display:table-cell
  }
}
