* { box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: #f7f8fa;
    margin: 0;
    padding: 0;
    color: #333;
}

.header {
    background: #fff;
    padding: 16px 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #222;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.container {
    width: 100%;
    padding: 16px;
    margin-bottom: 60px;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.card1 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.card2 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.card-content {
    display: flex;
    align-items: flex-start;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: #ffb300;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.card-icon i {
    color: white;
    font-size: 1.2rem;
}

.card-text {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    color: #222;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}
.clear-btn {
    position: absolute;
    right: 35px; /* 减少这个值向左移动 */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 18px;
    width: 20px;
    height: 120px;
    text-align: center;
    line-height: 20px;
    z-index: 10; /* 确保在最上层 */
    transition: color 0.3s, right 0.3s; /* 添加平滑过渡 */
}

/* 调整后的搜索框容器 */
.search-box {
    position: relative;
    overflow: visible; /* 确保不被裁剪 */
}
.search-bar-container {
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 52px;
    z-index: 9;
}

.search-box {
    display: flex;
    width: 100%;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    background: #f5f5f5;
    align-items: center;
    padding-left: 12px;
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    padding: 0 16px;
    font-size: 0.95rem;
    background: transparent;
    outline: none;
}

.search-btn {
    height: 100%;
    border: none;
    background: #ffb300;
    color: #fff;
    font-size: 0.75rem !important;
    font-weight: bold;
    padding: 0 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:active {
    background: #ff9800;
}

.search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-icon {
    color: #999;
    font-size: 1rem;
    margin-right: 8px;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 18px 16px 10px 16px;
    margin: 20px 0 0 0;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.info-label {
    color: #999;
    font-size: 14px;
    margin-bottom: 4px;
    width: 100px;
}

.info-value {
    color: #222;
    font-size: 16px;
    word-break: break-all;
    flex: 1;
}

.error-msg {
    color: red;
    margin: 20px 0;
    text-align: center;
}

.loading-msg {
    color: #888;
    margin: 20px 0;
    text-align: center;
}

.json-viewer {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}

.back-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: #ffb300;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.back-btn i {
    margin-right: 8px;
}
/* ICCID识别按钮 */
.ocr-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    cursor: pointer;
}

/* 摄像头模态框 */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 1000;
    display: none; /* 默认隐藏 */
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1010;
}

/* 提示文字 */
.ocr-tip {
    position: absolute;
    top: 60px;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 12px;
    padding: 0 10px;
    z-index: 1010;
}

/* 预览区域 */
.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#cameraPreview, .image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充屏幕 */
}

/* 操作按钮区 */
.action-buttons {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 40px;
    z-index: 1010;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.album-btn {
    background-color: #2196F3;
}

.capture-btn {
    background-color: #f44336;
}

/* 结果提示框 */
.result-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2000;
    display: none;
}
@media (min-width: 400px) {
    .container {
        max-width: 400px;
        margin: 0 auto;
    }
}