/* ============================================================
   PRICE QUERY PAGE - 价格查询页面
   遵循 UI设计规范标准.md
   主色：帝王紫 #5D3FD3
   ============================================================ */

:root {
    --purple:       #5D3FD3;
    --purple-dark:  #4A2FB8;
    --purple-light: #7B61FF;
    --purple-pale:  #f0edff;
    --gold:         #D4A017;
    --gold-light:   #F5C842;
    --green:        #22C55E;
    --red:          #EF4444;
    --gray-bg:      #f4f6fb;
    --gray-border:  #e8e8f0;
    --text-dark:    #1a1a2e;
    --text-mid:     #4a4a6a;
    --text-light:   #8888aa;
    --shadow-sm:    0 2px 8px rgba(93,63,211,0.08);
    --shadow-md:    0 6px 24px rgba(93,63,211,0.12);
    --shadow-lg:    0 16px 48px rgba(93,63,211,0.18);
    --radius:       16px;
    --radius-sm:    10px;
    --radius-xs:    6px;
}

/* ============================================================
   PAGE CONTAINER
   ============================================================ */
.page-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}
@media (max-width: 768px) {
    .page-container { padding: 0 20px; }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.pq-hero {
    background: linear-gradient(135deg, #2D1B8B 0%, #5D3FD3 50%, #7B5FE5 100%);
    padding: 72px 0 60px;
    position: relative;
    overflow: hidden;
}

.pq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.pq-hero-inner {
    position: relative;
    text-align: center;
}

.pq-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.pq-hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.pq-hero-title span {
    color: var(--gold-light);
}

.pq-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 32px;
}

.pq-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.pq-hero-stat {
    text-align: center;
}

.pq-hero-stat .stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold-light);
    display: block;
}

.pq-hero-stat .stat-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
}

@media (max-width: 768px) {
    .pq-hero { padding: 52px 0 44px; }
    .pq-hero-title { font-size: 2rem; }
    .pq-hero-stats { gap: 24px; }
}

/* ============================================================
   MAIN SECTION
   ============================================================ */
.pq-main-section {
    background: var(--gray-bg);
    padding: 60px 0 80px;
}

.pq-main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 1100px) {
    .pq-main-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LEFT COLUMN – FORM + RESULTS
   ============================================================ */

/* ---- Form Card ---- */
.pq-form-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-border);
    margin-bottom: 24px;
}

.pq-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--purple-pale);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pq-card-title i {
    color: var(--purple);
    font-size: 1rem;
}

/* Form rows */
.pq-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.pq-form-row:last-child { margin-bottom: 0; }

.pq-form-row label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-mid);
}

.pq-select, .pq-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.pq-select:focus, .pq-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(93,63,211,0.08);
}

/* Number input row (prefix + number) */
.pq-number-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.pq-prefix-input {
    width: 80px;
    flex-shrink: 0;
    padding: 11px 10px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    color: var(--purple);
    font-weight: 700;
    text-align: center;
    background: var(--purple-pale);
    transition: border-color 0.2s;
    font-family: inherit;
}

.pq-prefix-input:focus {
    outline: none;
    border-color: var(--purple);
}

.pq-number-input {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.pq-number-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(93,63,211,0.08);
}

/* Quantity row */
.pq-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pq-qty-input {
    width: 100px;
    padding: 11px 14px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.pq-qty-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(93,63,211,0.08);
}

.pq-qty-unit {
    font-size: 0.9rem;
    color: var(--text-mid);
    font-weight: 600;
}

.pq-qty-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-left: 4px;
}

/* Grade toggle */
.pq-grade-options {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.pq-grade-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    user-select: none;
}

.pq-grade-option:hover {
    border-color: var(--purple);
    background: var(--purple-pale);
}

.pq-grade-option.active {
    border-color: var(--purple);
    background: var(--purple-pale);
}

.pq-radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--gray-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pq-grade-option.active .pq-radio-dot {
    border-color: var(--purple);
    background: var(--purple);
}

.pq-grade-option.active .pq-radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.pq-grade-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Grade detail (agency + score) */
.pq-grade-detail {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    background: var(--purple-pale);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(93,63,211,0.15);
    margin-top: 4px;
}

.pq-grade-detail.show { display: grid; }

.pq-detail-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 5px;
    display: block;
}

/* Action buttons */
.pq-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.pq-btn-type {
    flex: 1;
    padding: 13px;
    background: #fff;
    color: var(--purple);
    border: 2px solid var(--purple);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.pq-btn-type:hover {
    background: var(--purple-pale);
    transform: translateY(-1px);
}

.pq-btn-estimate {
    flex: 1;
    padding: 13px;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(93,63,211,0.3);
    font-family: inherit;
}

.pq-btn-estimate:hover {
    box-shadow: 0 8px 24px rgba(93,63,211,0.4);
    transform: translateY(-2px);
}

.pq-btn-type:disabled, .pq-btn-estimate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Loading indicator ---- */
.pq-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--purple);
    font-size: 0.9rem;
    font-weight: 600;
}

.pq-loading.show { display: block; }

.pq-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--purple-pale);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: pqSpin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes pqSpin {
    to { transform: rotate(360deg); }
}

/* ---- Login prompt ---- */
.pq-login-prompt {
    display: none;
    background: var(--purple-pale);
    border: 1px solid rgba(93,63,211,0.2);
    border-radius: var(--radius-xs);
    padding: 14px 18px;
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-mid);
}

.pq-login-prompt.show { display: block; }

.pq-login-link {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
}

.pq-login-link:hover { text-decoration: underline; }

/* ---- Result Card ---- */
.pq-result-card {
    display: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-border);
    margin-bottom: 24px;
}

.pq-result-card.show { display: block; }

.pq-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pq-result-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pq-result-title i { color: var(--purple); }

.pq-result-summary {
    font-size: 0.88rem;
    color: var(--text-mid);
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--purple-pale);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--purple);
}

/* Result table */
.pq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pq-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 700;
    color: var(--text-mid);
    border-bottom: 2px solid var(--gray-border);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pq-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0eef8;
    color: var(--text-dark);
    vertical-align: middle;
}

.pq-table tr:last-child td { border-bottom: none; }

.pq-table tr:nth-child(even) td { background: #fafafe; }

.pq-table tr.total-row td {
    font-weight: 800;
    border-top: 2px solid var(--gray-border);
    background: var(--purple-pale) !important;
}

.td-number {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--purple);
    font-weight: 700;
}

.td-type {
    color: var(--text-mid);
}

.td-price {
    font-weight: 800;
    color: #e67e00;
    text-align: right;
    white-space: nowrap;
}

.pq-result-footer {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Pay notice ---- */
.pq-pay-notice {
    display: none;
    background: #fff9ed;
    border: 1px solid #f5c842;
    border-radius: var(--radius-xs);
    padding: 16px 18px;
    margin-top: 12px;
    font-size: 0.88rem;
    color: #7a5500;
}

.pq-pay-notice.show { display: block; }

.pq-pay-notice strong { color: var(--gold); }

/* ============================================================
   RIGHT COLUMN – HISTORY CASES
   ============================================================ */
.pq-cases-panel {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-border);
    position: sticky;
    top: 24px;
}

.pq-cases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--purple) 0%, #7c5ce7 100%);
    color: #fff;
}

.pq-cases-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pq-cases-icon {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pq-cases-title {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
}

.pq-cases-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.72);
    margin-top: 2px;
}

.pq-cases-more {
    color: rgba(255,255,255,0.85);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    white-space: nowrap;
    transition: background 0.2s;
}

.pq-cases-more:hover { background: rgba(255,255,255,0.28); color: #fff; }

/* Case items */
.pq-cases-list {
    max-height: 620px;
    overflow-y: auto;
}

.pq-case-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0eef8;
    transition: background 0.15s;
}

.pq-case-item:last-child { border-bottom: none; }
.pq-case-item:hover { background: #faf9ff; }

.pq-case-bar {
    width: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--purple), #a78bfa);
    border-radius: 0 3px 3px 0;
}

.pq-case-body {
    flex: 1;
    min-width: 0;
    padding: 12px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pq-case-row1 {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}

.pq-case-number {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--purple);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.pq-case-desc {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.pq-case-row2 {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pq-case-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--purple);
    background: rgba(93,63,211,0.08);
    border: 1px solid rgba(93,63,211,0.18);
    border-radius: 3px;
    padding: 1px 6px;
}

.pq-case-row3 {
    display: flex;
    align-items: center;
}

.pq-case-time {
    font-size: 0.72rem;
    color: #b0a8c8;
    display: flex;
    align-items: center;
    gap: 3px;
}

.pq-case-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 16px 12px 8px;
    gap: 2px;
    flex-shrink: 0;
}

.pq-case-price-label {
    font-size: 0.7rem;
    color: #b0a8c8;
    white-space: nowrap;
}

.pq-case-price {
    font-size: 1rem;
    font-weight: 900;
    color: #e67e00;
    white-space: nowrap;
}

/* Cases footer */
.pq-cases-footer {
    padding: 10px 18px;
    background: #f8f7ff;
    border-top: 1px solid #ebe8f8;
    font-size: 0.75rem;
    color: #8b7faf;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* No cases placeholder */
.pq-cases-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.88rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .pq-main-section { padding: 40px 0 60px; }

    .pq-form-card { padding: 22px 18px; }
    .pq-result-card { padding: 20px 18px; }

    .pq-actions { flex-direction: column; }

    .pq-cases-panel { position: static; }
    .pq-cases-list { max-height: none; }

    .pq-table th:first-child, .pq-table td:first-child { display: none; }
}

@media (max-width: 480px) {
    .pq-hero-title { font-size: 1.65rem; }
    .pq-grade-options { flex-direction: column; }
    .pq-grade-detail { grid-template-columns: 1fr; }
}
