/* ============================================
   主样式文件 - 淡蓝色主题，卡片式设计，动画效果
   ============================================ */

/* 全局变量 */
:root {
    --primary-color: #4A90E2;
    --primary-light: #6BA3E8;
    --primary-dark: #357ABD;
    --secondary-color: #E8F4FD;
    --accent-color: #5FB878;
    --danger-color: #FF5722;
    --warning-color: #FFB800;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-primary: #F5F9FC;
    --bg-white: #FFFFFF;
    --border-color: #E0E8EF;
    --shadow-sm: 0 2px 8px rgba(74, 144, 226, 0.08);
    --shadow-md: 0 4px 16px rgba(74, 144, 226, 0.12);
    --shadow-lg: 0 8px 24px rgba(74, 144, 226, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #F5F9FC 0%, #E8F4FD 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* 页面容器 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1px 20px 20px 20px;
    animation: fadeIn 0.6s ease-out;
}

/* 头部样式 */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 20px 0;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: fadeInDown 0.5s ease-out;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: fadeInLeft 0.6s ease-out;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    animation: fadeInRight 0.6s ease-out;
}

/* 卡片样式 */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-body {
    color: var(--text-secondary);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
    vertical-align: middle;
    line-height: 1.5;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-color), #6BC589);
    color: white;
    box-shadow: 0 4px 12px rgba(95, 184, 120, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(95, 184, 120, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.form-input:hover {
    border-color: var(--primary-light);
}

/* 表格样式 */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--secondary-color);
    transform: scale(1.01);
}

.table td {
    padding: 16px;
    color: var(--text-secondary);
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    animation: scaleIn 0.3s ease-out;
}

.badge-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.badge-success {
    background: #E8F8F0;
    color: var(--accent-color);
}

.badge-warning {
    background: #FFF8E8;
    color: var(--warning-color);
}

.badge-danger {
    background: #FFE8E0;
    color: var(--danger-color);
}

/* 价格样式 */
.price {
    color: var(--danger-color);
    font-size: 24px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.price-small {
    font-size: 18px;
}

/* 通知框样式 */
.notice {
    background: linear-gradient(135deg, #FFF8E8, #FFF4D6);
    border-left: 4px solid var(--warning-color);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
    animation: slideInRight 0.5s ease-out;
    box-shadow: var(--shadow-sm);
}

.notice-info {
    background: linear-gradient(135deg, var(--secondary-color), #E0F0FF);
    border-left-color: var(--primary-color);
}

.notice-success {
    background: linear-gradient(135deg, #E8F8F0, #D4F4E0);
    border-left-color: var(--accent-color);
}

/* 公告滚动样式 */
.notice-scroll-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.notice-scroll-content {
    display: inline-flex;
    white-space: nowrap;
    animation: scroll-notice 30s linear infinite;
}

.notice-scroll-content:hover {
    animation-play-state: paused;
}

.notice-item {
    display: inline-block;
    padding-right: 100px;
    white-space: nowrap;
}

@keyframes scroll-notice {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    margin-top: 60px;
    animation: fadeIn 0.8s ease-out;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-container {
        padding: 1px 15px 15px 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .product-card-image {
        height: 120px;
    }
    
    .product-image-placeholder {
        font-size: 40px;
    }
    
    .product-card-body {
        padding: 10px;
    }
    
    .product-name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .price-main {
        font-size: 18px;
    }
    
    .product-stock {
        font-size: 11px;
    }
    
    .product-tag {
        padding: 4px 10px;
        font-size: 11px;
        border-width: 1px;
    }
}

/* 手机竖屏：固定2列，不要太窄 */
@media (max-width: 768px) and (orientation: portrait) {
    .page-container {
        padding: 1px 10px 10px 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        justify-items: stretch;
    }
    
    .product-card {
        width: 100%;
        max-width: 100%;
    }
    
    .product-card-image {
        height: 120px;
    }
    
    .product-image-placeholder {
        font-size: 36px;
    }
    
    .product-card-body {
        padding: 10px;
    }
    
    .product-name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .price-main {
        font-size: 18px;
    }
    
    .product-stock {
        font-size: 11px;
    }
}

/* 小手机竖屏：固定2列 */
@media (max-width: 480px) and (orientation: portrait) {
    .page-container {
        padding: 1px 10px 10px 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .product-card-image {
        height: 100px;
    }
    
    .product-image-placeholder {
        font-size: 32px;
    }
    
    .product-card-body {
        padding: 8px;
    }
    
    .product-name {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .price-main {
        font-size: 16px;
    }
    
    .product-stock {
        font-size: 10px;
    }
}

/* 手机横屏：可以显示3列 */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .page-container {
        padding: 1px 12px 12px 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
        justify-items: stretch;
    }
    
    .product-card {
        width: 100%;
        max-width: 100%;
    }
    
    .product-card-image {
        height: 120px;
    }
    
    /* 手机横屏时隐藏左侧大图片 */
    .product-image-section {
        display: none;
    }
}

/* 平板：可以显示3-4列 */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 14px;
        justify-items: stretch;
    }
    
    .product-card {
        width: 100%;
        max-width: 100%;
    }
    
    .product-card-image {
        height: 130px;
    }
}

/* 导航样式 */
.nav {
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeInDown 0.5s ease-out;
    border: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    font-size: 14px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--bg-primary);
    font-weight: 600;
}

.nav-link.active::after {
    transform: scaleX(1);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1), transparent);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.stat-title {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
}

.stat-value {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 产品卡片网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 0;
    justify-items: start;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    isolation: isolate;
}

.product-card.out-of-stock {
    opacity: 0.7;
}

.product-card::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0.5) 60%, transparent 100%);
    box-shadow: 
        0 0 6px rgba(255, 255, 255, 1),
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 18px rgba(255, 255, 255, 0.6);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transform: translate(-50%, -50%);
}

.product-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-md);
    background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    opacity: 0;
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
    padding: 1px;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.product-card:hover,
.product-card:active {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    border-color: transparent;
    background: radial-gradient(circle at center, rgba(74, 144, 226, 0.05), var(--bg-white));
}

.product-card:hover::after,
.product-card:active::after {
    opacity: 1;
}

.product-card:hover::before,
.product-card:active::before {
    opacity: 1;
    animation: rainbow-run 1s linear infinite;
}

@keyframes rainbow-run {
    0% {
        top: -1px;
        left: 0%;
    }
    24% {
        top: -1px;
        left: 100%;
    }
    25% {
        top: -1px;
        left: 100%;
    }
    49% {
        top: 100%;
        left: 100%;
    }
    50% {
        top: 100%;
        left: 100%;
    }
    74% {
        top: 100%;
        left: 0%;
    }
    75% {
        top: 100%;
        left: 0%;
    }
    99% {
        top: -1px;
        left: 0%;
    }
    100% {
        top: -1px;
        left: 0%;
    }
}

.product-tag {
    position: absolute;
    z-index: 10;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    top: 8px;
    left: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1.5px solid #D4AF37;
    letter-spacing: 0.5px;
}

.tag-auto {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tag-manual {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tag-out {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.product-card-image {
    width: 100%;
    height: 140px;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--secondary-color), #E0F0FF);
}

.product-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    position: relative;
    z-index: 1;
    background: var(--bg-white);
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.price-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.price-main {
    color: var(--danger-color);
    font-size: 20px;
    font-weight: 700;
}

.price-wholesale {
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--secondary-color);
    padding: 2px 8px;
    border-radius: 4px;
}

.product-stock {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-left: auto;
}

.stock-label {
    color: var(--text-secondary);
    margin-right: 6px;
}

.stock-value {
    font-weight: 600;
}

.stock-value.in-stock {
    color: var(--accent-color);
}

.stock-value.out-stock {
    color: var(--danger-color);
}


/* 工具类 */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--accent-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

/* ============================================
   商品详情页样式
   ============================================ */

.product-detail-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 20px 20px 20px;
}

/* 商品主信息区域：左右布局 */
.product-main-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

/* 左侧：商品图片 - PC端大图 */
.product-image-section {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-shrink: 0;
}

.product-image-container {
    width: 500px; /* PC端大图增大到500px */
    min-width: 500px;
    max-width: 500px;
    height: auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    position: relative;
}

.product-image-container.product-image-placeholder {
    background: linear-gradient(135deg, #F5F9FC 0%, #E8F4FD 100%);
    aspect-ratio: 1;
    min-height: 500px; /* 与宽度保持一致 */
}

.product-main-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.placeholder-icon {
    font-size: 120px;
    opacity: 0.3;
}

/* 右侧：商品信息和购买表单 */
.product-info-section {
    display: flex;
    flex-direction: column;
}

/* 商品标题和价格区域包装器（包含左侧图片） */
.product-title-price-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 25px;
}

/* 商品标题左侧图片 - PC端隐藏，手机端显示 */
.product-title-image {
    display: none; /* PC端默认隐藏 */
    flex-shrink: 0;
}

.product-title-img {
    width: 120px;
    height: auto;
    max-height: 200px; /* 限制最大高度，防止超出价格区域的分割线 */
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    align-self: flex-start;
}

.product-title-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F5F9FC 0%, #E8F4FD 100%);
}

.placeholder-icon-small {
    font-size: 48px;
    opacity: 0.3;
}

/* 商品标题和价格内容区域 */
.product-title-price-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    margin-top: 0;
    line-height: 1.4;
}

/* 商品标签信息 */
.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.meta-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

/* 价格区域 - 分割线延伸到最左侧 */
.product-price-section {
    margin-bottom: 25px;
    margin-left: calc(-30px - 20px); /* 延伸到product-detail-wrapper的最左侧 */
    margin-right: calc(-30px - 20px);
    padding-left: calc(30px + 20px);
    padding-right: calc(30px + 20px);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}


.price-main {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 12px;
}

.price-original {
    font-size: 18px;
    color: var(--text-light);
    text-decoration: line-through;
}

/* 表单样式 */
.product-info-section .form-group {
    margin-bottom: 20px;
}

/* 包含输入框的表单组：标签和输入框在同一行 */
.product-info-section .form-group:has(.form-input) {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 包含支付方式的表单组：水平布局（标签和选项在同一行） */
.product-info-section .form-group:has(.payment-methods) {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-info-section .form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 输入框表单组的标签：在同一行 */
.product-info-section .form-group:has(.form-input) .form-label {
    display: inline-block;
    margin-bottom: 0;
    width: 100px;
    text-align: right;
}

/* 支付方式表单组的标签：在同一行，不换行，与上方文字对齐 */
.product-info-section .form-group:has(.payment-methods) .form-label {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 0;
    width: 100px;
    text-align: right;
}

.product-info-section .required {
    color: var(--danger-color);
}

.product-info-section .form-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-white);
    min-width: 0;
}

.product-info-section .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 优惠码输入框成功状态 */
.product-info-section .form-input[readonly] {
    background-color: #e8f5e9;
    border-color: #4caf50;
    cursor: not-allowed;
}

/* 支付方式 */
.payment-methods {
    display: flex;
    flex-wrap: nowrap; /* 不换行，在同一行显示 */
    gap: 12px;
    flex: 1; /* 占据剩余空间 */
}

.payment-method-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-white);
    flex: 1;
    min-width: 150px;
    position: relative;
}

.payment-method-item:hover {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

.payment-method-item input[type="radio"]:checked ~ .payment-logo,
.payment-method-item input[type="radio"]:checked ~ .payment-method-name {
    opacity: 1;
}

.payment-method-item:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

.payment-method-item input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.payment-method-item input[type="radio"]:checked ~ .payment-method-name {
    color: var(--primary-color);
    font-weight: 600;
}

.payment-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
}

.payment-logo-alipay {
    color: #1677FF;
}

.payment-logo-wechat {
    color: #07C160;
}

.payment-method-name {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap; /* 确保文字横排，不换行 */
}

/* 支付宝支付方式选择框：宽度自适应文字内容 */
.payment-method-item:has(.payment-logo-alipay) {
    flex: 0 0 auto;
    width: auto;
    min-width: auto;
    max-width: none;
}

/* 支付宝按钮内的文字不拉伸，保持自然宽度 */
.payment-method-item:has(.payment-logo-alipay) .payment-method-name {
    flex: 0 0 auto;
}

/* 数量选择和下单按钮 */
.order-action-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    margin-left: -30px; /* 延伸到卡片左边缘 */
    margin-right: -30px; /* 延伸到卡片右边缘 */
    padding-top: 20px;
    padding-left: 30px; /* 保持内容不偏移 */
    padding-right: 30px; /* 保持内容不偏移 */
    border-top: 1px solid var(--border-color);
    box-sizing: border-box;
    min-width: 0; /* 允许容器收缩 */
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-white);
    flex-shrink: 0; /* 防止数量选择器被压缩 */
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-primary);
    padding: 0;
}

.quantity-input:focus {
    outline: none;
}

.btn-order {
    flex: 1;
    min-width: 0; /* 允许按钮收缩，防止超出容器 */
    height: 50px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    box-sizing: border-box;
}

.btn-order:hover {
    background: linear-gradient(135deg, #357ABD 0%, #2A6BA0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-order:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.btn-order .order-amount {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-order .order-amount::after {
    content: '';
    display: inline-block;
    width: 8px;
}

.btn-order .order-text {
    font-size: 16px;
}

/* 提示信息 */
.order-tips {
    margin-top: 15px;
    margin-left: -30px; /* 延伸到卡片左边缘 */
    margin-right: -30px; /* 延伸到卡片右边缘 */
    padding: 12px 30px; /* 保持内容不偏移，左右padding为30px */
    padding-top: 15px;
    padding-bottom: 15px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color); /* 下分割线 */
    border-radius: 0; /* 移除圆角，因为延伸到边缘 */
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.order-tips p {
    margin: 0;
}

/* 商品说明区域：下方独立框框 */
.product-description-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    overflow: hidden;
}

.description-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.description-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.description-content {
    padding: 30px;
    color: var(--text-secondary);
    line-height: 1.8;
    word-wrap: break-word;
}

.description-content p {
    margin: 0 0 12px 0;
}

.description-content p:last-child {
    margin-bottom: 0;
}

.description-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: var(--radius-sm);
}

/* 响应式设计 - 平板端（768px-968px） */
@media (max-width: 968px) and (min-width: 769px) {
    .product-main-section {
        grid-template-columns: auto 1fr;
        gap: 15px;
        padding: 20px;
        align-items: start;
    }
    
    /* 平板端仍然显示大图，但稍微缩小 */
    .product-image-container {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
    }
    
    .product-image-container.product-image-placeholder {
        min-height: 400px;
    }
    
    /* 平板端隐藏标题区域的小图 */
    .product-title-image {
        display: none;
    }
    
    .product-title-price-wrapper {
        gap: 12px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .price-main {
        font-size: 28px;
        line-height: 1.2;
    }
    
    /* 价格区域分割线延伸到最左侧 */
    .product-price-section {
        margin-left: calc(-20px - 20px); /* 延伸到product-detail-wrapper的最左侧 */
        margin-right: calc(-20px - 20px);
        padding-left: calc(20px + 20px);
        padding-right: calc(20px + 20px);
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 表单区域延伸到最左侧，减少左侧空白 */
    .product-info-section {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 0;
        padding-right: 0;
    }
    
    /* 减少输入框标签和输入框之间的间距 */
    .product-info-section .form-group:has(.form-input) {
        gap: 10px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* 支付方式区域也延伸到最左侧 */
    .product-info-section .form-group:has(.payment-methods) {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* 数量选择和下单按钮区域延伸到最左侧 */
    .order-action-bar {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .order-action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
    
    .btn-order {
        width: 100%;
        height: 56px;
        font-size: 18px;
    }
    
    .btn-order .order-amount {
        font-size: 20px;
        font-weight: 700;
    }
    
    .btn-order .order-text {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .product-detail-wrapper {
        padding: 4px 10px 10px 10px;
    }
    
    .product-main-section {
        grid-template-columns: 1fr; /* 手机端改为单列布局，因为隐藏了左侧大图 */
        gap: 12px;
        padding: 15px;
        align-items: start;
    }
    
    /* 手机端隐藏左侧大图区域 */
    .product-image-section {
        display: none;
    }
    
    .product-title-price-wrapper {
        gap: 20px; /* 增加图片和文字之间的间距 */
    }
    
    /* 手机端显示标题区域的小图 */
    .product-title-image {
        display: block;
    }
    
    .product-title-img {
        width: 180px; /* 增大图片尺寸 */
        max-height: 240px; /* 相应增加最大高度 */
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .price-main {
        font-size: 24px;
        line-height: 1.2;
    }
    
    /* 价格区域延伸到屏幕最左侧（手机端专用方案） */
    .product-price-section {
        margin-left: calc(-15px - 10px - 10px); /* 延伸到屏幕最左侧：减去product-main-section的padding、product-detail-wrapper的padding-left，再减去10px到屏幕边缘 */
        margin-right: calc(-15px - 10px - 10px);
        padding-left: calc(15px + 10px + 10px);
        padding-right: calc(15px + 10px + 10px);
        padding-bottom: 8px; /* 减少底部间距，让表单区域更靠近价格 */
        border-bottom: none; /* 移除分割线 */
    }
    
    /* 表单区域延伸到最左侧，减少左侧空白 */
    .product-info-section {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 0;
        padding-right: 0;
    }
    
    /* 减少输入框标签和输入框之间的间距 */
    .product-info-section .form-group:has(.form-input) {
        gap: 8px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 邮箱输入框（第一个表单组）距离单价更近 */
    .product-info-section .form-group:has(.form-input):first-of-type {
        margin-top: 0;
    }
    
    /* 减少标签宽度，让输入框更靠左 */
    .product-info-section .form-label {
        width: 70px;
        min-width: 70px;
        font-size: 13px;
        text-align: right;
    }
    
    /* 支付方式区域也延伸到最左侧 */
    .product-info-section .form-group:has(.payment-methods) {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 数量选择和下单按钮区域延伸到最左侧 */
    .order-action-bar {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
        gap: 10px; /* 手机端减少间距，防止超出 */
    }
    
    /* 手机端数量选择器稍微缩小 */
    .quantity-selector {
        flex-shrink: 0;
    }
    
    /* 手机端按钮文字可能需要缩小 */
    .btn-order {
        font-size: 18px;
        padding: 0 10px;
    }
    
    /* 提示信息区域延伸到最左侧，添加下分割线 */
    .order-tips {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .description-header,
    .description-content {
        padding: 15px;
    }
    
    .description-content img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 10px 0;
    }
    
    /* 手机端支付选项可以换行，但保持在同一行尽量不换行 */
    .payment-methods {
        flex-wrap: wrap;
    }
    
    .payment-method-item {
        min-width: calc(50% - 6px); /* 两个选项一行，减去gap的一半 */
        flex: 0 1 auto;
    }
    
    .btn-order {
        height: 60px;
        font-size: 20px;
    }
    
    .btn-order .order-amount {
        font-size: 22px;
        font-weight: 700;
    }
    
    .btn-order .order-text {
        font-size: 20px;
    }
}

/* 小手机屏幕：进一步缩小图片 */
@media (max-width: 480px) {
    .product-main-section {
        grid-template-columns: 1fr; /* 小手机端也是单列布局 */
        gap: 10px;
        padding: 12px;
        align-items: start;
    }
    
    /* 小手机端仍然隐藏左侧大图 */
    .product-image-section {
        display: none;
    }
    
    /* 小手机端显示标题区域的小图，但稍微缩小 */
    .product-title-image {
        display: block;
    }
    
    .product-title-img {
        width: 150px; /* 增大图片尺寸 */
        max-height: 200px; /* 相应增加最大高度 */
    }
    
    .product-title-price-wrapper {
        gap: 16px; /* 增加图片和文字之间的间距 */
    }
    
    /* 价格区域延伸到屏幕最左侧（小手机端专用方案） */
    .product-price-section {
        margin-left: calc(-12px - 10px - 10px); /* 延伸到屏幕最左侧：减去product-main-section的padding、product-detail-wrapper的padding-left，再减去10px到屏幕边缘 */
        margin-right: calc(-12px - 10px - 10px);
        padding-left: calc(12px + 10px + 10px);
        padding-right: calc(12px + 10px + 10px);
        padding-bottom: 8px; /* 减少底部间距，让表单区域更靠近价格 */
        border-bottom: none; /* 移除分割线 */
    }
    
    /* 表单区域延伸到最左侧，减少左侧空白 */
    .product-info-section {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 0;
        padding-right: 0;
    }
    
    /* 减少输入框标签和输入框之间的间距 */
    .product-info-section .form-group:has(.form-input) {
        gap: 6px;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* 邮箱输入框（第一个表单组）距离单价更近 */
    .product-info-section .form-group:has(.form-input):first-of-type {
        margin-top: 0;
    }
    
    /* 减少标签宽度，让输入框更靠左 */
    .product-info-section .form-label {
        width: 65px;
        min-width: 65px;
        font-size: 12px;
        text-align: right;
    }
    
    /* 支付方式区域也延伸到最左侧 */
    .product-info-section .form-group:has(.payment-methods) {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* 数量选择和下单按钮区域延伸到最左侧 */
    .order-action-bar {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* 提示信息区域延伸到最左侧，添加下分割线 */
    .order-tips {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
    }
}




