/* ===== Steel Profiles (常用型钢) Page Styles ===== */

/* ---- Hub Page ---- */
.steel-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 60%, #0ea5e9 100%);
    padding: 3.5rem 0 2.5rem;
    color: #fff;
    text-align: center;
}

.steel-hero h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.steel-hero p {
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
}

.steel-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

/* ---- Section Headers ---- */
.steel-section {
    padding: 2.5rem 0 1rem;
}

.steel-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steel-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Profile Grid ---- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .profile-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .profile-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
}

@media (max-width: 480px) {
    .profile-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
}

/* ---- Profile Card ---- */
.profile-card {
    position: relative;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    overflow: hidden;
}

.profile-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.profile-card.unavailable {
    cursor: default;
    opacity: 0.65;
}

.profile-card.unavailable:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}

.profile-card .badge-coming {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--bg-alt);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.profile-icon-wrap {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-icon-wrap svg {
    width: 48px;
    height: 48px;
}

.profile-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* ---- Profile Detail Page ---- */
.profile-detail-header {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}

.profile-detail-header .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 0.75rem;
}

.profile-detail-header .back-btn:hover {
    color: var(--primary);
}

.profile-detail-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
}

.profile-detail-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ---- Tab System ---- */
.tab-container {
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 44px;
    z-index: 100;
}

.tab-list {
    display: flex;
    gap: 0;
}

.tab-btn {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) {
    color: var(--text);
}

.tab-btn.disabled {
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Custom Calc Panel ---- */
.custom-panel {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .custom-panel {
        grid-template-columns: 1fr;
        padding: 1.25rem 0;
    }
}

/* SVG Diagram */
.diagram-box {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.diagram-box svg {
    max-width: 100%;
    max-height: 220px;
}

/* Input Form */
.input-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-with-unit {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    transition: var(--transition);
}

.input-with-unit:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.input-with-unit input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem 0.65rem;
    font-size: 0.92rem;
    color: var(--text);
    background: transparent;
    min-width: 0;
}

.input-unit {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

/* Material Select */
.material-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    background: var(--bg);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.material-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.toggle-btn.active {
    background: var(--primary);
    color: #fff;
}

.toggle-btn:not(.active):hover {
    background: var(--bg-alt);
}

/* Buttons */
.btn-calc {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-calc:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-clear {
    padding: 0.6rem 1rem;
    background: var(--bg-alt);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-clear:hover {
    background: var(--border);
    color: var(--text);
}

.btn-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* ---- Result Cards ---- */
.results-section {
    margin-top: 1.5rem;
    display: none;
}

.results-section.visible { display: block; }

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}

.result-card {
    background: var(--primary-light);
    border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}

.result-card.highlight {
    background: var(--primary);
    color: #fff;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-card.highlight .result-label { color: rgba(255,255,255,0.8); }

.result-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.result-card.highlight .result-value { color: #fff; }

.result-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.1rem;
}

.result-card.highlight .result-unit { color: rgba(255,255,255,0.7); }

/* Process button */
.btn-process {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-process:hover { color: var(--primary); border-color: var(--primary); }

/* ---- Lookup Panel ---- */
.lookup-panel {
    padding: 1.5rem 0;
}

/* Sub-tabs for standards */
.std-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.std-tab-btn {
    padding: 0.4rem 0.9rem;
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.std-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Search bar */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    background: var(--bg);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.search-bar .clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    display: none;
    padding: 0;
    line-height: 1;
}

.search-bar input:not(:placeholder-shown) ~ .clear-search { display: block; }

/* Spec list */
.spec-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.spec-list::-webkit-scrollbar { width: 4px; }
.spec-list::-webkit-scrollbar-track { background: var(--bg-alt); }
.spec-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.spec-item {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.spec-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.spec-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.spec-item-main .spec-model {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.spec-item-main .spec-dims {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.spec-item-meta {
    text-align: right;
}

.spec-weight {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.spec-weight-unit {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: block;
}

.spec-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.loading-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Lookup calc section */
.lookup-calc {
    margin-top: 1.5rem;
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: none;
}

.lookup-calc.visible { display: block; }

.lookup-calc-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-spec-info {
    background: var(--primary-light);
    border: 1px solid rgba(37,99,235,0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.selected-spec-info strong { color: var(--primary); }

.lookup-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    align-items: end;
}

@media (max-width: 600px) {
    .lookup-inputs { grid-template-columns: 1fr 1fr; }
}

/* Process modal */
.process-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.process-modal {
    background: var(--bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 640px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.process-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.process-modal h3 { font-size: 1.1rem; font-weight: 700; }

.process-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.process-content {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 1rem;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Empty/error states */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .steel-hero h1 { font-size: 1.65rem; }
    .tab-btn { padding: 0.75rem 1rem; font-size: 0.88rem; }
    .results-grid { grid-template-columns: 1fr 1fr; }
}
