/* ============================================
   PC Build Config Price Calculator
   myyinghe.com - 硬核工坊
   ============================================ */

.pc-tool-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Header */
.pc-tool-header {
    text-align: center;
    margin-bottom: 24px;
}

.pc-tool-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.pc-tool-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Toolbar */
.pc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    align-items: center;
}

.pc-toolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-right: 4px;
}

.pc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap;
}

.pc-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-1px);
}

.pc-btn:active {
    transform: translateY(0);
}

.pc-btn.primary {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.pc-btn.primary:hover {
    background: #0052a3;
    border-color: #0052a3;
}

.pc-btn.success {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.pc-btn.success:hover {
    background: #218838;
    border-color: #1e7e34;
}

.pc-btn.danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.pc-btn.danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.pc-btn.warning {
    background: #f59f00;
    color: #fff;
    border-color: #f59f00;
}

.pc-btn.warning:hover {
    background: #e67700;
    border-color: #e67700;
}

.pc-btn.preset {
    background: #f1f3f5;
    color: #495057;
    border-color: #dee2e6;
    font-size: 13px;
    padding: 6px 12px;
}

.pc-btn.preset:hover {
    background: #e9ecef;
}

/* Table */
.pc-table-wrap {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pc-table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    white-space: nowrap;
}

.pc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

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

.pc-table tr:hover td {
    background: #f8f9fa;
}

.pc-table .col-cat { width: 130px; }
.pc-table .col-model { width: auto; }
.pc-table .col-price { width: 110px; text-align: right; }
.pc-table .col-note { width: 160px; }
.pc-table .col-action { width: 60px; text-align: center; }

/* Inputs */
.pc-select, .pc-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.pc-select:focus, .pc-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.08);
}

.pc-input.price {
    text-align: right;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-weight: 600;
    color: #e67700;
}

.pc-input.price::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Delete button */
.pc-del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #adb5bd;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.pc-del-btn:hover {
    background: #ffe6e6;
    color: #dc3545;
}

/* Empty state */
.pc-empty {
    text-align: center;
    padding: 48px 20px;
    color: #adb5bd;
}

.pc-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.pc-empty p {
    margin: 0;
    font-size: 14px;
}

/* Summary Bar */
.pc-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .pc-summary {
        grid-template-columns: 1fr;
    }
    .pc-toolbar {
        justify-content: center;
    }
}

.pc-summary-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pc-summary-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-total-price {
    font-size: 36px;
    font-weight: 800;
    color: #e67700;
    margin: 0 0 4px;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    letter-spacing: -1px;
}

.pc-total-label {
    font-size: 13px;
    color: #868e96;
}

/* Chart bars */
.pc-chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pc-chart-row:last-child {
    margin-bottom: 0;
}

.pc-chart-label {
    width: 60px;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-chart-bar-wrap {
    flex: 1;
    height: 22px;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pc-chart-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.pc-chart-value {
    width: 70px;
    font-size: 12px;
    color: #868e96;
    text-align: right;
    flex-shrink: 0;
    font-family: "SF Mono", Monaco, Consolas, monospace;
}

/* Chart colors */
.pc-chart-bar.cpu    { background: #0066cc; }
.pc-chart-bar.mb     { background: #e67700; }
.pc-chart-bar.ram    { background: #2b8a3e; }
.pc-chart-bar.gpu    { background: #c92a2a; }
.pc-chart-bar.ssd    { background: #5f3dc4; }
.pc-chart-bar.hdd    { background: #1971c2; }
.pc-chart-bar.psu    { background: #d9480f; }
.pc-chart-bar.case   { background: #087f5b; }
.pc-chart-bar.cooler { background: #0c8599; }
.pc-chart-bar.monitor{ background: #9c36b5; }
.pc-chart-bar.kbm    { background: #e03131; }
.pc-chart-bar.other  { background: #868e96; }

/* Export Modal */
.pc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.pc-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.pc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f5;
}

.pc-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.pc-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.pc-modal-close:hover {
    background: #f1f3f5;
    color: #495057;
}

.pc-modal-body {
    padding: 20px;
    overflow: auto;
    flex: 1;
}

.pc-modal-body pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    font-family: "SF Mono", Monaco, Consolas, "Noto Sans Mono CJK SC", monospace;
    color: #333;
    max-height: 400px;
    overflow: auto;
}

.pc-modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #f1f3f5;
    justify-content: flex-end;
}

/* Toast */
.pc-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d2d2d;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    pointer-events: none;
    white-space: nowrap;
}

.pc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
.pc-modal-body pre::-webkit-scrollbar,
.pc-table-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pc-modal-body pre::-webkit-scrollbar-thumb,
.pc-table-wrap::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 640px) {
    .pc-table .col-note { display: none; }
    .pc-table th.col-note { display: none; }
    .pc-table .col-cat { width: 100px; }
    .pc-table .col-price { width: 90px; }
}
