/* ===== 商品介绍（购买）页 ===== */

.product-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

.product-main {
    min-width: 0;
}

/* 面包屑 */
.breadcrumb {
    margin-bottom: 1.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #2c5282;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
}

/* ===== 左侧：商品概览 ===== */
.goods-overview {
    display: flex;
    gap: 1.5rem;
    background: #ffffff;
    padding: 1.5rem 0 2rem;
}

.goods-cover {
    position: relative;
    flex-shrink: 0;
    width: 132px;
    height: 132px;
    border: 1px solid #d9dee3;
    border-radius: 4px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0392b;
}

.goods-cover svg {
    width: 64px;
    height: 64px;
}

.goods-cover-tag {
    position: absolute;
    left: 0;
    bottom: 0;
    background: #c0392b;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 0 0 0 3px;
}

.goods-head {
    flex: 1;
    min-width: 0;
}

.goods-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.goods-current {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #38a169;
}

.goods-current svg {
    width: 16px;
    height: 16px;
}

.goods-subtitle {
    color: #1f2937;
    font-size: 1.02rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.goods-meta {
    margin: 0;
}

.goods-meta-row {
    display: flex;
    align-items: baseline;
    padding: 0.35rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.goods-meta-row dt {
    width: 150px;
    flex-shrink: 0;
    color: #4a5568;
    font-weight: 600;
}

.goods-meta-row dd {
    margin: 0;
    color: #1f2937;
}

.goods-publisher {
    color: #2b6cb0;
}

/* ===== 左侧：章节 ===== */
.goods-section {
    padding: 1.25rem 0 1.75rem;
    border-top: 1px solid #e2e8f0;
}

.goods-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #111827;
}

.goods-section-body p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0 0 0.75rem;
}

.goods-section-body p:last-child {
    margin-bottom: 0;
}

/* 通用商品信息表（斑马纹） */
.goods-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.goods-info-table th,
.goods-info-table td {
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
    line-height: 1.5;
}

.goods-info-table th {
    width: 220px;
    background: #f1f4f7;
    color: #4a5568;
    font-weight: 600;
}

.goods-info-table td {
    background: #ffffff;
    color: #1f2937;
}

.goods-info-table tr:nth-child(even) td {
    background: #fafbfc;
}

/* ===== 右侧：订单面板 ===== */
.product-side {
    position: sticky;
    top: 1rem;
}

.order-panel {
    background: #f6f7f9;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    padding: 1.25rem;
}

.panel-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.panel-price-label {
    color: #718096;
    font-size: 0.9rem;
}

.panel-price-value {
    color: #2b9cf2;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.panel-form-group {
    margin-bottom: 1rem;
}

.panel-form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.panel-form-group select,
.panel-form-group input[type="email"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: #ffffff;
    color: #2d3748;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.panel-form-group select:focus,
.panel-form-group input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

/* 数量控制 */
.qty-control {
    display: flex;
    align-items: stretch;
}

.qty-btn {
    width: 42px;
    height: 40px;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #2c5282;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.qty-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.qty-btn:hover {
    background: #edf2f7;
}

.qty-control input {
    width: 60px;
    height: 40px;
    border: 1px solid #cbd5e0;
    border-left: none;
    border-right: none;
    border-radius: 0;
    text-align: center;
    font-size: 1rem;
    color: #2d3748;
    background: #ffffff;
    box-sizing: border-box;
}

/* 金额汇总 */
.panel-summary {
    padding: 0.25rem 0 0.85rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid #d9dee3;
}

.panel-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.panel-summary-total {
    border-top: 1px solid #d9dee3;
    margin-top: 0.3rem;
    padding-top: 0.7rem;
    font-weight: 700;
    color: #111827;
    font-size: 1.05rem;
}

.panel-summary-total span:last-child {
    color: #c53030;
    font-size: 1.25rem;
}

/* 许可协议 */
.panel-agree {
    margin-bottom: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: #4a5568;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-label a {
    color: #2b6cb0;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* 错误提示 */
.panel-error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 3px solid #e53e3e;
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: none;
}

/* 两个结算按钮 */
.btn-guest-checkout,
.btn-login-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-guest-checkout {
    background: #f5b400;
    color: #1f2937;
    border: 1px solid #e0a400;
    box-shadow: 0 2px 6px rgba(245, 180, 0, 0.3);
}

.btn-guest-checkout:hover {
    background: #e0a400;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 180, 0, 0.4);
}

.btn-login-checkout {
    margin-top: 0.6rem;
    background: #ffffff;
    color: #2c5282;
    border: 1px solid #2c5282;
}

.btn-login-checkout:hover {
    background: #ebf3fb;
    transform: translateY(-1px);
}

/* ===== 登录弹窗 ===== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal-overlay.show {
    display: flex;
}

.auth-modal {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
}

.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
}

.auth-modal-close:hover {
    color: #4a5568;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 1.25rem;
    text-align: center;
}

.auth-tip {
    font-size: 0.88rem;
    color: #718096;
    line-height: 1.6;
    margin: -0.5rem 0 1rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.auth-field input {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.btn-auth-submit {
    width: 100%;
    background: linear-gradient(135deg, #2c5282 0%, #2b6cb0 100%);
    color: #ffffff;
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.35);
}

.btn-auth-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.auth-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 3px solid #e53e3e;
    color: #c53030;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

/* 注册时的协议勾选 */
.auth-agree {
    margin-bottom: 1rem;
}

.auth-agree .checkbox-label {
    font-size: 0.85rem;
    color: #4a5568;
}

.auth-agree .checkbox-label a {
    color: #2b6cb0;
    text-decoration: none;
}

.auth-agree .checkbox-label a:hover {
    text-decoration: underline;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.auth-links a {
    color: #2b6cb0;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .product-layout {
        grid-template-columns: 1fr;
    }

    .product-side {
        position: static;
        order: -1;
    }

    .goods-overview {
        flex-direction: column;
    }

    .goods-cover {
        width: 100px;
        height: 100px;
    }

    .goods-meta-row dt {
        width: 120px;
    }

    .goods-info-table th {
        width: 130px;
        padding: 0.6rem 0.85rem;
    }

    .goods-info-table td {
        padding: 0.6rem 0.85rem;
    }
}
