/* 异形二维码工具样式 */

.shaped-qr-page .main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    box-sizing: border-box;
}

.shaped-qr-page .header-section {
    text-align: center;
    margin-bottom: 24px;
}

.shaped-qr-page .header-section h1 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    color: #1a1a1a;
}

.shaped-qr-page .header-section .subtitle {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.shaped-qr-page .generator-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .shaped-qr-page .generator-layout {
        grid-template-columns: 1fr;
    }
}

.shaped-qr-page .input-section,
.shaped-qr-page .preview-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.shaped-qr-page .panel-section {
    padding: 18px 18px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.shaped-qr-page .panel-section:last-child {
    border-bottom: none;
}

.shaped-qr-page .panel-section h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #222;
}

.shaped-qr-page .panel-section--actions {
    padding-bottom: 18px;
}

.shaped-qr-page .form-group {
    margin-bottom: 14px;
}

.shaped-qr-page .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

.shaped-qr-page .form-textarea,
.shaped-qr-page .form-select,
.shaped-qr-page .form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}

.shaped-qr-page .form-textarea {
    min-height: 88px;
    resize: vertical;
}

.shaped-qr-page .form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #888;
}

.shaped-qr-page .ws-info-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.8125rem;
}

.shaped-qr-page .ws-info-chip--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.shaped-qr-page .ws-chip-actions {
    display: inline-flex;
    gap: 6px;
}

.shaped-qr-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
}

.shaped-qr-page .btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.shaped-qr-page .btn-primary {
    background: #0078d4;
    color: #fff;
}

.shaped-qr-page .btn-primary:hover {
    background: #005a9e;
}

.shaped-qr-page .btn-secondary {
    background: #f3f4f6;
    color: #333;
    border: 1px solid #e5e7eb;
}

.shaped-qr-page .btn-block {
    width: 100%;
    padding: 12px;
    font-weight: 600;
}

.shaped-qr-page .btn:disabled,
.shaped-qr-page .form-select:disabled,
.shaped-qr-page .form-textarea:disabled,
.shaped-qr-page .form-input:disabled,
.shaped-qr-page input[type="color"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.shaped-qr-page .size-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .shaped-qr-page .size-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.shaped-qr-page .size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.625rem 0.375rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.shaped-qr-page .size-option.active,
.shaped-qr-page .size-option:hover:not(:disabled) {
    border-color: #0078d4;
    background: #eef6fc;
}

.shaped-qr-page .size-option-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #222;
}

.shaped-qr-page .size-option-meta {
    font-size: 0.6875rem;
    color: #888;
}

.shaped-qr-page .shaped-frame-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.shaped-qr-page .shaped-frame-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.35rem 0.5rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.75rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.shaped-qr-page .shaped-frame-option:hover,
.shaped-qr-page .shaped-frame-option.is-active {
    border-color: #0078d4;
    background: #eef6fc;
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.25);
}

.shaped-qr-page .shaped-frame-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.shaped-qr-page .shaped-frame-thumb {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 0.625rem;
    background:
        linear-gradient(45deg, #ececec 25%, transparent 25%),
        linear-gradient(-45deg, #ececec 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ececec 75%),
        linear-gradient(-45deg, transparent 75%, #ececec 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.shaped-qr-page .shaped-frame-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.shaped-qr-page .shaped-frame-thumb--none {
    color: #999;
    font-size: 1.25rem;
    font-weight: 700;
    background: #f3f3f1;
}

.shaped-qr-page .shaped-frame-label {
    font-size: 0.625rem;
    line-height: 1.2;
    color: #888;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shaped-qr-page .frame-text-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px dashed #d1d5db;
    border-radius: 0.625rem;
    background: #f9fafb;
}

.shaped-qr-page .frame-text-panel[hidden] {
    display: none !important;
}

.shaped-qr-page .frame-text-panel__title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.shaped-qr-page .form-group--compact {
    margin-bottom: 0.5rem;
}

.shaped-qr-page .frame-text-flip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.shaped-qr-page .color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shaped-qr-page .color-chip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.shaped-qr-page .color-chip input[type="color"] {
    width: 48px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.shaped-qr-page .loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: #555;
    font-size: 0.875rem;
}

.shaped-qr-page .loading[hidden],
.shaped-qr-page .error-message[hidden],
.shaped-qr-page .preview-actions[hidden] {
    display: none !important;
}

.shaped-qr-page .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbeafe;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: shaped-spin 0.8s linear infinite;
}

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

.shaped-qr-page .error-message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.875rem;
}

.shaped-qr-page .preview-panel {
    padding: 18px;
    min-height: 420px;
    min-width: 0; /* 允许 grid 子项收缩，避免撑破右侧 */
    overflow: hidden;
    box-sizing: border-box;
}

.shaped-qr-page .preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.shaped-qr-page .preview-header h3 {
    margin: 0;
    font-size: 1rem;
}

.shaped-qr-page .preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.shaped-qr-page .shaped-qr-preview-area {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 280px;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.shaped-qr-page .shaped-qr-live {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 16rem;
    padding: 12px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    background:
        linear-gradient(45deg, #ececec 25%, transparent 25%),
        linear-gradient(-45deg, #ececec 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ececec 75%),
        linear-gradient(-45deg, transparent 75%, #ececec 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.shaped-qr-page .shaped-qr-live[hidden] {
    display: none !important;
}

.shaped-qr-page .shaped-qr-live svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(70vh, 420px);
    display: block;
    margin: 0 auto;
}

.shaped-qr-page .preview-placeholder-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.shaped-qr-page .preview-placeholder-wrap[hidden] {
    display: none !important;
}

.shaped-qr-page .preview-placeholder {
    text-align: center;
    color: #999;
    padding: 40px 16px;
}

.shaped-qr-page .preview-placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #c5c5c5;
}

.shaped-qr-page .shaped-qr-result {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(70vh, 420px);
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    background: #fff;
}

.shaped-qr-page .preview-info {
    margin-top: 14px;
    font-size: 0.875rem;
    color: #555;
}

.shaped-qr-page .info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
