.iceclock-wrapper {
    box-sizing: border-box;
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.iceclock-section {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.iceclock-section h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.iceclock-tip {
    margin: 8px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.iceclock-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.iceclock-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    min-width: 100px;
    background: #e5e7eb;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.iceclock-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.iceclock-btn-primary {
    background: #0f766e;
    color: #fff;
}

.iceclock-btn-welcome {
    background: #16a34a;
    color: #fff;
}

.iceclock-btn-goodbye {
    background: #dc2626;
    color: #fff;
}

.iceclock-ice-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iceclock-ice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    background: #f3f4f6;
    padding: 8px 10px;
    gap: 8px;
}

.iceclock-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iceclock-qty-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
}

.iceclock-qty-input {
    width: 48px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
    padding: 4px;
}

.iceclock-summary {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    min-height: 44px;
}

.iceclock-front-orders {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iceclock-order-item {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    padding: 10px;
}

.iceclock-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.iceclock-order-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.iceclock-order-time {
    font-size: 12px;
    color: #6b7280;
}

.iceclock-order-lines {
    white-space: pre-line;
    font-size: 14px;
    color: #1f2937;
}

.iceclock-timer-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.iceclock-timer-controls input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
}

.iceclock-timers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iceclock-timer-item {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.iceclock-timer-title {
    font-size: 14px;
    font-weight: 600;
}

.iceclock-timer-remain {
    font-size: 18px;
    font-weight: 700;
    color: #0f766e;
}

.iceclock-empty {
    color: #6b7280;
    font-size: 14px;
}

.iceclock-alert-box {
    border: 2px solid #dc2626;
    background: #fff1f2;
}

.iceclock-debug-section {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.iceclock-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.iceclock-debug-head h2 {
    margin: 0;
    font-size: 16px;
}

.iceclock-debug-toggle {
    min-width: auto;
    padding: 6px 12px;
    font-size: 13px;
}

.iceclock-debug-body {
    width: 100%;
    max-height: 46vh;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
}

.iceclock-debug-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

.iceclock-debug-row span {
    color: #94a3b8;
}

.iceclock-debug-row strong {
    color: #f8fafc;
    word-break: break-word;
}

.iceclock-debug-log-wrap {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #334155;
}

.iceclock-debug-log-title {
    color: #94a3b8;
    margin-bottom: 6px;
}

.iceclock-debug-log {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.iceclock-sound-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.iceclock-sound-gate-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
}

@keyframes iceclock-flash {
    0% { background-color: #fff; }
    25% { background-color: #fee2e2; }
    50% { background-color: #fff; }
    75% { background-color: #fee2e2; }
    100% { background-color: #fff; }
}

.iceclock-page-alert .iceclock-wrapper {
    animation: iceclock-flash 0.8s ease-in-out;
}

@media (max-width: 640px) {
    .iceclock-wrapper {
        padding: 12px;
    }

    .iceclock-btn {
        min-width: 88px;
        padding: 9px 12px;
    }

    .iceclock-timer-remain {
        font-size: 16px;
    }

    .iceclock-debug-body {
        max-height: 40vh;
    }
}
